aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-10-10 23:18:02 +0000
committerDevang Patel <dpatel@apple.com>2011-10-10 23:18:02 +0000
commitdb7334dbc55fb4b86fa3db19bff08ec02ba474d5 (patch)
tree2b047d5df5885cad8ba8a9ee6c3f9bd6e0ae6ce5 /lib
parentf6c35c59f515505fa2e9b74b3d0f4ab06f8266d8 (diff)
Revert r141569 and r141576.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141594 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/MachineLICM.cpp29
1 files changed, 0 insertions, 29 deletions
diff --git a/lib/CodeGen/MachineLICM.cpp b/lib/CodeGen/MachineLICM.cpp
index bd25b2c6b6..d310f252e2 100644
--- a/lib/CodeGen/MachineLICM.cpp
+++ b/lib/CodeGen/MachineLICM.cpp
@@ -168,11 +168,6 @@ namespace {
///
bool IsLoopInvariantInst(MachineInstr &I);
- /// IsGuaranteedToExecute - check to make sure that the MI dominates
- /// all of the exit blocks. If it doesn't, then there is a path out of the
- /// loop which does not execute this instruction, so we can't hoist it.
- bool IsGuaranteedToExecute(MachineInstr *MI);
-
/// HasAnyPHIUse - Return true if the specified register is used by any
/// phi node.
bool HasAnyPHIUse(unsigned Reg) const;
@@ -1134,28 +1129,6 @@ bool MachineLICM::EliminateCSE(MachineInstr *MI,
return false;
}
-/// IsGuaranteedToExecute - check to make sure that the instruction dominates
-/// all of the exit blocks. If it doesn't, then there is a path out of the loop
-/// which does not execute this instruction, so we can't hoist it.
-bool MachineLICM::IsGuaranteedToExecute(MachineInstr *MI) {
- // If the instruction is in the header block for the loop (which is very
- // common), it is always guaranteed to dominate the exit blocks. Since this
- // is a common case, and can save some work, check it now.
- if (MI->getParent() == CurLoop->getHeader())
- return true;
-
- // Get the exit blocks for the current loop.
- 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 = ExitingBlocks.size(); i != e; ++i)
- if (!DT->dominates(MI->getParent(), ExitingBlocks[i]))
- return false;
-
- return true;
-}
-
/// Hoist - When an instruction is found to use only loop invariant operands
/// that are safe to hoist, this instruction is called to do the dirty work.
///
@@ -1166,8 +1139,6 @@ bool MachineLICM::Hoist(MachineInstr *MI, MachineBasicBlock *Preheader) {
MI = ExtractHoistableLoad(MI);
if (!MI) return false;
}
- if (!IsGuaranteedToExecute(MI))
- return false;
// Now move the instructions to the predecessor, inserting it before any
// terminator instructions.