[llvm-commits] [llvm] r43978 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/tailcallbyval.ll
Arnold Schwaighofer
arnold.schwaighofer at gmail.com
Sat Nov 10 02:48:02 PST 2007
Author: arnolds
Date: Sat Nov 10 04:48:01 2007
New Revision: 43978
URL: http://llvm.org/viewvc/llvm-project?rev=43978&view=rev
Log:
Update tailcall code to include inline attribute operand for memcpy.
Added:
llvm/trunk/test/CodeGen/X86/tailcallbyval.ll
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=43978&r1=43977&r2=43978&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Sat Nov 10 04:48:01 2007
@@ -1643,9 +1643,10 @@
SDOperand AlignNode = DAG.getConstant(Align, MVT::i32);
SDOperand SizeNode = DAG.getConstant(Size, MVT::i32);
- // Copy relative to framepointer.
- MemOpChains2.push_back(DAG.getNode(ISD::MEMCPY, MVT::Other, Chain, FIN,
- PtrOff, SizeNode, AlignNode));
+ SDOperand AlwaysInline = DAG.getConstant(1, MVT::i1);
+
+ MemOpChains2.push_back(DAG.getMemcpy(Chain, FIN, PtrOff, SizeNode,
+ AlignNode,AlwaysInline));
} else {
SDOperand LoadedArg = DAG.getLoad(VA.getValVT(), Chain, PtrOff, NULL,0);
// Store relative to framepointer.
Added: llvm/trunk/test/CodeGen/X86/tailcallbyval.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tailcallbyval.ll?rev=43978&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/tailcallbyval.ll (added)
+++ llvm/trunk/test/CodeGen/X86/tailcallbyval.ll Sat Nov 10 04:48:01 2007
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | llc -march=x86 -tailcallopt | grep TAILCALL
+%struct.s = type { i32, i32, i32 }
+
+define fastcc i32 @tailcallee(%struct.s* byval %a) {
+entry:
+ %tmp2 = getelementptr %struct.s* %a, i32 0, i32 0
+ %tmp3 = load i32* %tmp2
+ ret i32 %tmp3
+}
+
+define fastcc i32 @tailcaller(%struct.s* byval %a) {
+entry:
+ %tmp4 = tail call fastcc i32 @tailcallee(%struct.s* %a byval)
+ ret i32 %tmp4
+}
More information about the llvm-commits
mailing list