summaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-10-10 20:32:03 +0000
committerDevang Patel <dpatel@apple.com>2011-10-10 20:32:03 +0000
commit6b50bc9d88538c155503582b095fdba518070257 (patch)
tree508160c6a12a4a462d7060ee84fcfae163bc8b81 /lib/CodeGen
parent819a2abc72e9e27d105ebc085aac09c6029db4a6 (diff)
downloadllvm-6b50bc9d88538c155503582b095fdba518070257.tar.gz
llvm-6b50bc9d88538c155503582b095fdba518070257.tar.bz2
llvm-6b50bc9d88538c155503582b095fdba518070257.tar.xz
If loop header is also loop exiting block then it may not be safe to hoist instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141576 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/MachineLICM.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/CodeGen/MachineLICM.cpp b/lib/CodeGen/MachineLICM.cpp
index f8cbe41b94..bd25b2c6b6 100644
--- a/lib/CodeGen/MachineLICM.cpp
+++ b/lib/CodeGen/MachineLICM.cpp
@@ -1145,13 +1145,12 @@ bool MachineLICM::IsGuaranteedToExecute(MachineInstr *MI) {
return true;
// Get the exit blocks for the current loop.
- SmallVector<MachineBasicBlock*, 8> ExitBlocks;
- CurLoop->getExitingBlocks(ExitBlocks);
+ SmallVector<MachineBasicBlock*, 8> ExitingBlocks;
+ CurLoop->getExitingBlocks(ExitingBlocks);
// Verify that the block dominates each of the exit blocks of the loop.
- for (unsigned i = 0, e = ExitBlocks.size(); i != e; ++i)
- if (ExitBlocks[i] != CurLoop->getHeader() &&
- !DT->dominates(MI->getParent(), ExitBlocks[i]))
+ for (unsigned i = 0, e = ExitingBlocks.size(); i != e; ++i)
+ if (!DT->dominates(MI->getParent(), ExitingBlocks[i]))
return false;
return true;