[llvm] [ConstraintElim] Handle (X | Y) >=s 0 as X >=s 0 && Y >=s 0. (PR #209743)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 15 06:15:20 PDT 2026
================
@@ -1980,6 +1980,30 @@ static bool eliminateConstraints(Function &F, DominatorTree &DT, LoopInfo &LI,
DFSInStack);
}
+ // (X | Y) >=s 0 implies X >=s 0 and Y >=s 0, because the sign bit of an
+ // OR is the OR of the operand sign bits. Look through this
+ // canonicalization by InstCombine. disjunct so it is available to the
+ // solver.
+ if ((Pred == CmpInst::ICMP_SGE && match(B, m_Zero())) ||
+ (Pred == CmpInst::ICMP_SGT && match(B, m_AllOnes()))) {
----------------
nikic wrote:
sge 0 is non-canonical, do we need to handle it here?
https://github.com/llvm/llvm-project/pull/209743
More information about the llvm-commits
mailing list