aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-05-08 09:35:53 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-05-08 09:35:53 +0000
commit6e7ac420dfc4c65af9f5deb8f7280e8164144bfe (patch)
tree7a9d2d49db37bd72908d413df74bc474fe210c66
parentc6368b6c0d6cb635be3a12698af0e97609f30fe5 (diff)
downloadexternal_llvm-6e7ac420dfc4c65af9f5deb8f7280e8164144bfe.zip
external_llvm-6e7ac420dfc4c65af9f5deb8f7280e8164144bfe.tar.gz
external_llvm-6e7ac420dfc4c65af9f5deb8f7280e8164144bfe.tar.bz2
Reverse branch condition only when there is a conditional branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71214 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CodePlacementOpt.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CodePlacementOpt.cpp b/lib/CodeGen/CodePlacementOpt.cpp
index f6a8421..4276651 100644
--- a/lib/CodeGen/CodePlacementOpt.cpp
+++ b/lib/CodeGen/CodePlacementOpt.cpp
@@ -211,7 +211,8 @@ bool CodePlacementOpt::OptimizeIntraLoopEdges() {
} else if (!FBB && SSMBB == TBB && Cond.empty()) {
TBB = 0;
--Cost;
- } else if (!TII->ReverseBranchCondition(Cond)) {
+ } else if (!Cond.empty() && !TII->ReverseBranchCondition(Cond)) {
+ assert(SSMBB == TBB);
TBB = FBB;
FBB = 0;
--Cost;