[clang] [SCCP] [Transform] Adding ICMP folding for zext and sext in SCCPSolver (PR #67594)

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 27 13:20:58 PDT 2023


https://github.com/nikic requested changes to this pull request.

If I understood correctly, what you're trying to do here is to apply an icmp fold early before the sext -> zext information gets lost. I don't think this is the correct way to approach the problem. The correct way is to preserve the fact that the operand is non-negative when converting to zext, which would allow the InstCombine fold to reliably undo this. In fact, there is a pending patch for this at https://reviews.llvm.org/D156444.

https://github.com/llvm/llvm-project/pull/67594


More information about the cfe-commits mailing list