[llvm] [InstCombine] Fold trunc nuw/nsw (shl exact %x, %y) to i1 -> icmp ne %x, 0 (PR #210499)

Andreas Jonson via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 18 03:31:18 PDT 2026


================

----------------
andjo403 wrote:

needs to be done before SimplifyDemandedInstructionBits as it remove the nuw/nsw from the trunc and exact from the new lshr when ashr only have one use see eg. the test trunc_nuw_ashr_exact

I think the exact can be preserved for the lshr when ashr have excat but do not know if it is possible to save the nuw/nsw for the trunc

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


More information about the llvm-commits mailing list