[llvm-commits] [llvm] r48120 - /llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
Chris Lattner
sabre at nondot.org
Sun Mar 9 13:49:33 PDT 2008
Author: lattner
Date: Sun Mar 9 15:49:33 2008
New Revision: 48120
URL: http://llvm.org/viewvc/llvm-project?rev=48120&view=rev
Log:
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
Modified:
llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=48120&r1=48119&r2=48120&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Sun Mar 9 15:49:33 2008
@@ -1973,9 +1973,10 @@
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);
}
More information about the llvm-commits
mailing list