[llvm] [InstCombine] Do not apply unsigned sub identities when flipping icmp strictness in `foldICmpBinOp` (PR #219904)
Antonio Frighetto via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 31 06:00:32 PDT 2026
================
@@ -2122,6 +2122,44 @@ define i1 @icmp_ule_offset_with_common_divisor(i64 %x, i64 %y) {
ret i1 %cmp
}
+; Ensure the identity icmp ult (A - B), Op1 to icmp ule A, Op1 does not occur
+; when the or disjoint is matched as an add, as nuw of add does not imply nowrap
+; of the unsigned subtraction.
+; FIXME: This is a miscompilation.
+define i1 @icmp_ult_neg_offset_or_disjoint(i16 %arg) "instcombine-no-verify-fixpoint" {
----------------
antoniofrighetto wrote:
Sure, thanks. Could this be a relevant missed fixpoint opportunity (i.e., should we possibly have a mechanism to revisit dominated instructions upon branch conditions changes, compile-time permitting)?
https://github.com/llvm/llvm-project/pull/219904
More information about the llvm-commits
mailing list