Update the machine-CFG edges whenever we see a branch.
authorBrian Gaeke <gaeke@uiuc.edu>
Wed, 28 Apr 2004 04:19:37 +0000 (04:19 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Wed, 28 Apr 2004 04:19:37 +0000 (04:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13211 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/InstSelectSimple.cpp
lib/Target/X86/X86ISelSimple.cpp

index 0715e20c325c41eeace51d00cfeca8fc128ddf71..8617f0662cc40e08c80deccdc210ea9a202e2a04 100644 (file)
@@ -1295,6 +1295,11 @@ static inline BasicBlock *getBlockAfter(BasicBlock *BB) {
 /// just make a fall-through (but we don't currently).
 ///
 void ISel::visitBranchInst(BranchInst &BI) {
+  // Update machine-CFG edges
+  BB->addSuccessor (MBBMap[BI.getSuccessor(0)]);
+  if (BI.isConditional())
+    BB->addSuccessor (MBBMap[BI.getSuccessor(1)]);
+
   BasicBlock *NextBB = getBlockAfter(BI.getParent());  // BB after current one
 
   if (!BI.isConditional()) {  // Unconditional branch?
index 0715e20c325c41eeace51d00cfeca8fc128ddf71..8617f0662cc40e08c80deccdc210ea9a202e2a04 100644 (file)
@@ -1295,6 +1295,11 @@ static inline BasicBlock *getBlockAfter(BasicBlock *BB) {
 /// just make a fall-through (but we don't currently).
 ///
 void ISel::visitBranchInst(BranchInst &BI) {
+  // Update machine-CFG edges
+  BB->addSuccessor (MBBMap[BI.getSuccessor(0)]);
+  if (BI.isConditional())
+    BB->addSuccessor (MBBMap[BI.getSuccessor(1)]);
+
   BasicBlock *NextBB = getBlockAfter(BI.getParent());  // BB after current one
 
   if (!BI.isConditional()) {  // Unconditional branch?