diff options
author | Devang Patel <dpatel@apple.com> | 2011-10-10 20:32:03 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2011-10-10 20:32:03 +0000 |
commit | 2689f958751e34ef1877b704d141745124375750 (patch) | |
tree | 90519ce6bf0e23b164f2861aca17ad2bed8b1fe5 /llvm/lib/CodeGen/MachineLICM.cpp | |
parent | a1ac0dab2d7b168fc233fc71d05679da05dd62cc (diff) | |
download | bcm5719-llvm-2689f958751e34ef1877b704d141745124375750.tar.gz bcm5719-llvm-2689f958751e34ef1877b704d141745124375750.zip |
If loop header is also loop exiting block then it may not be safe to hoist instructions.
llvm-svn: 141576
Diffstat (limited to 'llvm/lib/CodeGen/MachineLICM.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineLICM.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/MachineLICM.cpp b/llvm/lib/CodeGen/MachineLICM.cpp index f8cbe41b944..bd25b2c6b6a 100644 --- a/llvm/lib/CodeGen/MachineLICM.cpp +++ b/llvm/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; |