[llvm] [InstCombine] `A == MIN_INT ? B != MIN_INT : A < B` to `A < B` (PR #120177)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 18 06:26:48 PST 2024


================
@@ -1795,6 +1843,10 @@ static Instruction *foldSelectICmpEq(SelectInst &SI, ICmpInst *ICI,
   if (Pred == ICmpInst::ICMP_NE)
     std::swap(TrueVal, FalseVal);
 
+  if (Value *V = foldSelectWithExtremeEqCond(CmpLHS, CmpRHS, TrueVal, FalseVal,
+                                             IC.Builder))
+    return IC.replaceInstUsesWith(SI, V);
----------------
dtcxzyw wrote:

```suggestion
    return Res;
```

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


More information about the llvm-commits mailing list