Do not mask with 160-bits after CREATE/CREATE2

This commit is contained in:
Alex Beregszaszi 2019-03-04 14:00:54 +01:00
parent 7aa2ee1775
commit 1272951bbb
2 changed files with 4 additions and 1 deletions

View File

@ -13,6 +13,7 @@ Compiler Features:
* Optimizer: Add new rules with constants including ``LT``, ``GT``, ``AND`` and ``BYTE``.
* Optimizer: Add rule for shifts with constants for Constantinople.
* Optimizer: Combine multiple shifts with constant shift-by values into one.
* Optimizer: Do not mask with 160-bits after ``CREATE`` and ``CREATE2`` as they are guaranteed to return an address or 0.
* Optimizer: Support shifts in the constant optimiser for Constantinople.
* Yul Optimizer: Add rule to replace switch statements with const expr. with matching case body

View File

@ -237,7 +237,9 @@ std::vector<SimplificationRule<Pattern>> simplificationRuleListPart5(
Instruction::ADDRESS,
Instruction::CALLER,
Instruction::ORIGIN,
Instruction::COINBASE
Instruction::COINBASE,
Instruction::CREATE,
Instruction::CREATE2
})
{
u256 const mask = (u256(1) << 160) - 1;