[llvm-branch-commits] [llvm] [SCEV] Derive x >=s 0 from x <u y and y <=u 2^(n-1) (PR #231631)

Max Kazantsev via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Oct 21 17:57:47 PDT 2026


================
@@ -12239,15 +12239,28 @@ bool ScalarEvolution::isImpliedCondBalancedTypes(
     return CmpInst::isRelational(P2) &&
            P1 == ICmpInst::getFlippedSignednessPredicate(P2);
   };
-  if (IsSignFlippedPredicate(Pred, FoundPred)) {
+  // If swapping query's operands makes the predicates sign-flipped, do it. E.g.
----------------
xortator wrote:

This is getting big. Did you consider factoring it out into a separate function?

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


More information about the llvm-branch-commits mailing list