Verify that phi instructions refer to MBBs in the CFG.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Mon, 21 Sep 2009 07:19:08 +0000 (07:19 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Mon, 21 Sep 2009 07:19:08 +0000 (07:19 +0000)
The machine code verifier no longer tolerates phi instructions with noop
operands. All MBBs on a phi instruction must be in the CFG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82448 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineVerifier.cpp

index f43a37034587668b87bd0fd503d34f32f50f908c..b4d6588bf43a9c09a4c86c0ea21832e4f107189c 100644 (file)
@@ -592,13 +592,14 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum)
     }
     break;
   }
-    // Can PHI instrs refer to MBBs not in the CFG? X86 and ARM do.
-    // case MachineOperand::MO_MachineBasicBlock:
-    //   if (MI->getOpcode() == TargetInstrInfo::PHI) {
-    //     if (!MO->getMBB()->isSuccessor(MI->getParent()))
-    //       report("PHI operand is not in the CFG", MO, MONum);
-    //   }
-    //   break;
+
+  case MachineOperand::MO_MachineBasicBlock:
+    if (MI->getOpcode() == TargetInstrInfo::PHI) {
+      if (!MO->getMBB()->isSuccessor(MI->getParent()))
+        report("PHI operand is not in the CFG", MO, MONum);
+    }
+    break;
+
   default:
     break;
   }