diff options
author | Chris Lattner <sabre@nondot.org> | 2008-03-09 20:49:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-03-09 20:49:33 +0000 |
commit | 6eae8c66a530f7c5c7f389960ae6f79c079fd0fc (patch) | |
tree | 7a76d3abc68832a2487b7d9322e79b195850fc5e /lib | |
parent | 64de814ce694ca23e7a10424c0633bd656434bcd (diff) | |
download | external_llvm-6eae8c66a530f7c5c7f389960ae6f79c079fd0fc.zip external_llvm-6eae8c66a530f7c5c7f389960ae6f79c079fd0fc.tar.gz external_llvm-6eae8c66a530f7c5c7f389960ae6f79c079fd0fc.tar.bz2 |
Darwin PPC64 indirect call target goes in X12, not R12. This fixes these
two regression tests:
test/CodeGen/PowerPC/2007-10-21-LocalRegAllocAssert.ll
test/CodeGen/PowerPC/2007-10-21-LocalRegAllocAssert2.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48120 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/PowerPC/PPCISelLowering.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp index 7647d4e..6b6ec55 100644 --- a/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/lib/Target/PowerPC/PPCISelLowering.cpp @@ -1973,9 +1973,10 @@ SDOperand PPCTargetLowering::LowerCALL(SDOperand Op, SelectionDAG &DAG, Chain = DAG.getNode(PPCISD::MTCTR, NodeTys, MTCTROps, 2+(InFlag.Val!=0)); InFlag = Chain.getValue(1); - // Copy the callee address into R12 on darwin. + // Copy the callee address into R12/X12 on darwin. if (isMachoABI) { - Chain = DAG.getCopyToReg(Chain, PPC::R12, Callee, InFlag); + unsigned Reg = Callee.getValueType() == MVT::i32 ? PPC::R12 : PPC::X12; + Chain = DAG.getCopyToReg(Chain, Reg, Callee, InFlag); InFlag = Chain.getValue(1); } |