diff options
author | Nate Begeman <natebegeman@mac.com> | 2005-11-16 00:48:01 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2005-11-16 00:48:01 +0000 |
commit | 422b0cee7a32636303398d8788f98a59bf15381c (patch) | |
tree | ded4c66bb7c76b6ac954d1a5cbea8fb7d316b7b1 /lib/Target/PowerPC/PPCISelPattern.cpp | |
parent | 427189ad5108f34126316cd475ff236ab0fb41f8 (diff) |
Patch to clean up function call pseudos and support the BLA instruction,
which branches to an absolute address. This is required to support objc
direct dispatch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24370 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCISelPattern.cpp')
-rw-r--r-- | lib/Target/PowerPC/PPCISelPattern.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/Target/PowerPC/PPCISelPattern.cpp b/lib/Target/PowerPC/PPCISelPattern.cpp index 1a9d09c64b..628295c095 100644 --- a/lib/Target/PowerPC/PPCISelPattern.cpp +++ b/lib/Target/PowerPC/PPCISelPattern.cpp @@ -842,18 +842,15 @@ unsigned ISel::SelectExpr(SDOperand N, bool Recording) { // Emit the correct call instruction based on the type of symbol called. if (GlobalAddressSDNode *GASD = dyn_cast<GlobalAddressSDNode>(N.getOperand(1))) { - CallMI = BuildMI(PPC::CALLpcrel, 1).addGlobalAddress(GASD->getGlobal(), - true); + CallMI = BuildMI(PPC::BL, 1).addGlobalAddress(GASD->getGlobal(), true); } else if (ExternalSymbolSDNode *ESSDN = dyn_cast<ExternalSymbolSDNode>(N.getOperand(1))) { - CallMI = BuildMI(PPC::CALLpcrel, 1).addExternalSymbol(ESSDN->getSymbol(), - true); + CallMI = BuildMI(PPC::BL, 1).addExternalSymbol(ESSDN->getSymbol(), true); } else { Tmp1 = SelectExpr(N.getOperand(1)); BuildMI(BB, PPC::MTCTR, 1).addReg(Tmp1); BuildMI(BB, PPC::OR4, 2, PPC::R12).addReg(Tmp1).addReg(Tmp1); - CallMI = BuildMI(PPC::CALLindirect, 3).addImm(20).addImm(0) - .addReg(PPC::R12); + CallMI = BuildMI(PPC::BCTRL, 1).addReg(PPC::R12); } // Load the register args to virtual regs |