[PATCH] D28939: Skip new header dominator tree update in loop rotation

Xin Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 19 22:53:35 PST 2017

trentxintong created this revision.
Herald added a subscriber: mzolotukhin.

Skip new header dominator tree update in loop rotation.



Index: lib/Transforms/Scalar/LoopRotation.cpp
--- lib/Transforms/Scalar/LoopRotation.cpp
+++ lib/Transforms/Scalar/LoopRotation.cpp
@@ -445,6 +445,11 @@
           DomTreeNode *Node = HeaderChildren[I];
           BasicBlock *BB = Node->getBlock();
+          // The new header idom has been updated correctly. It by definition
+          // can only be dominated by the preheader.
+          if (BB == NewHeader)
+            continue;
           pred_iterator PI = pred_begin(BB);
           BasicBlock *NearestDom = *PI;
           for (pred_iterator PE = pred_end(BB); PI != PE; ++PI)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28939.85100.patch
Type: text/x-patch
Size: 661 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170120/e1f7504a/attachment.bin>

More information about the llvm-commits mailing list