[PATCH] D153660: [ConstraintElim] Track and simplify conditions at use.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 07:01:24 PDT 2023


fhahn marked 3 inline comments as done.
fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/ConstraintElimination.cpp:666
+  if (auto *Phi = dyn_cast<PHINode>(UserI))
+    UserI = Phi->getIncomingBlock(U.getOperandNo())->getTerminator();
+  return UserI;
----------------
nikic wrote:
> No need for getOperandNo, there's an overload for Uses.
Done, thanks!


================
Comment at: llvm/lib/Transforms/Scalar/ConstraintElimination.cpp:721
+      return Inst;
+    return dyn_cast<Instruction>(*U);
+  }
----------------
nikic wrote:
> The dyn_cast is needed because it may have been replaced by a constant already?
Yes, I added a comment here.


================
Comment at: llvm/lib/Transforms/Scalar/ConstraintElimination.cpp:1285
 
-    LLVM_DEBUG({
-      dbgs() << "Processing ";
-      if (CB.IsCheck)
-        dbgs() << "condition to simplify: " << *CB.Inst;
-      else
-        dbgs() << "fact to add to the system: " << *CB.Inst;
-      dbgs() << "\n";
-    });
+    LLVM_DEBUG(dbgs() << "Processing ";);
 
----------------
nikic wrote:
> Stray semicolon
removed, thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153660



More information about the llvm-commits mailing list