[PATCH] [PlaceSafepoints] Reduce dominator tree recalculation

Philip Reames listmail at philipreames.com
Tue May 12 17:35:05 PDT 2015


================
Comment at: lib/Transforms/Scalar/PlaceSafepoints.cpp:661
@@ +660,3 @@
+  for (Instruction *PollLocation : PollsNeeded) {
+    std::vector<CallSite> RuntimeCalls;
+    InsertSafepointPoll(PollLocation, RuntimeCalls);
----------------
sanjoy wrote:
> I think a `SmallVector` is more appropriate here.
We can't currently create a small vector of CallSites.  I haven't dug into why not, but it fails to compile.

================
Comment at: lib/Transforms/Scalar/PlaceSafepoints.cpp:666
@@ +665,3 @@
+  }
+  PollsNeeded.clear(); // make sure we don't accidentally use
+  // The dominator tree has been invalidated by the inlining performed in the
----------------
sanjoy wrote:
> I don't think this is the right way to avoid using `PollsNeeded`.  As a later change, we should factor `PlaceSafepoints::runOnFunction` into smaller functions such that `PollsNeeded` is statically not in scope of the functions that should not be using it.
Agreed.  I'll submit as is, but plan to refactor in this direction.

http://reviews.llvm.org/D9727

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list