[PATCH] D43176: [LoopInterchange] Incrementally update the dominator tree.

Jakub Kuderski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 13 09:44:10 PST 2018


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

Looks good to me now.

One last question: is DomTreeWrapperPass always available when LoopInterchange is run? I'm thinking about requireAnalysis vs. getAnalysisIfAvailable.



================
Comment at: lib/Transforms/Scalar/LoopInterchange.cpp:1285
+      DTUpdates.push_back(
+          {DominatorTree::UpdateKind::Insert, BI->getParent(), NewBB});
+      DTUpdates.push_back(
----------------
fhahn wrote:
> kuhar wrote:
> > Can you have multiple successors that are the same BB? If so, you would have to exclude the redundant ones here.
> That should never happen I think. I've added a break and also an assertion. Please let me know if this is exactly the case you meant
Looks fine, thanks!


================
Comment at: lib/Transforms/Scalar/LoopInterchange.cpp:1276
+         "BI must jump to OldBB at most once.");
+  for (unsigned i = 0; i < BI->getNumSuccessors(); ++i) {
+    if (BI->getSuccessor(i) == OldBB) {
----------------
` for (unsigned i = 0, e = BI->getNumSuccessors(); i != e; ++i) {`


https://reviews.llvm.org/D43176





More information about the llvm-commits mailing list