[PATCH] D155782: [ConstraintElim] Store the triple Pred + LHS + RHS in ReproducerEntry instead of CmpInst + Not

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 00:24:14 PDT 2023


nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: llvm/lib/Transforms/Scalar/ConstraintElimination.cpp:997
 
-    LLVM_DEBUG(dbgs() << "  Materializing assumption " << *Entry.Cond << "\n");
-    CmpInst::Predicate Pred = Entry.Cond->getPredicate();
-    if (Entry.IsNot)
-      Pred = CmpInst::getInversePredicate(Pred);
-
-    CloneInstructions({Entry.Cond->getOperand(0), Entry.Cond->getOperand(1)},
-                      CmpInst::isSigned(Entry.Cond->getPredicate()));
+    LLVM_DEBUG(dbgs() << "  Materializing assumption " << Entry.Pred << ' ';
+               Entry.LHS->printAsOperand(dbgs()); dbgs() << ", ";
----------------
Add an `icmp` prefix to make it the same as the previous output?


================
Comment at: llvm/lib/Transforms/Scalar/ConstraintElimination.cpp:999
+               Entry.LHS->printAsOperand(dbgs()); dbgs() << ", ";
+               Entry.RHS->printAsOperand(dbgs()); dbgs() << "\n");
+    CloneInstructions({Entry.LHS, Entry.RHS}, CmpInst::isSigned(Entry.Pred));
----------------
You can pass `false` as the second arg here to avoid printing the type again, matching how icmp is usually printed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155782/new/

https://reviews.llvm.org/D155782



More information about the llvm-commits mailing list