[PATCH] D22054: [SystemZ] Fix regression when handling conditional calls
Zhan Jun Liau via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 6 10:20:59 PDT 2016
zhanjunl created this revision.
zhanjunl added a reviewer: koriakin.
zhanjunl added a subscriber: llvm-commits.
A regression showed up in node.js when handling conditional calls.
Fix the regression by recognizing external symbols as a possible operand type in CallJG.
http://reviews.llvm.org/D22054
Files:
lib/Target/SystemZ/SystemZInstrInfo.cpp
Index: lib/Target/SystemZ/SystemZInstrInfo.cpp
===================================================================
--- lib/Target/SystemZ/SystemZInstrInfo.cpp
+++ lib/Target/SystemZ/SystemZInstrInfo.cpp
@@ -618,16 +618,25 @@
return true;
}
if (Opcode == SystemZ::CallJG) {
- const GlobalValue *Global = MI.getOperand(0).getGlobal();
+ MachineOperand FirstOp = MI.getOperand(0);
const uint32_t *RegMask = MI.getOperand(1).getRegMask();
MI.RemoveOperand(1);
MI.RemoveOperand(0);
MI.setDesc(get(SystemZ::CallBRCL));
- MachineInstrBuilder(*MI.getParent()->getParent(), MI)
- .addImm(CCValid).addImm(CCMask)
- .addGlobalAddress(Global)
- .addRegMask(RegMask)
- .addReg(SystemZ::CC, RegState::Implicit);
+ MachineInstrBuilder MIB = MachineInstrBuilder(*MI.getParent()->getParent(),
+ MI);
+ MIB.addImm(CCValid);
+ MIB.addImm(CCMask);
+
+ if (FirstOp.isGlobal())
+ MIB.addGlobalAddress(FirstOp.getGlobal());
+ else if (FirstOp.isSymbol())
+ MIB.addExternalSymbol(FirstOp.getSymbolName());
+ else
+ llvm_unreachable("Unrecognized operand type for CallJG");
+
+ MIB.addRegMask(RegMask);
+ MIB.addReg(SystemZ::CC, RegState::Implicit);
return true;
}
if (Opcode == SystemZ::CallBR) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22054.62900.patch
Type: text/x-patch
Size: 1332 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160706/ad39bded/attachment.bin>
More information about the llvm-commits
mailing list