diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-06-14 23:13:19 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-06-14 23:13:19 +0000 |
commit | 9fc56c079d3ec0e8676f7e51231c3289c18feb5c (patch) | |
tree | 72b4012d67eba97cd2b4aa9d4a20bdbe2fb2b411 /llvm/lib/CodeGen/IfConversion.cpp | |
parent | 5c4413120f8e3b7645d4cdf98124f28a2019cbb1 (diff) | |
download | bcm5719-llvm-9fc56c079d3ec0e8676f7e51231c3289c18feb5c.tar.gz bcm5719-llvm-9fc56c079d3ec0e8676f7e51231c3289c18feb5c.zip |
If BB is predicated, invalidate its predecessor(s) which would if-convert it. It needs to be re-analyzed.
llvm-svn: 37580
Diffstat (limited to 'llvm/lib/CodeGen/IfConversion.cpp')
-rw-r--r-- | llvm/lib/CodeGen/IfConversion.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/IfConversion.cpp b/llvm/lib/CodeGen/IfConversion.cpp index 87340d37005..b1aa31a28e3 100644 --- a/llvm/lib/CodeGen/IfConversion.cpp +++ b/llvm/lib/CodeGen/IfConversion.cpp @@ -656,15 +656,19 @@ static bool canFallThroughTo(MachineBasicBlock *BB, MachineBasicBlock *ToBB) { } /// ReTryPreds - Invalidate predecessor BB info so it would be re-analyzed -/// to determine if it can be if-converted. +/// to determine if it can be if-converted. If predecessor is already +/// enqueud, dequeue it! void IfConverter::ReTryPreds(MachineBasicBlock *BB) { for (MachineBasicBlock::pred_iterator PI = BB->pred_begin(), E = BB->pred_end(); PI != E; ++PI) { BBInfo &PBBI = BBAnalysis[(*PI)->getNumber()]; - if (!PBBI.IsDone && PBBI.Kind == ICNotClassfied) { + if (PBBI.IsDone) + continue; + if (PBBI.Kind == ICNotClassfied) { assert(!PBBI.IsEnqueued && "Unexpected"); PBBI.IsAnalyzed = false; - } + } else if (PBBI.IsEnqueued && PBBI.BB != BB) + PBBI.IsEnqueued = false; } } |