summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/SystemZ/SystemZMCInstLower.cpp
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-07-12 09:08:12 +0000
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-07-12 09:08:12 +0000
commitb820405b59b12fd9eff51957118bdddd6519b8a4 (patch)
tree35bed6f94339cdef6b87d1765e707e47a2ca9c9a /llvm/lib/Target/SystemZ/SystemZMCInstLower.cpp
parent3f0edc29036dfbd780c42fbe074048b782dd47c9 (diff)
downloadbcm5719-llvm-b820405b59b12fd9eff51957118bdddd6519b8a4.tar.gz
bcm5719-llvm-b820405b59b12fd9eff51957118bdddd6519b8a4.zip
[SystemZ] Fix parsing of inline asm registers
GPR and FPR constraints like "{r2}" and "{f2}" weren't handled correctly because the name-to-regno mapping depends on the value type and (because of that) the internal names in RegStrings are not the same as the AsmName. CC constraints like "{cc}" didn't work either because there was no associated register class. llvm-svn: 186148
Diffstat (limited to 'llvm/lib/Target/SystemZ/SystemZMCInstLower.cpp')
-rw-r--r--llvm/lib/Target/SystemZ/SystemZMCInstLower.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZMCInstLower.cpp b/llvm/lib/Target/SystemZ/SystemZMCInstLower.cpp
index fd3f867015c..432a0d30b62 100644
--- a/llvm/lib/Target/SystemZ/SystemZMCInstLower.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZMCInstLower.cpp
@@ -57,9 +57,6 @@ MCOperand SystemZMCInstLower::lowerOperand(const MachineOperand &MO) const {
llvm_unreachable("unknown operand type");
case MachineOperand::MO_Register:
- // Ignore all implicit register operands.
- if (MO.isImplicit())
- return MCOperand();
return MCOperand::CreateReg(MO.getReg());
case MachineOperand::MO_Immediate:
@@ -104,8 +101,8 @@ void SystemZMCInstLower::lower(const MachineInstr *MI, MCInst &OutMI) const {
OutMI.setOpcode(Opcode);
for (unsigned I = 0, E = MI->getNumOperands(); I != E; ++I) {
const MachineOperand &MO = MI->getOperand(I);
- MCOperand MCOp = lowerOperand(MO);
- if (MCOp.isValid())
- OutMI.addOperand(MCOp);
+ // Ignore all implicit register operands.
+ if (!MO.isReg() || !MO.isImplicit())
+ OutMI.addOperand(lowerOperand(MO));
}
}
OpenPOWER on IntegriCloud