[llvm-branch-commits] [llvm-branch] r98084 - in /llvm/branches/Apple/Hermes: lib/Target/PowerPC/PPCISelLowering.cpp test/CodeGen/PowerPC/2010-03-09-indirect-call.ll

Dale Johannesen dalej at apple.com
Tue Mar 9 13:32:34 PST 2010


Author: johannes
Date: Tue Mar  9 15:32:34 2010
New Revision: 98084

URL: http://llvm.org/viewvc/llvm-project?rev=98084&view=rev
Log:
--- Merging r98077 into '.':
A    test/CodeGen/PowerPC/2010-03-09-indirect-call.ll
U    lib/Target/PowerPC/PPCISelLowering.cpp


Added:
    llvm/branches/Apple/Hermes/test/CodeGen/PowerPC/2010-03-09-indirect-call.ll
      - copied unchanged from r98077, llvm/trunk/test/CodeGen/PowerPC/2010-03-09-indirect-call.ll
Modified:
    llvm/branches/Apple/Hermes/lib/Target/PowerPC/PPCISelLowering.cpp

Modified: llvm/branches/Apple/Hermes/lib/Target/PowerPC/PPCISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Hermes/lib/Target/PowerPC/PPCISelLowering.cpp?rev=98084&r1=98083&r2=98084&view=diff
==============================================================================
--- llvm/branches/Apple/Hermes/lib/Target/PowerPC/PPCISelLowering.cpp (original)
+++ llvm/branches/Apple/Hermes/lib/Target/PowerPC/PPCISelLowering.cpp Tue Mar  9 15:32:34 2010
@@ -3228,6 +3228,16 @@
     Chain = DAG.getStore(Val.getValue(1), dl, Val, AddPtr, NULL, 0);
   }
 
+  // On Darwin, R12 must contain the address of an indirect callee.  This does
+  // not mean the MTCTR instruction must use R12; it's easier to model this as
+  // an extra parameter, so do that.
+  if (!isTailCall && 
+      !dyn_cast<GlobalAddressSDNode>(Callee) &&
+      !dyn_cast<ExternalSymbolSDNode>(Callee) &&
+      !isBLACompatibleAddress(Callee, DAG))
+    RegsToPass.push_back(std::make_pair((unsigned)(isPPC64 ? PPC::X12 :
+                                                   PPC::R12), Callee));
+
   // Build a sequence of copy-to-reg nodes chained together with token chain
   // and flag operands which copy the outgoing args into the appropriate regs.
   SDValue InFlag;





More information about the llvm-branch-commits mailing list