Chris Lattner 
							
						 
					 
					
						
						
							
						
						f95705163f 
					 
					
						
						
							
							Compile X > -1   -> text X,X; js dest  
						
						... 
						
						
						
						This implements CodeGen/X86/jump_sign.ll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30283  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-09-13 03:22:10 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						c356a572e3 
					 
					
						
						
							
							Reflects MachineConstantPoolEntry changes.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30279  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-09-12 21:04:05 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						734503be59 
					 
					
						
						
							
							X86ISD::CMP now produces a chain as well as a flag. Make that the chain  
						
						... 
						
						
						
						operand of a conditional branch to allow load folding into CMP / TEST
instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30241  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-09-11 02:19:56 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						25ab690a43 
					 
					
						
						
							
							Committing X86-64 support.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30177  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-09-08 06:48:29 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						8cf723d8eb 
					 
					
						
						
							
							- Identify a vector_shuffle that can be turned into an undef, e.g.  
						
						... 
						
						
						
						shuffle V1, <undef>, <undef, undef, 4, 5>
- Fix some suspicious logic into LowerVectorShuffle that cause less than
  optimal code by failing to identify MOVL (move to lowest element of a
  vector).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30171  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-09-08 01:50:06 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						ffc0b2663e 
					 
					
						
						
							
							Eliminate X86ISD::TEST, using X86ISD::CMP instead.  Match X86ISD::CMP patterns  
						
						... 
						
						
						
						using test, which provides nice simplifications like:
-       movl %edi, %ecx
-       andl $2, %ecx
-       cmpl $0, %ecx
+       testl $2, %edi
        je LBB1_11      #cond_next90
There are a couple of dagiselemitter deficiencies that this exposes, they will
be handled later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30156  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-09-07 20:33:45 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						5ea7a68e15 
					 
					
						
						
							
							Revert this patch, the front-end has been fixed to make it unneccesary.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29752  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-08-17 18:43:24 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						b5bc04d38a 
					 
					
						
						
							
							'g' is handled by the front-end.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29751  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-08-17 18:12:28 +00:00 
						 
				 
			
				
					
						
							
							
								Andrew Lenharth 
							
						 
					 
					
						
						
							
						
						ad1ed016ce 
					 
					
						
						
							
							Fix handling of 'g'.  Closes 883  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29750  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-08-17 17:50:12 +00:00 
						 
				 
			
				
					
						
							
							
								Andrew Lenharth 
							
						 
					 
					
						
						
							
						
						d337295fb0 
					 
					
						
						
							
							Add the 'c' constraint as needed by the linux kernel  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29747  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-08-17 16:07:50 +00:00 
						 
				 
			
				
					
						
							
							
								Andrew Lenharth 
							
						 
					 
					
						
						
							
						
						c63e56ee5f 
					 
					
						
						
							
							Add support for S and D constraints, as needed to compile the linux kernel.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29746  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-08-17 15:35:43 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						e219945348 
					 
					
						
						
							
							Eliminate use of getNode that takes a vector.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29614  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-08-11 17:38:39 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						64a752f7c7 
					 
					
						
						
							
							Match tablegen changes.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29604  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-08-11 09:08:15 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						311ace0391 
					 
					
						
						
							
							Convert more calls of getNode() that takes a vector to pass in the start of an array.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29601  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-08-11 07:35:45 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						bd564bfc63 
					 
					
						
						
							
							Start eliminating temporary vectors used to create DAG nodes.  Instead, pass  
						
						... 
						
						
						
						in the start of an array and a count of operands where applicable.  In many
cases, the number of operands is known, so this static array can be allocated
on the stack, avoiding the heap.  In many other cases, a SmallVector can be
used, which has the same benefit in the common cases.
I updated a lot of code calling getNode that takes a vector, but ran out of
time.  The rest of the code should be updated, and these methods should be
removed.
We should also do the same thing to eliminate the methods that take a
vector of MVT::ValueTypes.
It would be extra nice to convert the dagiselemitter to avoid creating vectors
for operands when calling getTargetNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29566  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-08-08 02:23:42 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						f76d180c95 
					 
					
						
						
							
							Fix PR850 and CodeGen/X86/2006-07-31-SingleRegClass.ll.  
						
						... 
						
						
						
						The CFE refers to all single-register constraints (like "A") by their 16-bit
name, even though the 8 or 32-bit version of the register may be needed.
The X86 backend should realize what is going on and redecode the name back
to its proper form.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29420  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-07-31 23:26:50 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						35d86fef1f 
					 
					
						
						
							
							Rename RelocModel::PIC to PIC_, to avoid conflicts with -DPIC.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29307  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-07-26 21:12:04 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						625518002d 
					 
					
						
						
							
							This opt is now handled in DAG combine.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29243  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-07-21 08:26:46 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						1e1a88e8cc 
					 
					
						
						
							
							A splat of a vector constant of all zero or all one is the vector constant.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29234  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-07-20 23:09:47 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						6d3465793f 
					 
					
						
						
							
							Add information preventing several register class constraints from working.  
						
						... 
						
						
						
						This implements PR828 and CodeGen/X86/2006-07-12-InlineAsmQConstraint.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29118  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-07-12 16:59:49 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						f4dff84c86 
					 
					
						
						
							
							Implement the inline asm 'A' constraint.  This implements PR825 and  
						
						... 
						
						
						
						CodeGen/X86/2006-07-10-InlineAsmAConstraint.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29101  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-07-11 02:54:03 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						1e60c098cc 
					 
					
						
						
							
							Fixed stack objects do not specify alignments, but their offsets are known.  
						
						... 
						
						
						
						Use that information when doing the transformation to merge multiple loads
into a 128-bit load.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29090  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-07-10 21:37:44 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						5c5f4ca6f1 
					 
					
						
						
							
							Mark internal function static  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29085  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-07-10 19:53:12 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						206ee9d86c 
					 
					
						
						
							
							X86 target specific DAG combine: turn build_vector (load x), (load x+4),  
						
						... 
						
						
						
						(load x+8), (load x+12), <0, 1, 2, 3> to a single 128-bit load (aligned and
unaligned).
e.g.
__m128 test(float a, float b, float c, float d) {
  return _mm_set_ps(d, c, b, a);
}
_test:
        movups 4(%esp), %xmm0
        ret
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29042  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-07-07 08:33:52 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						60c07e1aea 
					 
					
						
						
							
							Reorg. No functionality change.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28999  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-07-05 22:17:51 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						da08d2c39a 
					 
					
						
						
							
							Simplify X86CompilationCallback: always align to 16-byte boundary; don't save EAX/EDX if unnecessary.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28910  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-06-24 08:36:10 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						015188ffbc 
					 
					
						
						
							
							Type of vector extract / insert index operand should be iPTR.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28796  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-06-15 08:14:54 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						b69d113201 
					 
					
						
						
							
							Add argument registers to the end of call operand list (partial fix).  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28783  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-06-14 18:17:40 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						b12223e284 
					 
					
						
						
							
							Minor compilation speed improvement.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28736  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-06-09 06:24:42 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						e8bd0a332a 
					 
					
						
						
							
							Added X86FunctionInfo subclass of MachineFunction to record whether the  
						
						... 
						
						
						
						function that is being lowered is forced to use FP. Currently this is only
true for main() / Cygwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28703  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-06-06 23:30:24 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						2675534b7f 
					 
					
						
						
							
							Typos  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28617  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-06-01 05:53:27 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						04b2562502 
					 
					
						
						
							
							Remove a warning  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28607  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-06-01 00:30:39 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						8f692e2457 
					 
					
						
						
							
							Remove dead code.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28581  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-05-31 00:50:42 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						6848be1a27 
					 
					
						
						
							
							Change RET node to include signness information of the return values. i.e.  
						
						... 
						
						
						
						RET chain, value1, sign1, value2, sign2, ...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28510  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-05-26 23:10:12 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						3fddf241d8 
					 
					
						
						
							
							Vector argument must be passed in memory location aligned on 16-byte boundary.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28505  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-05-26 20:37:47 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						1d6a9b3b6c 
					 
					
						
						
							
							Mac OS X ABI document lied. The first four XMM registers are used to pass  
						
						... 
						
						
						
						vector arguments, not three.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28504  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-05-26 19:22:06 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						052fb5110f 
					 
					
						
						
							
							Minor update to make the code more clear  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28499  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-05-26 18:39:59 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						f9d62dc6e5 
					 
					
						
						
							
							Update more comments.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28498  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-05-26 18:37:16 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						f9ff7c54be 
					 
					
						
						
							
							Fix some comments.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28497  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-05-26 18:25:43 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						6f707999a1 
					 
					
						
						
							
							No need to handle illegal types.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28496  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-05-26 18:22:49 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						cc1fc220a0 
					 
					
						
						
							
							Consistency  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28488  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-05-25 23:31:23 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						25e71d10a0 
					 
					
						
						
							
							Some clean up.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28483  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-05-25 22:38:31 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						a9bb445db0 
					 
					
						
						
							
							Remove some dead code.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28481  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-05-25 22:25:52 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						6b5783d0b1 
					 
					
						
						
							
							Build breakage.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28475  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-05-25 18:56:34 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						32fe1035a7 
					 
					
						
						
							
							Switch X86 over to a call-selection model where the lowering code creates  
						
						... 
						
						
						
						the copyto/fromregs instead of making the X86ISD::CALL selection code create
them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28463  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-05-25 00:59:30 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						c6d0567324 
					 
					
						
						
							
							Fix file header comment  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28441  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-05-23 23:20:42 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						4db3af3511 
					 
					
						
						
							
							Better way to check for vararg.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28440  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-05-23 21:08:24 +00:00 
						 
				 
			
				
					
						
							
							
								Evan Cheng 
							
						 
					 
					
						
						
							
						
						25caf63cd2 
					 
					
						
						
							
							Remove PreprocessCCCArguments and PreprocessFastCCArguments now that  
						
						... 
						
						
						
						FORMAL_ARGUMENTS nodes include a token operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28439  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-05-23 21:06:34 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						2d2970905c 
					 
					
						
						
							
							Implement an annoying part of the Darwin/X86 abi: the callee of a struct  
						
						... 
						
						
						
						return argument pops the hidden struct pointer if present, not the caller.
For example, in this testcase:
struct X { int D, E, F, G; };
struct X bar() {
  struct X a;
  a.D = 0;
  a.E = 1;
  a.F = 2;
  a.G = 3;
  return a;
}
void foo(struct X *P) {
  *P = bar();
}
We used to emit:
_foo:
        subl $28, %esp
        movl 32(%esp), %eax
        movl %eax, (%esp)
        call _bar
        addl $28, %esp
        ret
_bar:
        movl 4(%esp), %eax
        movl $0, (%eax)
        movl $1, 4(%eax)
        movl $2, 8(%eax)
        movl $3, 12(%eax)
        ret
This is correct on Linux/X86 but not Darwin/X86.  With this patch, we now
emit:
_foo:
        subl $28, %esp
        movl 32(%esp), %eax
        movl %eax, (%esp)
        call _bar
***     addl $24, %esp
        ret
_bar:
        movl 4(%esp), %eax
        movl $0, (%eax)
        movl $1, 4(%eax)
        movl $2, 8(%eax)
        movl $3, 12(%eax)
***     ret $4
For the record, GCC emits (which is functionally equivalent to our new code):
_bar:
        movl    4(%esp), %eax
        movl    $3, 12(%eax)
        movl    $2, 8(%eax)
        movl    $1, 4(%eax)
        movl    $0, (%eax)
        ret     $4
_foo:
        pushl   %esi
        subl    $40, %esp
        movl    48(%esp), %esi
        leal    16(%esp), %eax
        movl    %eax, (%esp)
        call    _bar
        subl    $4, %esp
        movl    16(%esp), %eax
        movl    %eax, (%esi)
        movl    20(%esp), %eax
        movl    %eax, 4(%esi)
        movl    24(%esp), %eax
        movl    %eax, 8(%esi)
        movl    28(%esp), %eax
        movl    %eax, 12(%esi)
        addl    $40, %esp
        popl    %esi
        ret
This fixes SingleSource/Benchmarks/CoyoteBench/fftbench with LLC and the
JIT, and fixes the X86-backend portion of PR729.  The CBE still needs to
be updated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28438  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-05-23 18:50:38 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						cdbaeb52ae 
					 
					
						
						
							
							CSRet allows varargs  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28409  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2006-05-19 21:34:04 +00:00