diff options
author | Bob Wilson <bob.wilson@apple.com> | 2009-05-12 03:48:10 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2009-05-12 03:48:10 +0000 |
commit | 74b0ccc577062a25b8b3ab99b13cd1efa6e3a75a (patch) | |
tree | 78855a096980b66537b0627ef124f1941aae0033 /lib/CodeGen/CodePlacementOpt.cpp | |
parent | 81db61a2e6d3c95a2738c3559a108e05e9d7a05a (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71536 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodePlacementOpt.cpp')
-rw-r--r-- | lib/CodeGen/CodePlacementOpt.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/CodePlacementOpt.cpp b/lib/CodeGen/CodePlacementOpt.cpp index 77d23eed6c..2e1d12d234 100644 --- a/lib/CodeGen/CodePlacementOpt.cpp +++ b/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; } } |