From: Evan Cheng Date: Fri, 8 May 2009 09:35:53 +0000 (+0000) Subject: Reverse branch condition only when there is a conditional branch. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=4b7f7a6e1f3eacf116472c1b0d0eaddf01fa4495;p=oota-llvm.git 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 --- diff --git a/lib/CodeGen/CodePlacementOpt.cpp b/lib/CodeGen/CodePlacementOpt.cpp index f6a8421c434..4276651d3bc 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;