[llvm] [EarlyCSE] Fix improper icmp simplification (PR #122043)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 8 00:08:34 PST 2025
llvmssh wrote:
> > https://godbolt.org/z/1MfndEMMs
>
> In this case, `%4` is passed into `_ZN1A5valueEv` which has `noundef` and `nonnull/dereferenceable` parameter attributes. The optimizer will assume `%4` is nonnull in the subsequent execution path.
>
> Without `noundef` and `nonnull/dereferenceable`, the icmp will not be optimized out: https://godbolt.org/z/chhxE3Txr
Yes, icmp is simplified with its information. Should we add the check of volatile to icmp simplify?
https://github.com/llvm/llvm-project/pull/122043
More information about the llvm-commits
mailing list