[llvm] [InstCombine] Folding `(icmp eq/ne (and X, -P2), INT_MIN)` (PR #110880)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 3 09:46:03 PDT 2024
================
@@ -5015,6 +5015,20 @@ Instruction *InstCombinerImpl::foldICmpBinOp(ICmpInst &I,
}
}
+ // (icmp eq/ne (X, -P2), INT_MIN)
+ // -> (icmp slt/sge X, INT_MIN + P2)
+ if (ICmpInst::isEquality(Pred) && BO0 &&
+ match(I.getOperand(1), m_SignMask())) {
+ Value *X;
----------------
nikic wrote:
There's already a `Value *X` declaration above, so you can drop this one and merge both ifs.
https://github.com/llvm/llvm-project/pull/110880
More information about the llvm-commits
mailing list