mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #6256 from ethereum/completeLtGtRules
Complete the GT/LT rules.
This commit is contained in:
commit
4c1a9aa273
@ -10,6 +10,7 @@ Language Features:
|
||||
|
||||
|
||||
Compiler Features:
|
||||
* Optimizer: Add rules for ``lt``-comparisons with constants.
|
||||
* Peephole Optimizer: Remove double ``iszero`` before ``jumpi``.
|
||||
* SMTChecker: Support enums without typecast.
|
||||
* SMTChecker: Support one-dimensional arrays.
|
||||
|
@ -146,10 +146,12 @@ std::vector<SimplificationRule<Pattern>> simplificationRuleListPart2(
|
||||
{{Instruction::SHR, {0, X}}, [=]{ return X; }, false},
|
||||
{{Instruction::SHL, {X, 0}}, [=]{ return u256(0); }, true},
|
||||
{{Instruction::SHR, {X, 0}}, [=]{ return u256(0); }, true},
|
||||
{{Instruction::LT, {X, 0}}, [=]{ return u256(0); }, true},
|
||||
{{Instruction::GT, {X, 0}}, [=]() -> Pattern { return {Instruction::ISZERO, {{Instruction::ISZERO, {X}}}}; }, false},
|
||||
{{Instruction::LT, {0, X}}, [=]() -> Pattern { return {Instruction::ISZERO, {{Instruction::ISZERO, {X}}}}; }, false},
|
||||
{{Instruction::GT, {X, ~u256(0)}}, [=]{ return u256(0); }, true},
|
||||
{{Instruction::LT, {~u256(0), X}}, [=]{ return u256(0); }, true},
|
||||
{{Instruction::GT, {0, X}}, [=]{ return u256(0); }, true},
|
||||
{{Instruction::LT, {X, 0}}, [=]{ return u256(0); }, true},
|
||||
{{Instruction::AND, {{Instruction::BYTE, {X, Y}}, {u256(0xff)}}}, [=]() -> Pattern { return {Instruction::BYTE, {X, Y}}; }, false},
|
||||
{{Instruction::BYTE, {X, 31}}, [=]() -> Pattern { return {Instruction::AND, {X, u256(0xff)}}; }, false}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user