[llvm] ConstraintElim: teach fact-transfer about samesign (PR #115893)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 13 17:19:25 PST 2024


================
@@ -1794,7 +1803,14 @@ static bool eliminateConstraints(Function &F, DominatorTree &DT, LoopInfo &LI,
       if (ReproducerModule && DFSInStack.size() > ReproducerCondStack.size())
         ReproducerCondStack.emplace_back(Pred, A, B);
 
-      Info.transferToOtherSystem(Pred, A, B, CB.NumIn, CB.NumOut, DFSInStack);
+      // If samesign is present on the ICmp, simply transfer the signed system
+      // to the unsigned system, and viceversa.
+      if (HasSameSign)
+        Info.addFact(CmpInst::getFlippedSignednessPredicate(Pred), A, B,
----------------
dtcxzyw wrote:

Should avoid duplicating facts with equality predicates.


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


More information about the llvm-commits mailing list