From aed9406bb72216c3d40771264eef3df1b0ecfaf2 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 9 Mar 2008 20:49:33 +0000 Subject: [PATCH] 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 llvm-svn: 48120 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp index 7647d4e22334..6b6ec55864d8 100644 --- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/llvm/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); }