mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
libevmasm: generalize ADDPOP optimization into ADDMODPOP etc
This commit is contained in:
parent
c0fe5fbe9b
commit
b6ffb6c8b7
@ -68,14 +68,15 @@ struct AddPop
|
|||||||
{
|
{
|
||||||
Instruction i0 = _in[0].instruction();
|
Instruction i0 = _in[0].instruction();
|
||||||
if (instructionInfo(i0).ret == 1 &&
|
if (instructionInfo(i0).ret == 1 &&
|
||||||
instructionInfo(i0).args == 2 &&
|
|
||||||
!SemanticInformation::invalidatesMemory(i0) &&
|
!SemanticInformation::invalidatesMemory(i0) &&
|
||||||
!SemanticInformation::invalidatesStorage(i0)
|
!SemanticInformation::invalidatesStorage(i0) &&
|
||||||
|
!SemanticInformation::altersControlFlow(i0) &&
|
||||||
|
!instructionInfo(i0).sideEffects
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
*_out = Instruction::POP;
|
for (int j = 0; j < instructionInfo(i0).args; j++)
|
||||||
*_out = Instruction::POP;
|
*_out = Instruction::POP;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user