diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-06-08 19:17:12 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-06-08 19:17:12 +0000 |
commit | 2acdbcccd8043d3a91430fdfcef6ba0760c1cc05 (patch) | |
tree | 1c66e2d78124c021b57173ff210129ec75f75e1b /lib/CodeGen/IfConversion.cpp | |
parent | edf4896a1461fe43081aab3ab7dda16f9dac8590 (diff) |
Correct transfer predicate information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37524 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/IfConversion.cpp')
-rw-r--r-- | lib/CodeGen/IfConversion.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/CodeGen/IfConversion.cpp b/lib/CodeGen/IfConversion.cpp index 5405fc8ae9..05be5d59c7 100644 --- a/lib/CodeGen/IfConversion.cpp +++ b/lib/CodeGen/IfConversion.cpp @@ -610,7 +610,6 @@ bool IfConverter::IfConvertSimple(BBInfo &BBI) { // available if cmp executes. IterIfcvt = false; } - std::copy(Cond.begin(), Cond.end(), std::back_inserter(BBI.Predicate)); // Update block info. BB can be iteratively if-converted. if (IterIfcvt) @@ -671,8 +670,6 @@ bool IfConverter::IfConvertTriangle(BBInfo &BBI) { // Remove entry to false edge if false block is merged in as well. if (FalseBBDead) BBI.BB->removeSuccessor(FalseBBI.BB); - std::copy(BBI.BrCond.begin(), BBI.BrCond.end(), - std::back_inserter(BBI.Predicate)); // Update block info. BB can be iteratively if-converted. if (IterIfcvt) @@ -785,11 +782,6 @@ bool IfConverter::IfConvertDiamond(BBInfo &BBI) { // Merge the combined block into the entry of the diamond. MergeBlocks(BBI, *BBI1); - std::copy(Cond1->begin(), Cond1->end(), - std::back_inserter(BBI.Predicate)); - if (!NeedBr1) - std::copy(Cond2->begin(), Cond2->end(), - std::back_inserter(BBI.Predicate)); // 'True' and 'false' aren't combined, see if we need to add a unconditional // branch to the 'false' block. @@ -837,6 +829,8 @@ void IfConverter::PredicateBlock(BBInfo &BBI, } BBI.NonPredSize = 0; + std::copy(Cond.begin(), Cond.end(), std::back_inserter(BBI.Predicate)); + NumIfConvBBs++; } @@ -883,4 +877,8 @@ void IfConverter::MergeBlocks(BBInfo &ToBBI, BBInfo &FromBBI) { ToBBI.ModifyPredicate |= FromBBI.ModifyPredicate; ToBBI.hasFallThrough = FromBBI.hasFallThrough; + + std::copy(FromBBI.Predicate.begin(), FromBBI.Predicate.end(), + std::back_inserter(ToBBI.Predicate)); + FromBBI.Predicate.clear(); } |