OSDN Git Service

[SystemZ] Fix regression when handling conditional calls
authorZhan Jun Liau <zhanjunl@ca.ibm.com>
Thu, 7 Jul 2016 15:34:46 +0000 (15:34 +0000)
committerZhan Jun Liau <zhanjunl@ca.ibm.com>
Thu, 7 Jul 2016 15:34:46 +0000 (15:34 +0000)
Summary:
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.

Reviewers: koriakin

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D22054

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274761 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SystemZ/SystemZInstrInfo.cpp

index 2421780..d2e2e27 100644 (file)
@@ -610,14 +610,14 @@ bool SystemZInstrInfo::PredicateInstruction(
     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)
+      .addOperand(FirstOp)
       .addRegMask(RegMask)
       .addReg(SystemZ::CC, RegState::Implicit);
     return true;