[llvm] [IPSCCP] Do not attempt `tryToReplaceWithConstant` if may break invariants (PR #102820)
Antonio Frighetto via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 11 09:18:41 PDT 2024
antoniofrighetto wrote:
> It's even more obvious when you consider that the returned constant may just be a constant integer/float rather than a global. That can open up all kinds of optimizations, and is also something where rematerialization is more likely to be profitable.
Makes sense. Could reverting the constant replacement be an option, once DCE and friends have used SCCP results and have run, and we know materializing the constant turned out to be not profitable (as it is the case in https://github.com/llvm/llvm-project/issues/102791?). So, possibly somewhere in SelectionDAG?
https://github.com/llvm/llvm-project/pull/102820
More information about the llvm-commits
mailing list