summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2009-07-15 23:37:26 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2009-07-15 23:37:26 +0000
commita385d01caef2440d5f176fab949962aeeb1a6519 (patch)
tree75a2e009fa522b907eb07fd930718d4a687932d5 /llvm
parentd97db682a33d42b3d0016bbc8ce0bc1eb2bbf23b (diff)
downloadbcm5719-llvm-a385d01caef2440d5f176fab949962aeeb1a6519.tar.gz
bcm5719-llvm-a385d01caef2440d5f176fab949962aeeb1a6519.zip
Verify that there is no kill flag on tied operands on two-address instructions.
This extra check is not trigged when runnning "make check" on top-of-tree. Change error message to better match llvm_unreachable() grammar. Don't call llvm_unreachable() when writing error messages to a file, but keep going. llvm-svn: 75860
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/CodeGen/MachineVerifier.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp
index e9b90fa0408..77bfcb5e9eb 100644
--- a/llvm/lib/CodeGen/MachineVerifier.cpp
+++ b/llvm/lib/CodeGen/MachineVerifier.cpp
@@ -219,11 +219,10 @@ MachineVerifier::runOnMachineFunction(MachineFunction &MF)
if (OutFileName)
OutFile.close();
-
- if (foundErrors) {
+ else if (foundErrors) {
std::string msg;
raw_string_ostream Msg(msg);
- Msg << "\nStopping with " << foundErrors << " machine code errors.";
+ Msg << "Found " << foundErrors << " machine code errors.";
llvm_report_error(Msg.str());
}
@@ -353,8 +352,12 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum)
if (MO->isUse()) {
if (MO->isKill()) {
addRegWithSubRegs(regsKilled, Reg);
+ // Tied operands on two-address instuctions MUST NOT have a <kill> flag.
+ if (MI->isRegTiedToDefOperand(MONum))
+ report("Illegal kill flag on two-address instruction operand",
+ MO, MONum);
} else {
- // TwoAddress instr modyfying a reg is treated as kill+def.
+ // TwoAddress instr modifying a reg is treated as kill+def.
unsigned defIdx;
if (MI->isRegTiedToDefOperand(MONum, &defIdx) &&
MI->getOperand(defIdx).getReg() == Reg)
OpenPOWER on IntegriCloud