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
This commit is contained in:
Chris Lattner 2008-03-09 20:49:33 +00:00
parent 78e817d7fc
commit aed9406bb7
1 changed files with 3 additions and 2 deletions

View File

@ -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);
}