summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-12-08 23:52:00 +0000
committerDevang Patel <dpatel@apple.com>2011-12-08 23:52:00 +0000
commit202cf2f6fc6fdf851f2e9cc4b8d70e5da5bd2d81 (patch)
treecc997436ea813cb3de8343def2a5b6b46652d830 /llvm/lib/CodeGen
parent12014a04711a9c3efa5aed1c80b9c4288ab209eb (diff)
downloadbcm5719-llvm-202cf2f6fc6fdf851f2e9cc4b8d70e5da5bd2d81.tar.gz
bcm5719-llvm-202cf2f6fc6fdf851f2e9cc4b8d70e5da5bd2d81.zip
Revert r146184. I am seeing performance regression cause by this patch in one test case.
llvm-svn: 146205
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/MachineSink.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/MachineSink.cpp b/llvm/lib/CodeGen/MachineSink.cpp
index 7740a75e427..dff81093634 100644
--- a/llvm/lib/CodeGen/MachineSink.cpp
+++ b/llvm/lib/CodeGen/MachineSink.cpp
@@ -485,16 +485,6 @@ MachineBasicBlock *MachineSinking::FindSuccToSinkTo(MachineInstr *MI,
for (MachineBasicBlock::succ_iterator SI = ParentBlock->succ_begin(),
E = ParentBlock->succ_end(); SI != E; ++SI) {
MachineBasicBlock *SuccBlock = *SI;
- // It is not possible to sink an instruction into its own block. This can
- // happen with loops.
- if (ParentBlock == SuccBlock)
- continue;
-
- // It's not safe to sink instructions to EH landing pad. Control flow into
- // landing pad is implicitly defined.
- if (SuccBlock->isLandingPad())
- continue;
-
bool LocalUse = false;
if (AllUsesDominatedByBlock(Reg, SuccBlock, ParentBlock,
BreakPHIEdge, LocalUse)) {
@@ -511,6 +501,17 @@ MachineBasicBlock *MachineSinking::FindSuccToSinkTo(MachineInstr *MI,
return NULL;
}
}
+
+ // It is not possible to sink an instruction into its own block. This can
+ // happen with loops.
+ if (ParentBlock == SuccToSinkTo)
+ return NULL;
+
+ // It's not safe to sink instructions to EH landing pad. Control flow into
+ // landing pad is implicitly defined.
+ if (SuccToSinkTo && SuccToSinkTo->isLandingPad())
+ return NULL;
+
return SuccToSinkTo;
}
OpenPOWER on IntegriCloud