[llvm] [InstCombine] Fold `icmp samesign u{gt/lt} (X +nsw C2), C` -> `icmp s{gt/lt} X, (C - C2)` (PR #169960)

Andreas Jonson via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 30 11:44:05 PST 2025


================
@@ -3132,7 +3132,7 @@ Instruction *InstCombinerImpl::foldICmpAddConstant(ICmpInst &Cmp,
 
   Value *Op0, *Op1;
   Instruction *Ext0, *Ext1;
-  const CmpInst::Predicate Pred = Cmp.getPredicate();
+  const CmpPredicate Pred(Cmp.getPredicate(), Cmp.hasSameSign());
----------------
andjo403 wrote:

use getCmpPredicate instead

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


More information about the llvm-commits mailing list