Merge pull request #1270 from ethereum/optimise-eq0

Optimise the PUSH 0, EQ case as ISZERO
This commit is contained in:
chriseth 2016-10-24 15:50:31 +02:00 committed by GitHub
commit 9e0594f4c1

View File

@ -257,6 +257,7 @@ Rules::Rules()
{{Instruction::MOD, {0, X}}, [=]{ return u256(0); }},
{{Instruction::AND, {X, 0}}, [=]{ return u256(0); }},
{{Instruction::OR, {X, ~u256(0)}}, [=]{ return ~u256(0); }},
{{Instruction::EQ, {X, 0}}, [=]() -> Pattern { return {Instruction::ISZERO, {X}}; } },
// operations involving an expression and itself
{{Instruction::AND, {X, X}}, [=]{ return X; }},
{{Instruction::OR, {X, X}}, [=]{ return X; }},