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
This commit is contained in:
Evan Cheng 2009-05-08 09:35:53 +00:00
parent 0ab2dcee5b
commit 4b7f7a6e1f

View File

@ -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;