diff --git a/Changelog.md b/Changelog.md index 6c3e1ba4f..e81de927c 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,6 +4,7 @@ Language Features: * Possibility to use ``catch Panic(uint code)`` to catch a panic failure from an external call. Compiler Features: + * Optimizer: Add rule to replace ``iszero(sub(x,y))`` by ``eq(x,y)``. * Parser: Report meaningful error if parsing a version pragma failed. * SMTChecker: Support ABI functions as uninterpreted functions. diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/sub_eq.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/iszero_sub_to_eq.yul similarity index 73% rename from test/libyul/yulOptimizerTests/expressionSimplifier/sub_eq.yul rename to test/libyul/yulOptimizerTests/expressionSimplifier/iszero_sub_to_eq.yul index 5380c1905..7efa54b02 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/sub_eq.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/iszero_sub_to_eq.yul @@ -2,7 +2,7 @@ let a := calldataload(0) let b := calldataload(0x20) let x := sub(a, b) - if gt(x, 0) { + if iszero(x) { sstore(0, 1) } } @@ -12,5 +12,5 @@ // { // let _1 := 0 // let a := calldataload(_1) -// if iszero(eq(a, calldataload(0x20))) { sstore(_1, 1) } +// if eq(a, calldataload(0x20)) { sstore(_1, 1) } // }