[InstCombine] Fold icmp of trunc nuw/nsw (#90436)
Convert the existing foldICmpTruncWithTruncOrExt() fold to work with trunc nowrap flags instead of computeKnownBits(). This also allows us to generalize the fold to work with signed comparisons. Interestingly, apart from the obvious combinations like signed predicates with trunc nsw, some non-obvious ones are also legal. For example for unsigned predicates we can do the transform for two trunc nsw as well (rather than only trunc nuw). Proofs: https://alive2.llvm.org/ce/z/ndewwK
parent
fc83eda4
Please register or sign in to comment