mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-30 16:17:05 +00:00 
			
		
		
		
	Update tailcall code to include inline attribute operand for memcpy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43978 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		| @@ -1643,9 +1643,10 @@ SDOperand X86TargetLowering::LowerX86_TailCallTo(SDOperand Op, | |||||||
|   |   | ||||||
|         SDOperand AlignNode = DAG.getConstant(Align, MVT::i32); |         SDOperand AlignNode = DAG.getConstant(Align, MVT::i32); | ||||||
|         SDOperand  SizeNode = DAG.getConstant(Size, MVT::i32); |         SDOperand  SizeNode = DAG.getConstant(Size, MVT::i32); | ||||||
|         // Copy relative to framepointer. |         SDOperand AlwaysInline = DAG.getConstant(1, MVT::i1); | ||||||
|         MemOpChains2.push_back(DAG.getNode(ISD::MEMCPY, MVT::Other, Chain, FIN, |  | ||||||
|                                            PtrOff, SizeNode, AlignNode)); |         MemOpChains2.push_back(DAG.getMemcpy(Chain, FIN, PtrOff, SizeNode,  | ||||||
|  |                                              AlignNode,AlwaysInline)); | ||||||
|       } else { |       } else { | ||||||
|         SDOperand LoadedArg = DAG.getLoad(VA.getValVT(), Chain, PtrOff, NULL,0); |         SDOperand LoadedArg = DAG.getLoad(VA.getValVT(), Chain, PtrOff, NULL,0); | ||||||
|         // Store relative to framepointer. |         // Store relative to framepointer. | ||||||
|   | |||||||
							
								
								
									
										15
									
								
								test/CodeGen/X86/tailcallbyval.ll
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								test/CodeGen/X86/tailcallbyval.ll
									
									
									
									
									
										Normal file
									
								
							| @@ -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 | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user