mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add more optimisation rules for shifts
This commit is contained in:
parent
c5577145d3
commit
fd936439a4
@ -6,6 +6,7 @@ Language Features:
|
||||
Compiler Features:
|
||||
* SMTChecker: Do not report underflow/overflow if they always revert. This removes false positives when using ``SafeMath``.
|
||||
* Static Analyzer: Warn about expressions with custom types when they have no effect.
|
||||
* Optimizer: Add rule for shifts with constants for Constantinople.
|
||||
|
||||
|
||||
Bugfixes:
|
||||
|
@ -140,6 +140,10 @@ std::vector<SimplificationRule<Pattern>> simplificationRuleListPart2(
|
||||
{{Instruction::MOD, {0, X}}, [=]{ return u256(0); }, true},
|
||||
{{Instruction::EQ, {X, 0}}, [=]() -> Pattern { return {Instruction::ISZERO, {X}}; }, false },
|
||||
{{Instruction::EQ, {0, X}}, [=]() -> Pattern { return {Instruction::ISZERO, {X}}; }, false },
|
||||
{{Instruction::SHL, {0, X}}, [=]{ return X; }, false},
|
||||
{{Instruction::SHR, {0, X}}, [=]{ return X; }, false},
|
||||
{{Instruction::SHL, {X, 0}}, [=]{ return u256(0); }, true},
|
||||
{{Instruction::SHR, {X, 0}}, [=]{ return u256(0); }, true},
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user