You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The patches introduce selection DAG patterns that fold uaddo, umulo, usubo into add!, mul!, sub! correspondingly. However, as it explained in the bug report, and another one[change to public links] this selection is incorrect as the original nodes create flags that persist while EraVM instructions set flags that can be overwritten. The rest of the logic in original patches could be kept as it is modulo to porting to LLVM 17.
The rearrangeOverflowHandlingBranches function implementation from the commit f31aa85 should be moved from the EraVMCodegenPrepare pass to the newly introduced EraVMPostCodegenPrepare pass (#493). This is because CodeGenPrepare can generate overflow intrinsics, and EraVMPostCodegenPrepare is executed immediately after that pass.
The goal is to fix and restore the reverted patches:
The patches introduce selection DAG patterns that fold
uaddo
,umulo
,usubo
intoadd!
,mul!
,sub!
correspondingly. However, as it explained in the bug report, and another one [change to public links] this selection is incorrect as the original nodes create flags that persist while EraVM instructions set flags that can be overwritten. The rest of the logic in original patches could be kept as it is modulo to porting to LLVM 17.== Bug reproducers ==
cargo run --verbose --release --bin compiler-tester -- --path tests/solidity/simple/modular/addmod_complex.sol --mode='Y+M*B* 0.8.21' --load-system-contracts system-contracts-stable-build
compiler-tester/tests/solidity/simple/bug.sol
:cargo run --verbose --release --bin compiler-tester -- --path tests/solidity/simple/bug.sol --mode='Y+M*B* 0.8.23'
The text was updated successfully, but these errors were encountered: