aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/LoopSimplify.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-08-18 22:54:06 +0000
committerChris Lattner <sabre@nondot.org>2003-08-18 22:54:06 +0000
commite6f7f61cda02e9aa8f87f84f0c91668e8a6de569 (patch)
tree7a8f1f944d6f38eed80aa7ec8ee1eb4f89bc6508 /lib/Transforms/Utils/LoopSimplify.cpp
parent13fc1eaee5c5473fbc3a0483b95b8b838866aa6f (diff)
Fix grammar, add comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7967 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/LoopSimplify.cpp')
-rw-r--r--lib/Transforms/Utils/LoopSimplify.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp
index 9507941f6c..4947392910 100644
--- a/lib/Transforms/Utils/LoopSimplify.cpp
+++ b/lib/Transforms/Utils/LoopSimplify.cpp
@@ -10,7 +10,7 @@
// Loop exit-block insertion guarantees that all exit blocks from the loop
// (blocks which are outside of the loop that have predecessors inside of the
// loop) are dominated by the loop header. This simplifies transformations such
-// as store-sinking that is built into LICM.
+// as store-sinking that are built into LICM.
//
// Note that the simplifycfg pass will clean up blocks which are split out but
// end up being unnecessary, so usage of this pass does not neccesarily
@@ -91,6 +91,9 @@ bool Preheaders::ProcessLoop(Loop *L) {
Changed = true;
}
+ // Regardless of whether or not we added a preheader to the loop we must
+ // guarantee that the preheader dominates all exit nodes. If there are any
+ // exit nodes not dominated, split them now.
DominatorSet &DS = getAnalysis<DominatorSet>();
BasicBlock *Header = L->getHeader();
for (unsigned i = 0, e = L->getExitBlocks().size(); i != e; ++i)