diff options
author | Alex Lorenz <arphaman@gmail.com> | 2015-08-10 21:47:36 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2015-08-10 21:47:36 +0000 |
commit | e5101e2016311c315119c8ad50a970b6b0c87cc7 (patch) | |
tree | dbf27dde0675367ef8271061e49255d9faaaf8b6 /llvm/lib/CodeGen/MachineVerifier.cpp | |
parent | c25c7944f07f198cc50f47cdf6b82ff13b56b396 (diff) | |
download | bcm5719-llvm-e5101e2016311c315119c8ad50a970b6b0c87cc7.tar.gz bcm5719-llvm-e5101e2016311c315119c8ad50a970b6b0c87cc7.zip |
MachineVerifier: Handle the optional def operand in a PATCHPOINT instruction.
The PATCHPOINT instructions have a single optional defined register operand,
but the machine verifier can't verify the optional defined register operands.
This commit makes sure that the machine verifier won't report an error when a
PATCHPOINT instruction doesn't have its optional defined register operand.
This change will allow us to enable the machine verifier for the code
generation tests for the patchpoint intrinsics.
Reviewers: Juergen Ributzka
llvm-svn: 244513
Diffstat (limited to 'llvm/lib/CodeGen/MachineVerifier.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineVerifier.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index a5e5bc992ef..dc1677233f5 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -822,9 +822,12 @@ void MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) { const MachineInstr *MI = MO->getParent(); const MCInstrDesc &MCID = MI->getDesc(); + unsigned NumDefs = MCID.getNumDefs(); + if (MCID.getOpcode() == TargetOpcode::PATCHPOINT) + NumDefs = (MONum == 0 && MO->isReg()) ? NumDefs : 0; // The first MCID.NumDefs operands must be explicit register defines - if (MONum < MCID.getNumDefs()) { + if (MONum < NumDefs) { const MCOperandInfo &MCOI = MCID.OpInfo[MONum]; if (!MO->isReg()) report("Explicit definition must be a register", MO, MONum); |