[llvm] [InstCombine] Support trunc nuw condition in foldAndOrOfICmps (PR #221555)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 6 12:21:31 PDT 2026


================
@@ -3523,13 +3522,15 @@ Value *InstCombinerImpl::foldAndOrOfICmps(Value *LHS, Value *RHS,
   if (!IsLogical) {
     // E.g. (icmp slt x, 0) | (icmp sgt x, n) --> icmp ugt x, n
     // E.g. (icmp sge x, 0) & (icmp slt x, n) --> icmp ult x, n
-    if (Value *V = simplifyRangeCheck(PredL, LHS0, LHS1, PredR, RHS0, RHS1, RHS,
+    if (Value *V = simplifyRangeCheck(PredL, LHS0, LHS1, PredR, RHS0, RHS1,
+                                      cast<Instruction>(RHS),
----------------
dtcxzyw wrote:

Use &I instead?


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


More information about the llvm-commits mailing list