summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineVerifier.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2009-09-21 07:19:08 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2009-09-21 07:19:08 +0000
commitf6eb7d83d12e47c968885aadcd9c94f84a90777d (patch)
treeeb3fa9d32817043660379cf12e7ada1825513d12 /llvm/lib/CodeGen/MachineVerifier.cpp
parent4d8af2f1ae6846b9af6176e4f4dc5402f2c716f3 (diff)
downloadbcm5719-llvm-f6eb7d83d12e47c968885aadcd9c94f84a90777d.tar.gz
bcm5719-llvm-f6eb7d83d12e47c968885aadcd9c94f84a90777d.zip
Verify that phi instructions refer to MBBs in the CFG.
The machine code verifier no longer tolerates phi instructions with noop operands. All MBBs on a phi instruction must be in the CFG. llvm-svn: 82448
Diffstat (limited to 'llvm/lib/CodeGen/MachineVerifier.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineVerifier.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp
index f43a3703458..b4d6588bf43 100644
--- a/llvm/lib/CodeGen/MachineVerifier.cpp
+++ b/llvm/lib/CodeGen/MachineVerifier.cpp
@@ -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;
}
OpenPOWER on IntegriCloud