[PATCH] D44282: [PR16756] JumpThreading: explicitly update SSA rather than use SSAUpdater.

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 25 18:44:44 PDT 2018


davide added a subscriber: zhendongsu.
davide added a comment.

I don't mind this approach, but as discussed offline we should consider also moving LCSSA to make sure the API makes sense.
In general, what's your plan for this? You want it to replace the SSA updater for all the instances in llvm? If so, we should carefully plan the transition costs.

@zhendongsu could do a round of testing before we decide whether this can go in to shake bugs.

Also, do you know why the second invocation of Jump threading is taking so long?



================
Comment at: llvm/lib/Transforms/Utils/SSAUpdaterBulk.cpp:25-26
+
+#define DEBUG_TYPE "ssaupdater"
+
+/// Add a new variable to the SSA rewriter. This needs to be called before
----------------
should this be `ssaupdaterbulk`?


================
Comment at: llvm/lib/Transforms/Utils/SSAUpdaterBulk.cpp:52-54
+  if (!Rewrites.count(Var))
+    return false;
+  return Rewrites[Var].Defines.count(BB);
----------------
ternary


================
Comment at: llvm/lib/Transforms/Utils/SSAUpdaterBulk.cpp:111
+static BasicBlock *getUserBB(Use *U) {
+  Instruction *User = cast<Instruction>(U->getUser());
+
----------------
auto


================
Comment at: llvm/lib/Transforms/Utils/SSAUpdaterBulk.cpp:113
+
+  if (PHINode *UserPN = dyn_cast<PHINode>(User))
+    return UserPN->getIncomingBlock(*U);
----------------
auto


Repository:
  rL LLVM

https://reviews.llvm.org/D44282





More information about the llvm-commits mailing list