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

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 10:00:49 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,
----------------
artagnon wrote:

I would have expected samesign to be illegal on ICmps with equality predicates? What sense does `icmp samesign eq` or `icmp samesign ne` make?

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


More information about the llvm-commits mailing list