mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Optimize double ISZERO.
This commit is contained in:
parent
cad767de61
commit
7bdd1b1d4a
@ -260,6 +260,22 @@ Rules::Rules()
|
||||
|
||||
{{Instruction::NOT, {{Instruction::NOT, {X}}}}, [=]{ return X; }},
|
||||
};
|
||||
// Double negation of opcodes with binary result
|
||||
for (auto const& op: vector<Instruction>{
|
||||
Instruction::EQ,
|
||||
Instruction::LT,
|
||||
Instruction::SLT,
|
||||
Instruction::GT,
|
||||
Instruction::SGT
|
||||
})
|
||||
m_rules.push_back({
|
||||
{Instruction::ISZERO, {{Instruction::ISZERO, {{op, {X, Y}}}}}},
|
||||
[=]() -> Pattern { return {op, {X, Y}}; }
|
||||
});
|
||||
m_rules.push_back({
|
||||
{Instruction::ISZERO, {{Instruction::ISZERO, {{Instruction::ISZERO, {X}}}}}},
|
||||
[=]() -> Pattern { return {Instruction::ISZERO, {X}}; }
|
||||
});
|
||||
// Associative operations
|
||||
for (auto const& opFun: vector<pair<Instruction,function<u256(u256 const&,u256 const&)>>>{
|
||||
{Instruction::ADD, plus<u256>()},
|
||||
|
Loading…
Reference in New Issue
Block a user