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 f6a8421..4276651 100644
--- a/lib/CodeGen/CodePlacementOpt.cpp
+++ b/lib/CodeGen/CodePlacementOpt.cpp
@@ -211,7 +211,8 @@
         } 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;