[llvm] SCEV: teach isImpliedViaOperations about samesign (PR #124270)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 30 18:47:16 PST 2025


================
@@ -11882,22 +11880,23 @@ bool ScalarEvolution::isImpliedCondBalancedTypes(
     // Forms 1. and 2. require swapping the operands of one condition. Don't
     // do this if it would break canonical constant/addrec ordering.
     if (!isa<SCEVConstant>(RHS) && !isa<SCEVAddRecExpr>(LHS))
-      return isImpliedCondOperands(FoundPred, RHS, LHS, FoundLHS, FoundRHS,
-                                   CtxI);
+      return isImpliedCondOperands(ICmpInst::getSwappedCmpPredicate(*P), RHS,
----------------
goldsteinn wrote:

IMO the double `getSwappedCmpPredicate` on `FoundPred` is less clear than just `FoundPred` here.

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


More information about the llvm-commits mailing list