Follow up to r114630. Do not optimize away unconditional branch following a condition...
authorEvan Cheng <evan.cheng@apple.com>
Thu, 23 Sep 2010 07:18:35 +0000 (07:18 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 23 Sep 2010 07:18:35 +0000 (07:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114634 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

index f3bc50d490eedec7a33938cae67bad03d97cb1d5..10095c5d3e8a6c4ff4f30fa6961586105f5d8675 100644 (file)
@@ -1617,9 +1617,8 @@ void SelectionDAGBuilder::visitBitTestHeader(BitTestBlock &B,
                                 MVT::Other, CopyTo, RangeCmp,
                                 DAG.getBasicBlock(B.Default));
 
-  if (MBB != NextBlock)
-    BrRange = DAG.getNode(ISD::BR, getCurDebugLoc(), MVT::Other, CopyTo,
-                          DAG.getBasicBlock(MBB));
+  BrRange = DAG.getNode(ISD::BR, getCurDebugLoc(), MVT::Other, CopyTo,
+                        DAG.getBasicBlock(MBB));
 
   DAG.setRoot(BrRange);
 }
@@ -1672,9 +1671,8 @@ void SelectionDAGBuilder::visitBitTestCase(MachineBasicBlock* NextMBB,
   if (++BBI != FuncInfo.MF->end())
     NextBlock = BBI;
 
-  if (NextMBB != NextBlock)
-    BrAnd = DAG.getNode(ISD::BR, getCurDebugLoc(), MVT::Other, BrAnd,
-                        DAG.getBasicBlock(NextMBB));
+  BrAnd = DAG.getNode(ISD::BR, getCurDebugLoc(), MVT::Other, BrAnd,
+                      DAG.getBasicBlock(NextMBB));
 
   DAG.setRoot(BrAnd);
 }