summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/CodePlacementOpt.cpp
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2009-05-12 03:48:10 +0000
committerBob Wilson <bob.wilson@apple.com>2009-05-12 03:48:10 +0000
commit9e3d48f10df67f2167a24098e8ea5b5e71ff53d4 (patch)
tree99b6a42c455e38a6459aa5500c4895dcf05da524 /llvm/lib/CodeGen/CodePlacementOpt.cpp
parentd76d71a29136dcfd0a80a6b6a52177071408e3b5 (diff)
downloadbcm5719-llvm-9e3d48f10df67f2167a24098e8ea5b5e71ff53d4.tar.gz
bcm5719-llvm-9e3d48f10df67f2167a24098e8ea5b5e71ff53d4.zip
Fix pr4195: When iterating through predecessor blocks, break out of the loop
after finding the (unique) layout predecessor. Sometimes a block may be listed more than once, and processing it more than once in this loop can lead to inconsistent values for FtTBB/FtFBB, since the AnalyzeBranch method does not clear these values. There's no point in continuing the loop regardless. The testcase for this is reduced from the 2003-05-02-DependentPHI SingleSource test. llvm-svn: 71536
Diffstat (limited to 'llvm/lib/CodeGen/CodePlacementOpt.cpp')
-rw-r--r--llvm/lib/CodeGen/CodePlacementOpt.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/CodePlacementOpt.cpp b/llvm/lib/CodeGen/CodePlacementOpt.cpp
index 77d23eed6c9..2e1d12d2346 100644
--- a/llvm/lib/CodeGen/CodePlacementOpt.cpp
+++ b/llvm/lib/CodeGen/CodePlacementOpt.cpp
@@ -155,10 +155,10 @@ bool CodePlacementOpt::OptimizeIntraLoopEdges() {
// A fallthrough.
FtMBB = PredMBB;
MachineLoop *PL = MLI->getLoopFor(PredMBB);
- if (PL && (PL == L || PL->getLoopDepth() >= L->getLoopDepth())) {
+ if (PL && (PL == L || PL->getLoopDepth() >= L->getLoopDepth()))
OkToMove = false;
- break;
- }
+
+ break;
}
}
OpenPOWER on IntegriCloud