[llvm] [ConstraintElim] Check the other signedness when hasSameSign (PR #128168)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 21 09:58:50 PST 2025


================
@@ -1460,6 +1460,13 @@ static bool checkAndReplaceCondition(
           checkCondition(Cmp->getPredicate(), Cmp->getOperand(0),
                          Cmp->getOperand(1), Cmp, Info))
     return ReplaceCmpWithConstant(Cmp, *ImpliedCondition);
+
+  if (Cmp->hasSameSign() && Cmp->isRelational())
+    if (auto ImpliedCondition =
+            checkCondition(Cmp->getFlippedSignednessPredicate(),
----------------
artagnon wrote:

Nit: `getSignedPredicate`

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


More information about the llvm-commits mailing list