summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-08-17 17:43:50 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-08-17 17:43:50 +0000
commit647c5591720c197df7a9ba11515c745829e7d5a0 (patch)
tree2c7eebda39b4031bfe501f05a774d6332bb3e468 /llvm/lib/CodeGen/MachineBasicBlock.cpp
parent5047ca0c02a3d35797413ac8a5651a6ee9537f15 (diff)
downloadbcm5719-llvm-647c5591720c197df7a9ba11515c745829e7d5a0.tar.gz
bcm5719-llvm-647c5591720c197df7a9ba11515c745829e7d5a0.zip
Move the decision logic whether it's a good idea to split a critical edge to clients. Also fixed an erroneous check. An edge is only a back edge when the from and to blocks are in the same loop.
llvm-svn: 111256
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBasicBlock.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index f506f12050a..d351db59e69 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -439,14 +439,6 @@ MachineBasicBlock::SplitCriticalEdge(MachineBasicBlock *Succ, Pass *P) {
if (TII->AnalyzeBranch(*this, TBB, FBB, Cond))
return NULL;
- // Avoid splitting backedges of loops. It would introduce small out-of-line
- // blocks into the loop which is very bad for code placement.
- if (this == Succ)
- return NULL;
- MachineLoopInfo *MLI = P->getAnalysisIfAvailable<MachineLoopInfo>();
- if (MLI->isLoopHeader(Succ))
- return NULL;
-
MachineBasicBlock *NMBB = MF->CreateMachineBasicBlock();
MF->insert(llvm::next(MachineFunction::iterator(this)), NMBB);
DEBUG(dbgs() << "Splitting critical edge:"
@@ -479,7 +471,7 @@ MachineBasicBlock::SplitCriticalEdge(MachineBasicBlock *Succ, Pass *P) {
P->getAnalysisIfAvailable<MachineDominatorTree>())
MDT->addNewBlock(NMBB, this);
- if (MLI)
+ if (MachineLoopInfo *MLI = P->getAnalysisIfAvailable<MachineLoopInfo>())
if (MachineLoop *TIL = MLI->getLoopFor(this)) {
// If one or the other blocks were not in a loop, the new block is not
// either, and thus LI doesn't need to be updated.
OpenPOWER on IntegriCloud