22e978a736 
								
							 
						 
						
							
							
								
								Removing even more <iostream> includes.  
							
							... 
							
							
							
							llvm-svn: 32320 
							
						 
						
							2006-12-07 20:04:42 +00:00  
				
					
						
							
							
								 
						
							
								a743fada65 
								
							 
						 
						
							
							
								
								Avoid inifinite looping if READCYCLECOUNTER isn't custom lowered.  
							
							... 
							
							
							
							llvm-svn: 32022 
							
						 
						
							2006-11-29 19:13:47 +00:00  
				
					
						
							
							
								 
						
							
								6973993e9c 
								
							 
						 
						
							
							
								
								Allow target to custom lower READCYCLECOUNTER (when it doesn't have to be expanded).  
							
							... 
							
							
							
							llvm-svn: 32016 
							
						 
						
							2006-11-29 08:26:18 +00:00  
				
					
						
							
							
								 
						
							
								3abb63651b 
								
							 
						 
						
							
							
								
								Fix PR1016  
							
							... 
							
							
							
							llvm-svn: 31950 
							
						 
						
							2006-11-28 01:03:30 +00:00  
				
					
						
							
							
								 
						
							
								db18938355 
								
							 
						 
						
							
							
								
								If a brcond condition is promoted, make sure to zero extend it, even if not  
							
							... 
							
							
							
							expanded into BR_CC.
llvm-svn: 31932 
							
						 
						
							2006-11-27 04:39:56 +00:00  
				
					
						
							
							
								 
						
							
								94c231f453 
								
							 
						 
						
							
							
								
								Fix PR988 and CodeGen/Generic/2006-11-06-MemIntrinsicExpand.ll.  
							
							... 
							
							
							
							The low part goes in the first operand of expandop, not the second one.
llvm-svn: 31487 
							
						 
						
							2006-11-07 04:11:44 +00:00  
				
					
						
							
							
								 
						
							
								de46e48420 
								
							 
						 
						
							
							
								
								For PR786:  
							
							... 
							
							
							
							Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting
fall out by removing unused variables. Remaining warnings have to do with
unused functions (I didn't want to delete code without review) and unused
variables in generated code. Maintainers should clean up the remaining
issues when they see them. All changes pass DejaGnu tests and Olden.
llvm-svn: 31380 
							
						 
						
							2006-11-02 20:25:50 +00:00  
				
					
						
							
							
								 
						
							
								e6d584765f 
								
							 
						 
						
							
							
								
								Fix a typo which can break jumptables.  
							
							... 
							
							
							
							llvm-svn: 31305 
							
						 
						
							2006-10-31 02:31:00 +00:00  
				
					
						
							
							
								 
						
							
								84a28d4e76 
								
							 
						 
						
							
							
								
								Lower jumptable to BR_JT. The legalizer can lower it to a BRIND or let the target custom lower it.  
							
							... 
							
							
							
							llvm-svn: 31293 
							
						 
						
							2006-10-30 08:00:44 +00:00  
				
					
						
							
							
								 
						
							
								e0fc4dfc22 
								
							 
						 
						
							
							
								
								For PR950:  
							
							... 
							
							
							
							This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.
llvm-svn: 31063 
							
						 
						
							2006-10-20 07:07:24 +00:00  
				
					
						
							
							
								 
						
							
								ab51cf2e78 
								
							 
						 
						
							
							
								
								Merge ISD::TRUNCSTORE to ISD::STORE. Switch to using StoreSDNode.  
							
							... 
							
							
							
							llvm-svn: 30945 
							
						 
						
							2006-10-13 21:14:26 +00:00  
				
					
						
							
							
								 
						
							
								6a4c6d3a7a 
								
							 
						 
						
							
							
								
								Typo  
							
							... 
							
							
							
							llvm-svn: 30884 
							
						 
						
							2006-10-11 17:52:19 +00:00  
				
					
						
							
							
								 
						
							
								d35734bd1f 
								
							 
						 
						
							
							
								
								Naming consistency.  
							
							... 
							
							
							
							llvm-svn: 30878 
							
						 
						
							2006-10-11 07:10:22 +00:00  
				
					
						
							
							
								 
						
							
								a6bbf33cbf 
								
							 
						 
						
							
							
								
								Jimptables working again on alpha.  
							
							... 
							
							
							
							As a bonus, use the GOT node instead of the AlphaISD::GOT for internal stuff.
llvm-svn: 30873 
							
						 
						
							2006-10-11 04:29:42 +00:00  
				
					
						
							
							
								 
						
							
								8438429c96 
								
							 
						 
						
							
							
								
								Fix another bug in extload promotion.  
							
							... 
							
							
							
							llvm-svn: 30857 
							
						 
						
							2006-10-10 18:54:19 +00:00  
				
					
						
							
							
								 
						
							
								dc6a3aab71 
								
							 
						 
						
							
							
								
								Fix a bug introduced by my LOAD/LOADX changes.  
							
							... 
							
							
							
							llvm-svn: 30853 
							
						 
						
							2006-10-10 07:51:21 +00:00  
				
					
						
							
							
								 
						
							
								e71fe34d75 
								
							 
						 
						
							
							
								
								Reflects ISD::LOAD / ISD::LOADX / LoadSDNode changes.  
							
							... 
							
							
							
							llvm-svn: 30844 
							
						 
						
							2006-10-09 20:57:25 +00:00  
				
					
						
							
							
								 
						
							
								f9f90bc239 
								
							 
						 
						
							
							
								
								Fix a bug legalizing zero-extending i64 loads into 32-bit loads.  The bottom  
							
							... 
							
							
							
							part was always forced to be sextload, even when we needed an zextload.
llvm-svn: 30782 
							
						 
						
							2006-10-07 00:58:36 +00:00  
				
					
						
							
							
								 
						
							
								f5839a0816 
								
							 
						 
						
							
							
								
								Fix a miscompilation of:  
							
							... 
							
							
							
							long long foo(long long X) {
  return (long long)(signed char)(int)X;
}
Instead of:
_foo:
        extsb r2, r4
        srawi r3, r4, 31
        mr r4, r2
        blr
we now produce:
_foo:
        extsb r4, r4
        srawi r3, r4, 31
        blr
This fixes a miscompilation in ConstantFolding.cpp.
llvm-svn: 30768 
							
						 
						
							2006-10-06 17:34:12 +00:00  
				
					
						
							
							
								 
						
							
								df9ac47e5e 
								
							 
						 
						
							
							
								
								Make use of getStore().  
							
							... 
							
							
							
							llvm-svn: 30759 
							
						 
						
							2006-10-05 23:01:46 +00:00  
				
					
						
							
							
								 
						
							
								5d9fd977d3 
								
							 
						 
						
							
							
								
								Combine ISD::EXTLOAD, ISD::SEXTLOAD, ISD::ZEXTLOAD into ISD::LOADX. Add an  
							
							... 
							
							
							
							extra operand to LOADX to specify the exact value extension type.
llvm-svn: 30714 
							
						 
						
							2006-10-04 00:56:09 +00:00  
				
					
						
							
							
								 
						
							
								91d76cb27f 
								
							 
						 
						
							
							
								
								Fix an obvious typo.  
							
							... 
							
							
							
							llvm-svn: 30711 
							
						 
						
							2006-10-03 23:08:27 +00:00  
				
					
						
							
							
								 
						
							
								783a4a9d86 
								
							 
						 
						
							
							
								
								Add support for other relocation bases to jump tables, as well as custom asm directives  
							
							... 
							
							
							
							llvm-svn: 30593 
							
						 
						
							2006-09-24 19:45:58 +00:00  
				
					
						
							
							
								 
						
							
								875ea0cdbd 
								
							 
						 
						
							
							
								
								Expand 64-bit shifts more optimally if we know that the high bit of the  
							
							... 
							
							
							
							shift amount is one or zero.  For example, for:
long long foo1(long long X, int C) {
  return X << (C|32);
}
long long foo2(long long X, int C) {
  return X << (C&~32);
}
we get:
_foo1:
        movb $31, %cl
        movl 4(%esp), %edx
        andb 12(%esp), %cl
        shll %cl, %edx
        xorl %eax, %eax
        ret
_foo2:
        movb $223, %cl
        movl 4(%esp), %eax
        movl 8(%esp), %edx
        andb 12(%esp), %cl
        shldl %cl, %eax, %edx
        shll %cl, %eax
        ret
instead of:
_foo1:
        subl $4, %esp
        movl %ebx, (%esp)
        movb $32, %bl
        movl 8(%esp), %eax
        movl 12(%esp), %edx
        movb %bl, %cl
        orb 16(%esp), %cl
        shldl %cl, %eax, %edx
        shll %cl, %eax
        xorl %ecx, %ecx
        testb %bl, %bl
        cmovne %eax, %edx
        cmovne %ecx, %eax
        movl (%esp), %ebx
        addl $4, %esp
        ret
_foo2:
        subl $4, %esp
        movl %ebx, (%esp)
        movb $223, %cl
        movl 8(%esp), %eax
        movl 12(%esp), %edx
        andb 16(%esp), %cl
        shldl %cl, %eax, %edx
        shll %cl, %eax
        xorl %ecx, %ecx
        xorb %bl, %bl
        testb %bl, %bl
        cmovne %eax, %edx
        cmovne %ecx, %eax
        movl (%esp), %ebx
        addl $4, %esp
        ret
llvm-svn: 30506 
							
						 
						
							2006-09-20 03:38:48 +00:00  
				
					
						
							
							
								 
						
							
								1fc7c363e6 
								
							 
						 
						
							
							
								
								Fix a typo.  
							
							... 
							
							
							
							llvm-svn: 30474 
							
						 
						
							2006-09-18 23:28:33 +00:00  
				
					
						
							
							
								 
						
							
								4bfaf0bd2c 
								
							 
						 
						
							
							
								
								Allow  i32 UDIV, SDIV, UREM, SREM to be expanded into libcalls.  
							
							... 
							
							
							
							llvm-svn: 30470 
							
						 
						
							2006-09-18 21:49:04 +00:00  
				
					
						
							
							
								 
						
							
								e50f5d1fb1 
								
							 
						 
						
							
							
								
								Oh yeah, this is needed too  
							
							... 
							
							
							
							llvm-svn: 30407 
							
						 
						
							2006-09-16 05:08:34 +00:00  
				
					
						
							
							
								 
						
							
								1b63391fdf 
								
							 
						 
						
							
							
								
								simplify control flow, no functionality change  
							
							... 
							
							
							
							llvm-svn: 30403 
							
						 
						
							2006-09-16 00:21:44 +00:00  
				
					
						
							
							
								 
						
							
								fbadbda6ba 
								
							 
						 
						
							
							
								
								Allow custom expand of mul  
							
							... 
							
							
							
							llvm-svn: 30402 
							
						 
						
							2006-09-16 00:09:24 +00:00  
				
					
						
							
							
								 
						
							
								72b503bcad 
								
							 
						 
						
							
							
								
								Compile X << 1 (where X is a long-long) to:  
							
							... 
							
							
							
							addl %ecx, %ecx
        adcl %eax, %eax
instead of:
        movl %ecx, %edx
        addl %edx, %edx
        shrl $31, %ecx
        addl %eax, %eax
        orl %ecx, %eax
and to:
        addc r5, r5, r5
        adde r4, r4, r4
instead of:
        slwi r2,r9,1
        srwi r0,r11,31
        slwi r3,r11,1
        or r2,r0,r2
on PPC.
llvm-svn: 30284 
							
						 
						
							2006-09-13 03:50:39 +00:00  
				
					
						
							
							
								 
						
							
								f0359b343a 
								
							 
						 
						
							
							
								
								Implement the fpowi now by lowering to a libcall  
							
							... 
							
							
							
							llvm-svn: 30225 
							
						 
						
							2006-09-09 06:03:30 +00:00  
				
					
						
							
							
								 
						
							
								e4bbb6c341 
								
							 
						 
						
							
							
								
								Allow targets to custom lower expanded BIT_CONVERT's  
							
							... 
							
							
							
							llvm-svn: 30217 
							
						 
						
							2006-09-09 00:20:27 +00:00  
				
					
						
							
							
								 
						
							
								e93762d36e 
								
							 
						 
						
							
							
								
								Allow legalizer to expand ISD::MUL using only MULHS in the rare case that is  
							
							... 
							
							
							
							possible and the target only supports MULHS.
llvm-svn: 30022 
							
						 
						
							2006-09-01 18:17:58 +00:00  
				
					
						
							
							
								 
						
							
								3d27be1333 
								
							 
						 
						
							
							
								
								s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|  
							
							... 
							
							
							
							llvm-svn: 29911 
							
						 
						
							2006-08-27 12:54:02 +00:00  
				
					
						
							
							
								 
						
							
								451b099113 
								
							 
						 
						
							
							
								
								Fix PR861  
							
							... 
							
							
							
							llvm-svn: 29796 
							
						 
						
							2006-08-21 20:24:53 +00:00  
				
					
						
							
							
								 
						
							
								bd8877744b 
								
							 
						 
						
							
							
								
								eliminate use of getNode that takes vector of valuetypes.  
							
							... 
							
							
							
							llvm-svn: 29687 
							
						 
						
							2006-08-14 23:53:35 +00:00  
				
					
						
							
							
								 
						
							
								c24a1d3093 
								
							 
						 
						
							
							
								
								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.
llvm-svn: 29566 
							
						 
						
							2006-08-08 02:23:42 +00:00  
				
					
						
							
							
								 
						
							
								97af9d5d3a 
								
							 
						 
						
							
							
								
								Eliminate some malloc traffic by allocating vectors on the stack.  Change some  
							
							... 
							
							
							
							method that took std::vector<SDOperand> to take a pointer to a first operand
and #operands.
This speeds up isel on kc++ by about 3%.
llvm-svn: 29561 
							
						 
						
							2006-08-08 01:09:31 +00:00  
				
					
						
							
							
								 
						
							
								8927c875bb 
								
							 
						 
						
							
							
								
								Make SelectionDAG::RemoveDeadNodes iterative instead of recursive, which  
							
							... 
							
							
							
							also make it simpler.
llvm-svn: 29524 
							
						 
						
							2006-08-04 17:45:20 +00:00  
				
					
						
							
							
								 
						
							
								4488f0c303 
								
							 
						 
						
							
							
								
								Fix a case where LegalizeAllNodesNotLeadingTo could take exponential time.  
							
							... 
							
							
							
							This manifested itself as really long time to compile
Regression/CodeGen/Generic/2003-05-28-ManyArgs.ll on ppc.
This is PR847.
llvm-svn: 29313 
							
						 
						
							2006-07-26 23:55:56 +00:00  
				
					
						
							
							
								 
						
							
								c3d341ea98 
								
							 
						 
						
							
							
								
								Ensure that dump calls that are associated with asserts are removed from  
							
							... 
							
							
							
							non-debug build.
llvm-svn: 29105 
							
						 
						
							2006-07-11 17:58:07 +00:00  
				
					
						
							
							
								 
						
							
								1b8ea1f5ba 
								
							 
						 
						
							
							
								
								Fix CodeGen/Alpha/2006-07-03-ASMFormalLowering.ll and PR818.  
							
							... 
							
							
							
							llvm-svn: 29099 
							
						 
						
							2006-07-11 01:40:09 +00:00  
				
					
						
							
							
								 
						
							
								54a34cd20b 
								
							 
						 
						
							
							
								
								Mark these two classes as hidden, shrinking libllbmgcc.dylib by 25K  
							
							... 
							
							
							
							llvm-svn: 28970 
							
						 
						
							2006-06-28 21:58:30 +00:00  
				
					
						
							
							
								 
						
							
								a2e9953c54 
								
							 
						 
						
							
							
								
								Change RET node to include signness information of the return values. e.g.  
							
							... 
							
							
							
							RET chain, value1, sign1, value2, sign2
llvm-svn: 28509 
							
						 
						
							2006-05-26 23:09:09 +00:00  
				
					
						
							
							
								 
						
							
								aa2372562e 
								
							 
						 
						
							
							
								
								Patches to make the LLVM sources more -pedantic clean.  Patch provided  
							
							... 
							
							
							
							by Anton Korobeynikov!  This is a step towards closing PR786.
llvm-svn: 28447 
							
						 
						
							2006-05-24 17:04:05 +00:00  
				
					
						
							
							
								 
						
							
								62f1b83c0e 
								
							 
						 
						
							
							
								
								When we legalize target nodes, do not use getNode to create a new node,  
							
							... 
							
							
							
							use UpdateNodeOperands to just update the operands!  This is important because
getNode will allocate a new node if the node returns a flag and this breaks
assumptions in the legalizer that you can legalize some things multiple times
and get exactly the same results.
This latent bug was exposed by my ppc patch last night, and this fixes
gsm/toast.
llvm-svn: 28348 
							
						 
						
							2006-05-17 18:00:08 +00:00  
				
					
						
							
							
								 
						
							
								a1cec0106a 
								
							 
						 
						
							
							
								
								Add an assertion, avoid some unneeded work for each call.  No functionality  
							
							... 
							
							
							
							change.
llvm-svn: 28347 
							
						 
						
							2006-05-17 17:55:45 +00:00  
				
					
						
							
							
								 
						
							
								aaa23d953f 
								
							 
						 
						
							
							
								
								Add a new ISD::CALL node, make the default impl of TargetLowering::LowerCallTo  
							
							... 
							
							
							
							produce it.
llvm-svn: 28338 
							
						 
						
							2006-05-16 22:53:20 +00:00  
				
					
						
							
							
								 
						
							
								5f0edfb849 
								
							 
						 
						
							
							
								
								Legalize FORMAL_ARGUMENTS nodes correctly, we don't want to legalize them once  
							
							... 
							
							
							
							for each argument.
llvm-svn: 28313 
							
						 
						
							2006-05-16 05:49:56 +00:00  
				
					
						
							
							
								 
						
							
								69a0ce6261 
								
							 
						 
						
							
							
								
								Merge identical code.  
							
							... 
							
							
							
							llvm-svn: 28274 
							
						 
						
							2006-05-13 02:11:14 +00:00  
				
					
						
							
							
								 
						
							
								1a225d23ae 
								
							 
						 
						
							
							
								
								Fix PR773  
							
							... 
							
							
							
							llvm-svn: 28207 
							
						 
						
							2006-05-09 18:20:51 +00:00  
				
					
						
							
							
								 
						
							
								20a631fde7 
								
							 
						 
						
							
							
								
								Refactor TargetMachine, pushing handling of TargetData into the target-specific subclasses.  This has one caller-visible change: getTargetData() now returns a pointer instead of a reference.  
							
							... 
							
							
							
							This fixes PR 759.
llvm-svn: 28074 
							
						 
						
							2006-05-03 01:29:57 +00:00  
				
					
						
							
							
								 
						
							
								4ca2ea5b43 
								
							 
						 
						
							
							
								
								JumpTable support!  What this represents is working asm and jit support for  
							
							... 
							
							
							
							x86 and ppc for 100% dense switch statements when relocations are non-PIC.
This support will be extended and enhanced in the coming days to support
PIC, and less dense forms of jump tables.
llvm-svn: 27947 
							
						 
						
							2006-04-22 18:53:45 +00:00  
				
					
						
							
							
								 
						
							
								73eb58e1a2 
								
							 
						 
						
							
							
								
								Simplify some code  
							
							... 
							
							
							
							llvm-svn: 27846 
							
						 
						
							2006-04-19 23:17:50 +00:00  
				
					
						
							
							
								 
						
							
								916ae0775e 
								
							 
						 
						
							
							
								
								Fix handling of calls in functions that use vectors.  This fixes a crash on  
							
							... 
							
							
							
							the code in GCC PR26546.
llvm-svn: 27780 
							
						 
						
							2006-04-17 22:10:08 +00:00  
				
					
						
							
							
								 
						
							
								326870b40b 
								
							 
						 
						
							
							
								
								Codegen insertelement with constant insertion points as scalar_to_vector  
							
							... 
							
							
							
							and a shuffle.  For this:
void %test2(<4 x float>* %F, float %f) {
        %tmp = load <4 x float>* %F             ; <<4 x float>> [#uses=2]
        %tmp3 = add <4 x float> %tmp, %tmp              ; <<4 x float>> [#uses=1]
        %tmp2 = insertelement <4 x float> %tmp3, float %f, uint 2               ; <<4 x float>> [#uses=2]
        %tmp6 = add <4 x float> %tmp2, %tmp2            ; <<4 x float>> [#uses=1]
        store <4 x float> %tmp6, <4 x float>* %F
        ret void
}
we now get this on X86 (which will get better):
_test2:
        movl 4(%esp), %eax
        movaps (%eax), %xmm0
        addps %xmm0, %xmm0
        movaps %xmm0, %xmm1
        shufps $3, %xmm1, %xmm1
        movaps %xmm0, %xmm2
        shufps $1, %xmm2, %xmm2
        unpcklps %xmm1, %xmm2
        movss 8(%esp), %xmm1
        unpcklps %xmm1, %xmm0
        unpcklps %xmm2, %xmm0
        addps %xmm0, %xmm0
        movaps %xmm0, (%eax)
        ret
instead of:
_test2:
        subl $28, %esp
        movl 32(%esp), %eax
        movaps (%eax), %xmm0
        addps %xmm0, %xmm0
        movaps %xmm0, (%esp)
        movss 36(%esp), %xmm0
        movss %xmm0, 8(%esp)
        movaps (%esp), %xmm0
        addps %xmm0, %xmm0
        movaps %xmm0, (%eax)
        addl $28, %esp
        ret
llvm-svn: 27765 
							
						 
						
							2006-04-17 19:21:01 +00:00  
				
					
						
							
							
								 
						
							
								91226e5799 
								
							 
						 
						
							
							
								
								Add support for promoting stores from one legal type to another, allowing us  
							
							... 
							
							
							
							to write one pattern for vector stores instead of 4.
llvm-svn: 27730 
							
						 
						
							2006-04-16 01:36:45 +00:00  
				
					
						
							
							
								 
						
							
								086e986e94 
								
							 
						 
						
							
							
								
								Make this assertion better  
							
							... 
							
							
							
							llvm-svn: 27695 
							
						 
						
							2006-04-14 06:08:35 +00:00  
				
					
						
							
							
								 
						
							
								119266ea92 
								
							 
						 
						
							
							
								
								Promote vector AND, OR, and XOR  
							
							... 
							
							
							
							llvm-svn: 27632 
							
						 
						
							2006-04-12 21:20:24 +00:00  
				
					
						
							
							
								 
						
							
								be8a8933e6 
								
							 
						 
						
							
							
								
								Vector type promotion for ISD::LOAD and ISD::SELECT  
							
							... 
							
							
							
							llvm-svn: 27606 
							
						 
						
							2006-04-12 16:33:18 +00:00  
				
					
						
							
							
								 
						
							
								d3b504ae10 
								
							 
						 
						
							
							
								
								Implement support for the formal_arguments node.  To get this, targets shouldcustom legalize it and remove their XXXTargetLowering::LowerArguments overload  
							
							... 
							
							
							
							llvm-svn: 27604 
							
						 
						
							2006-04-12 16:20:43 +00:00  
				
					
						
							
							
								 
						
							
								7256b0ae05 
								
							 
						 
						
							
							
								
								Only get Tmp2 for cases where number of operands is > 1. Fixed return void.  
							
							... 
							
							
							
							llvm-svn: 27586 
							
						 
						
							2006-04-11 06:33:39 +00:00  
				
					
						
							
							
								 
						
							
								6cf3bbbe17 
								
							 
						 
						
							
							
								
								add some todos  
							
							... 
							
							
							
							llvm-svn: 27580 
							
						 
						
							2006-04-11 02:00:08 +00:00  
				
					
						
							
							
								 
						
							
								2eb22eef7d 
								
							 
						 
						
							
							
								
								Add basic support for legalizing returns of vectors  
							
							... 
							
							
							
							llvm-svn: 27578 
							
						 
						
							2006-04-11 01:31:51 +00:00  
				
					
						
							
							
								 
						
							
								cb73b8d419 
								
							 
						 
						
							
							
								
								Missing break  
							
							... 
							
							
							
							llvm-svn: 27559 
							
						 
						
							2006-04-10 18:54:36 +00:00  
				
					
						
							
							
								 
						
							
								02274a5265 
								
							 
						 
						
							
							
								
								Add code generator support for VSELECT  
							
							... 
							
							
							
							llvm-svn: 27542 
							
						 
						
							2006-04-08 22:22:57 +00:00  
				
					
						
							
							
								 
						
							
								e1401e3610 
								
							 
						 
						
							
							
								
								Canonicalize vvector_shuffle(x,x) -> vvector_shuffle(x,undef) to enable patterns  
							
							... 
							
							
							
							to match again :)
llvm-svn: 27533 
							
						 
						
							2006-04-08 05:34:25 +00:00  
				
					
						
							
							
								 
						
							
								101ea66813 
								
							 
						 
						
							
							
								
								add a sanity check: LegalizeOp should return a value that is the same type  
							
							... 
							
							
							
							as its input.
llvm-svn: 27528 
							
						 
						
							2006-04-08 04:13:17 +00:00  
				
					
						
							
							
								 
						
							
								78e3d565af 
								
							 
						 
						
							
							
								
								INSERT_VECTOR_ELT lowering bug:  
							
							... 
							
							
							
							store vector to $esp
  store element to $esp + sizeof(VT) * index
  load  vector from $esp
The bug is VT is the type of the vector element, not the type of the vector!
llvm-svn: 27517 
							
						 
						
							2006-04-08 01:46:37 +00:00  
				
					
						
							
							
								 
						
							
								9fa8959dce 
								
							 
						 
						
							
							
								
								Exapnd a VECTOR_SHUFFLE to a BUILD_VECTOR if target asks for it to be expanded  
							
							... 
							
							
							
							or custom lowering fails.
llvm-svn: 27432 
							
						 
						
							2006-04-05 06:07:11 +00:00  
				
					
						
							
							
								 
						
							
								6be79823e7 
								
							 
						 
						
							
							
								
								* Add supprot for SCALAR_TO_VECTOR operations where the input needs to be  
							
							... 
							
							
							
							promoted/expanded (e.g. SCALAR_TO_VECTOR from i8/i16 on PPC).
* Add support for targets to request that VECTOR_SHUFFLE nodes be promoted
  to a canonical type, for example, we only want v16i8 shuffles on PPC.
* Move isShuffleLegal out of TLI into Legalize.
* Teach isShuffleLegal to allow shuffles that need to be promoted.
llvm-svn: 27399 
							
						 
						
							2006-04-04 17:23:26 +00:00  
				
					
						
							
							
								 
						
							
								42a5fca47e 
								
							 
						 
						
							
							
								
								Implement promotion for EXTRACT_VECTOR_ELT, allowing v16i8 multiplies to work with PowerPC.  
							
							... 
							
							
							
							llvm-svn: 27349 
							
						 
						
							2006-04-02 05:06:04 +00:00  
				
					
						
							
							
								 
						
							
								87f080949b 
								
							 
						 
						
							
							
								
								Implement the Expand action for binary vector operations to break the binop  
							
							... 
							
							
							
							into elements and operate on each piece.  This allows generic vector integer
multiplies to work on PPC, though the generated code is horrible.
llvm-svn: 27347 
							
						 
						
							2006-04-02 03:57:31 +00:00  
				
					
						
							
							
								 
						
							
								ef598059f2 
								
							 
						 
						
							
							
								
								Add a new -view-legalize-dags command line option  
							
							... 
							
							
							
							llvm-svn: 27342 
							
						 
						
							2006-04-02 03:07:27 +00:00  
				
					
						
							
							
								 
						
							
								d9e4daabd2 
								
							 
						 
						
							
							
								
								Do not endian swap split vector loads.  This fixes UnitTests/Vector/sumarray-dbl on PPC.  
							
							... 
							
							
							
							Now all UnitTests/Vector/* tests pass on PPC.
llvm-svn: 27299 
							
						 
						
							2006-03-31 18:22:37 +00:00  
				
					
						
							
							
								 
						
							
								8d90f526d7 
								
							 
						 
						
							
							
								
								Do not endian swap the operands to a store if the operands came from a vector.  
							
							... 
							
							
							
							This fixes UnitTests/Vector/simple.c with altivec.
llvm-svn: 27298 
							
						 
						
							2006-03-31 18:20:46 +00:00  
				
					
						
							
							
								 
						
							
								6f42325dca 
								
							 
						 
						
							
							
								
								Implement PromoteOp for VEXTRACT_VECTOR_ELT.  Thsi fixes  
							
							... 
							
							
							
							Generic/vector.ll:test_extract_elt on non-sse X86 systems.
llvm-svn: 27294 
							
						 
						
							2006-03-31 17:55:51 +00:00  
				
					
						
							
							
								 
						
							
								8e1fcab2bc 
								
							 
						 
						
							
							
								
								Scalarized vector stores need not be legal, e.g. if the vector element type  
							
							... 
							
							
							
							needs to be promoted or expanded.  Relegalize the scalar store once created.
This fixes CodeGen/Generic/vector.ll:test1 on non-SSE x86 targets.
llvm-svn: 27293 
							
						 
						
							2006-03-31 17:37:22 +00:00  
				
					
						
							
							
								 
						
							
								5fe1f54c17 
								
							 
						 
						
							
							
								
								Significantly improve handling of vectors that are live across basic blocks,  
							
							... 
							
							
							
							handling cases where the vector elements need promotion, expansion, and when
the vector type itself needs to be decimated.
llvm-svn: 27278 
							
						 
						
							2006-03-31 02:06:56 +00:00  
				
					
						
							
							
								 
						
							
								168e45b0b3 
								
							 
						 
						
							
							
								
								Expand INSERT_VECTOR_ELT to store vec, sp; store elt, sp+k; vec = load sp;  
							
							... 
							
							
							
							llvm-svn: 27274 
							
						 
						
							2006-03-31 01:27:51 +00:00  
				
					
						
							
							
								 
						
							
								f6f94d3bce 
								
							 
						 
						
							
							
								
								Teach Legalize how to pack VVECTOR_SHUFFLE nodes into VECTOR_SHUFFLE nodes.  
							
							... 
							
							
							
							llvm-svn: 27232 
							
						 
						
							2006-03-28 20:24:43 +00:00  
				
					
						
							
							
								 
						
							
								e55d171ccd 
								
							 
						 
						
							
							
								
								Tblgen doesn't like multiple SDNode<> definitions that map to the sameenum value.  Split them into separate enums.  
							
							... 
							
							
							
							llvm-svn: 27201 
							
						 
						
							2006-03-28 00:40:33 +00:00  
				
					
						
							
							
								 
						
							
								d5f94c9574 
								
							 
						 
						
							
							
								
								Fix legalization of intrinsics with chain and result values  
							
							... 
							
							
							
							llvm-svn: 27181 
							
						 
						
							2006-03-27 20:28:29 +00:00  
				
					
						
							
							
								 
						
							
								30ee72586d 
								
							 
						 
						
							
							
								
								Allow targets to custom lower their own intrinsics if desired.  
							
							... 
							
							
							
							llvm-svn: 27146 
							
						 
						
							2006-03-26 09:12:51 +00:00  
				
					
						
							
							
								 
						
							
								68d9bf26c8 
								
							 
						 
						
							
							
								
								Only to vector shuffle for {x,x,y,y} cases when SCALAR_TO_VECTOR is free.  
							
							... 
							
							
							
							llvm-svn: 27071 
							
						 
						
							2006-03-24 18:45:20 +00:00  
				
					
						
							
							
								 
						
							
								77e271cb4e 
								
							 
						 
						
							
							
								
								prefer to generate constant pool loads over splats.  This prevents us from  
							
							... 
							
							
							
							using a splat for {1.0,1.0,1.0,1.0}
llvm-svn: 27055 
							
						 
						
							2006-03-24 07:29:17 +00:00  
				
					
						
							
							
								 
						
							
								a4f6805a86 
								
							 
						 
						
							
							
								
								legalize vbit_convert nodes whose result is a legal type.  
							
							... 
							
							
							
							Legalize intrinsic nodes.
llvm-svn: 27036 
							
						 
						
							2006-03-24 02:26:29 +00:00  
				
					
						
							
							
								 
						
							
								1d2e995fc1 
								
							 
						 
						
							
							
								
								Lower BUILD_VECTOR to VECTOR_SHUFFLE if there are two distinct nodes (and if  
							
							... 
							
							
							
							the target can handle it). Issue two SCALAR_TO_VECTOR ops followed by a
VECTOR_SHUFFLE to select from the two vectors.
llvm-svn: 27023 
							
						 
						
							2006-03-24 01:17:21 +00:00  
				
					
						
							
							
								 
						
							
								d7c4e7d255 
								
							 
						 
						
							
							
								
								add support for splitting casts.  This implements  
							
							... 
							
							
							
							CodeGen/Generic/vector.ll:test_cast_2.
llvm-svn: 26999 
							
						 
						
							2006-03-23 21:16:34 +00:00  
				
					
						
							
							
								 
						
							
								9ea1b3f9fd 
								
							 
						 
						
							
							
								
								simplify some code  
							
							... 
							
							
							
							llvm-svn: 26972 
							
						 
						
							2006-03-23 05:29:04 +00:00  
				
					
						
							
							
								 
						
							
								2f4119a608 
								
							 
						 
						
							
							
								
								Implement simple support for vector casting.  This can currently only handle  
							
							... 
							
							
							
							casts between legal vector types.
llvm-svn: 26961 
							
						 
						
							2006-03-22 20:09:35 +00:00  
				
					
						
							
							
								 
						
							
								8fa445a89d 
								
							 
						 
						
							
							
								
								Endianness does not affect the order of vector fields.  This fixes  
							
							... 
							
							
							
							SingleSource/UnitTests/Vector/build.c
llvm-svn: 26936 
							
						 
						
							2006-03-22 01:46:54 +00:00  
				
					
						
							
							
								 
						
							
								5be4352124 
								
							 
						 
						
							
							
								
								Enclose some variables in a scope to avoid error with some gcc versions  
							
							... 
							
							
							
							llvm-svn: 26934 
							
						 
						
							2006-03-22 00:12:37 +00:00  
				
					
						
							
							
								 
						
							
								340a6b5c26 
								
							 
						 
						
							
							
								
								add expand support for extractelement  
							
							... 
							
							
							
							llvm-svn: 26931 
							
						 
						
							2006-03-21 21:02:03 +00:00  
				
					
						
							
							
								 
						
							
								7c0cd8cafc 
								
							 
						 
						
							
							
								
								add some trivial support for extractelement.  
							
							... 
							
							
							
							llvm-svn: 26928 
							
						 
						
							2006-03-21 20:44:12 +00:00  
				
					
						
							
							
								 
						
							
								672a42d731 
								
							 
						 
						
							
							
								
								Add a hacky workaround for crashes due to vectors live across blocks.  
							
							... 
							
							
							
							Note that this code won't work for vectors that aren't legal on the
target.  Improvements coming.
llvm-svn: 26925 
							
						 
						
							2006-03-21 19:20:37 +00:00  
				
					
						
							
							
								 
						
							
								21e68c8001 
								
							 
						 
						
							
							
								
								If a target supports splatting with SHUFFLE_VECTOR, lower to it from BUILD_VECTOR(x,x,x,x)  
							
							... 
							
							
							
							llvm-svn: 26885 
							
						 
						
							2006-03-20 01:52:29 +00:00  
				
					
						
							
							
								 
						
							
								79fb91cc69 
								
							 
						 
						
							
							
								
								Allow SCALAR_TO_VECTOR to be custom lowered.  
							
							... 
							
							
							
							llvm-svn: 26867 
							
						 
						
							2006-03-19 06:47:21 +00:00  
				
					
						
							
							
								 
						
							
								9cdc5a0ce7 
								
							 
						 
						
							
							
								
								Add SCALAR_TO_VECTOR support  
							
							... 
							
							
							
							llvm-svn: 26866 
							
						 
						
							2006-03-19 06:31:19 +00:00  
				
					
						
							
							
								 
						
							
								eb5b2e705c 
								
							 
						 
						
							
							
								
								Don't bother storing undef elements of BUILD_VECTOR's  
							
							... 
							
							
							
							llvm-svn: 26858 
							
						 
						
							2006-03-19 05:46:04 +00:00  
				
					
						
							
							
								 
						
							
								5d3ff12c8f 
								
							 
						 
						
							
							
								
								Implement expand of BUILD_VECTOR containing variable elements.  
							
							... 
							
							
							
							This implements CodeGen/Generic/vector.ll:test_variable_buildvector
llvm-svn: 26852 
							
						 
						
							2006-03-19 04:18:56 +00:00  
				
					
						
							
							
								 
						
							
								29b2301460 
								
							 
						 
						
							
							
								
								implement basic support for INSERT_VECTOR_ELT.  
							
							... 
							
							
							
							llvm-svn: 26849 
							
						 
						
							2006-03-19 01:17:20 +00:00  
				
					
						
							
							
								 
						
							
								f4e1a53647 
								
							 
						 
						
							
							
								
								Rename ConstantVec -> BUILD_VECTOR and VConstant -> VBUILD_VECTOR.  Allow*BUILD_VECTOR to take variable inputs.  
							
							... 
							
							
							
							llvm-svn: 26847 
							
						 
						
							2006-03-19 00:52:58 +00:00  
				
					
						
							
							
								 
						
							
								c16b05e67d 
								
							 
						 
						
							
							
								
								implement vector.ll:test_undef  
							
							... 
							
							
							
							llvm-svn: 26845 
							
						 
						
							2006-03-19 00:20:20 +00:00  
				
					
						
							
							
								 
						
							
								93640543a9 
								
							 
						 
						
							
							
								
								Fix the remaining bugs in the vector expansion rework I commited yesterday.  
							
							... 
							
							
							
							This fixes CodeGen/Generic/vector.ll
llvm-svn: 26843 
							
						 
						
							2006-03-19 00:07:49 +00:00  
				
					
						
							
							
								 
						
							
								32206f54c6 
								
							 
						 
						
							
							
								
								Change the structure of lowering vector stuff.  Note: This breaks some  
							
							... 
							
							
							
							things.
llvm-svn: 26840 
							
						 
						
							2006-03-18 01:44:44 +00:00  
				
					
						
							
							
								 
						
							
								bb01d4f272 
								
							 
						 
						
							
							
								
								Remove BRTWOWAY*  
							
							... 
							
							
							
							Make the PPC backend not dependent on BRTWOWAY_CC and make the branch
selector smarter about the code it generates, fixing a case in the
readme.
llvm-svn: 26814 
							
						 
						
							2006-03-17 01:40:33 +00:00  
				
					
						
							
							
								 
						
							
								cad70c3e46 
								
							 
						 
						
							
							
								
								Add a note, this code should be moved to the dag combiner.  
							
							... 
							
							
							
							llvm-svn: 26787 
							
						 
						
							2006-03-15 22:19:18 +00:00  
				
					
						
							
							
								 
						
							
								994d8e6bd4 
								
							 
						 
						
							
							
								
								For targets with FABS/FNEG support, lower copysign to an integer load,  
							
							... 
							
							
							
							a select and FABS/FNEG.
This speeds up a trivial (aka stupid) copysign benchmark I wrote from 6.73s
to 2.64s, woo.
llvm-svn: 26723 
							
						 
						
							2006-03-13 06:08:38 +00:00  
				
					
						
							
							
								 
						
							
								3fe975b846 
								
							 
						 
						
							
							
								
								revert the previous patch, didn't mean to check it in yet  
							
							... 
							
							
							
							llvm-svn: 26610 
							
						 
						
							2006-03-08 04:39:05 +00:00  
				
					
						
							
							
								 
						
							
								af5e26c980 
								
							 
						 
						
							
							
								
								remove "Slot", it is dead  
							
							... 
							
							
							
							llvm-svn: 26609 
							
						 
						
							2006-03-08 04:37:58 +00:00  
				
					
						
							
							
								 
						
							
								5c1ba2ac08 
								
							 
						 
						
							
							
								
								Codegen copysign[f] into a FCOPYSIGN node  
							
							... 
							
							
							
							llvm-svn: 26542 
							
						 
						
							2006-03-05 05:09:38 +00:00  
				
					
						
							
							
								 
						
							
								3bf916ddd9 
								
							 
						 
						
							
							
								
								Add more vector NodeTypes: VSDIV, VUDIV, VAND, VOR, and VXOR.  
							
							... 
							
							
							
							llvm-svn: 26504 
							
						 
						
							2006-03-03 07:01:07 +00:00  
				
					
						
							
							
								 
						
							
								ad3c974a77 
								
							 
						 
						
							
							
								
								remove the read/write port/io intrinsics.  
							
							... 
							
							
							
							llvm-svn: 26479 
							
						 
						
							2006-03-03 00:19:58 +00:00  
				
					
						
							
							
								 
						
							
								b97aab4371 
								
							 
						 
						
							
							
								
								Vector ops lowering.  
							
							... 
							
							
							
							llvm-svn: 26436 
							
						 
						
							2006-03-01 01:09:54 +00:00  
				
					
						
							
							
								 
						
							
								486d1bc5ed 
								
							 
						 
						
							
							
								
								Fix a problem on itanium with memset.  The value to set has been promoted to  
							
							... 
							
							
							
							i64 before this code, so zero_ext doesn't work.
llvm-svn: 26290 
							
						 
						
							2006-02-20 06:38:35 +00:00  
				
					
						
							
							
								 
						
							
								5965bd19f8 
								
							 
						 
						
							
							
								
								kill ADD_PARTS & SUB_PARTS and replace them with fancy new ADDC, ADDE, SUBC  
							
							... 
							
							
							
							and SUBE nodes that actually expose what's going on and allow for
significant simplifications in the targets.
llvm-svn: 26255 
							
						 
						
							2006-02-17 05:43:56 +00:00  
				
					
						
							
							
								 
						
							
								9ec392b2aa 
								
							 
						 
						
							
							
								
								Fix another miscompilation exposed by lencode, where we lowered i64->f32  
							
							... 
							
							
							
							conversions to __floatdidf instead of __floatdisf on targets that support
f32 but not i64 (e.g. sparc).
llvm-svn: 26254 
							
						 
						
							2006-02-17 04:32:33 +00:00  
				
					
						
							
							
								 
						
							
								2eea436192 
								
							 
						 
						
							
							
								
								Should not combine ISD::LOCATIONs until we have scheme to remove from  
							
							... 
							
							
							
							MachineDebugInfo tables.
llvm-svn: 26216 
							
						 
						
							2006-02-15 19:34:44 +00:00  
				
					
						
							
							
								 
						
							
								8e2ee7358f 
								
							 
						 
						
							
							
								
								Fix a latent bug in the call sequence handling stuff.  Some targets (e.g. x86)  
							
							... 
							
							
							
							create these nodes with flag results.  Remember that we legalized them.
llvm-svn: 26156 
							
						 
						
							2006-02-14 00:55:02 +00:00  
				
					
						
							
							
								 
						
							
								462505fc5f 
								
							 
						 
						
							
							
								
								Completely rewrite libcall insertion by the legalizer, providing the  
							
							... 
							
							
							
							following handy-dandy properties:
1. it is always correct now
2. it is much faster than before
3. it is easier to understand
This implementation builds off of the recent simplifications of the
legalizer that made it single-pass instead of iterative.
This fixes JM/lencod, JM/ldecod, and
CodeGen/Generic/2006-02-12-InsertLibcall.ll (at least on PPC).
llvm-svn: 26144 
							
						 
						
							2006-02-13 09:18:02 +00:00  
				
					
						
							
							
								 
						
							
								01bd9d9911 
								
							 
						 
						
							
							
								
								*** empty log message ***  
							
							... 
							
							
							
							llvm-svn: 25879 
							
						 
						
							2006-02-01 19:05:15 +00:00  
				
					
						
							
							
								 
						
							
								7e7f439f85 
								
							 
						 
						
							
							
								
								Fix some of the stuff in the PPC README file, and clean up legalization  
							
							... 
							
							
							
							of the SELECT_CC, BR_CC, and BRTWOWAY_CC nodes.
llvm-svn: 25875 
							
						 
						
							2006-02-01 07:19:44 +00:00  
				
					
						
							
							
								 
						
							
								2443ab932d 
								
							 
						 
						
							
							
								
								Allow custom lowering of fabs. I forgot to check in this change which  
							
							... 
							
							
							
							caused several test failures.
llvm-svn: 25852 
							
						 
						
							2006-01-31 18:14:25 +00:00  
				
					
						
							
							
								 
						
							
								e9721b2984 
								
							 
						 
						
							
							
								
								Only insert an AND when converting from BR_COND to BRCC if needed.  
							
							... 
							
							
							
							llvm-svn: 25832 
							
						 
						
							2006-01-31 05:04:52 +00:00  
				
					
						
							
							
								 
						
							
								f263a23735 
								
							 
						 
						
							
							
								
								Fix a bug in my legalizer reworking that caused the X86 backend to not get  
							
							... 
							
							
							
							a chance to custom legalize setcc, which broke a bunch of C++ Codes.
Testcase here: CodeGen/X86/2006-01-30-LongSetcc.ll
llvm-svn: 25821 
							
						 
						
							2006-01-30 22:43:50 +00:00  
				
					
						
							
							
								 
						
							
								d6f5ae4455 
								
							 
						 
						
							
							
								
								don't insert an and node if it isn't needed here, this can prevent folding  
							
							... 
							
							
							
							of lowered target nodes.
llvm-svn: 25804 
							
						 
						
							2006-01-30 04:22:28 +00:00  
				
					
						
							
							
								 
						
							
								4d1ea71a31 
								
							 
						 
						
							
							
								
								Fix RET of promoted values on targets that custom expand RET to a target node.  
							
							... 
							
							
							
							llvm-svn: 25794 
							
						 
						
							2006-01-29 21:02:23 +00:00  
				
					
						
							
							
								 
						
							
								2c748afd6c 
								
							 
						 
						
							
							
								
								cleanups to the ValueTypeActions interface  
							
							... 
							
							
							
							llvm-svn: 25785 
							
						 
						
							2006-01-29 08:42:06 +00:00  
				
					
						
							
							
								 
						
							
								ccb4476c87 
								
							 
						 
						
							
							
								
								Remove some special case hacks for CALLSEQ_*, using UpdateNodeOperands  
							
							... 
							
							
							
							instead.
llvm-svn: 25780 
							
						 
						
							2006-01-29 07:58:15 +00:00  
				
					
						
							
							
								 
						
							
								2f292789dc 
								
							 
						 
						
							
							
								
								Allow custom expansion of ConstantVec nodes.  PPC will use this in the future.  
							
							... 
							
							
							
							llvm-svn: 25774 
							
						 
						
							2006-01-29 06:34:16 +00:00  
				
					
						
							
							
								 
						
							
								758b0ac54b 
								
							 
						 
						
							
							
								
								Legalize ConstantFP into TargetConstantFP when the target allows.  Implement  
							
							... 
							
							
							
							custom expansion of ConstantFP nodes.
llvm-svn: 25772 
							
						 
						
							2006-01-29 06:26:56 +00:00  
				
					
						
							
							
								 
						
							
								678da98835 
								
							 
						 
						
							
							
								
								eliminate uses of SelectionDAG::getBR2Way_CC  
							
							... 
							
							
							
							llvm-svn: 25767 
							
						 
						
							2006-01-29 06:00:45 +00:00  
				
					
						
							
							
								 
						
							
								d02b05473c 
								
							 
						 
						
							
							
								
								Use the new "UpdateNodeOperands" method to simplify LegalizeDAG and make it  
							
							... 
							
							
							
							faster.  This cuts about 120 lines of code out of the legalizer (mostly code
checking to see if operands have changed).
It also fixes an ugly performance issue, where the legalizer cloned the entire
graph after any change.  Now the "UpdateNodeOperands" method gives it a chance
to reuse nodes if the operands of a node change but not its opcode or valuetypes.
This speeds up instruction selection time on kimwitu++ by about 8.2% with a
release build.
llvm-svn: 25746 
							
						 
						
							2006-01-28 10:58:55 +00:00  
				
					
						
							
							
								 
						
							
								eb63751499 
								
							 
						 
						
							
							
								
								minor tweaks  
							
							... 
							
							
							
							llvm-svn: 25740 
							
						 
						
							2006-01-28 08:31:04 +00:00  
				
					
						
							
							
								 
						
							
								689bdcc9cf 
								
							 
						 
						
							
							
								
								move a bunch of code, no other change.  
							
							... 
							
							
							
							llvm-svn: 25739 
							
						 
						
							2006-01-28 08:25:58 +00:00  
				
					
						
							
							
								 
						
							
								fcfda5a174 
								
							 
						 
						
							
							
								
								remove a couple more now-extraneous legalizeop's  
							
							... 
							
							
							
							llvm-svn: 25738 
							
						 
						
							2006-01-28 08:22:56 +00:00  
				
					
						
							
							
								 
						
							
								364b89a784 
								
							 
						 
						
							
							
								
								fix a bug  
							
							... 
							
							
							
							llvm-svn: 25737 
							
						 
						
							2006-01-28 07:42:08 +00:00  
				
					
						
							
							
								 
						
							
								9dcce6da8e 
								
							 
						 
						
							
							
								
								Several major changes:  
							
							... 
							
							
							
							1. Pull out the expand cases for BSWAP and CT* into a separate function,
   reducing the size of LegalizeOp.
2. Fix a bug where expand(bswap i64) was wrong when i64 is legal.
3. Changed LegalizeOp/PromoteOp so that the legalizer never needs to be
   iterative.  It now operates in a single pass over the nodes.
4. Simplify a LOT of code, with a net reduction of ~280 lines.
llvm-svn: 25736 
							
						 
						
							2006-01-28 07:39:30 +00:00  
				
					
						
							
							
								 
						
							
								fd4a7f76a9 
								
							 
						 
						
							
							
								
								Eliminate the need for ExpandOp to set 'needsanotheriteration', as it already  
							
							... 
							
							
							
							relegalizes the stuff it returns.
Add the ability to custom expand ADD/SUB, so that targets don't need to deal
with ADD_PARTS/SUB_PARTS if they don't want.
Fix some obscure potential bugs and simplify code.
llvm-svn: 25732 
							
						 
						
							2006-01-28 05:07:51 +00:00  
				
					
						
							
							
								 
						
							
								10f677508f 
								
							 
						 
						
							
							
								
								Instead of making callers of ExpandLibCall legalize the result, make  
							
							... 
							
							
							
							ExpandLibCall do it itself.
llvm-svn: 25731 
							
						 
						
							2006-01-28 04:28:26 +00:00  
				
					
						
							
							
								 
						
							
								a593acfe66 
								
							 
						 
						
							
							
								
								Eliminate the need to do another iteration of the legalizer after inserting  
							
							... 
							
							
							
							a libcall.
llvm-svn: 25730 
							
						 
						
							2006-01-28 04:23:12 +00:00  
				
					
						
							
							
								 
						
							
								595ec734fc 
								
							 
						 
						
							
							
								
								Implement Promote for VAARG, and allow it to be custom promoted for people  
							
							... 
							
							
							
							who don't want the default behavior (Alpha).
llvm-svn: 25726 
							
						 
						
							2006-01-28 03:14:31 +00:00  
				
					
						
							
							
								 
						
							
								fb16a62fba 
								
							 
						 
						
							
							
								
								Remove the ISD::CALL and ISD::TAILCALL nodes  
							
							... 
							
							
							
							llvm-svn: 25721 
							
						 
						
							2006-01-28 00:18:58 +00:00  
				
					
						
							
							
								 
						
							
								476e67be14 
								
							 
						 
						
							
							
								
								initial selectiondag support for new INLINEASM node.  Note that inline asms  
							
							... 
							
							
							
							with outputs or inputs are not supported yet. :)
llvm-svn: 25664 
							
						 
						
							2006-01-26 22:24:51 +00:00  
				
					
						
							
							
								 
						
							
								e74795cd70 
								
							 
						 
						
							
							
								
								First part of bug 680:  
							
							... 
							
							
							
							Remove TLI.LowerVA* and replace it with SDNodes that are lowered the same
way as everything else.
llvm-svn: 25606 
							
						 
						
							2006-01-25 18:21:52 +00:00  
				
					
						
							
							
								 
						
							
								f9a1e3aadc 
								
							 
						 
						
							
							
								
								Fix an infinite loop I caused by making sure to legalize the flag operand  
							
							... 
							
							
							
							of CALLSEQ_* nodes
llvm-svn: 25582 
							
						 
						
							2006-01-24 05:48:21 +00:00  
				
					
						
							
							
								 
						
							
								763dfd7723 
								
							 
						 
						
							
							
								
								Fix Regression/CodeGen/SparcV8/2006-01-22-BitConvertLegalize.ll by making  
							
							... 
							
							
							
							sure that the result of expanding a BIT_CONVERT node is itself legalized.
llvm-svn: 25538 
							
						 
						
							2006-01-23 07:30:46 +00:00  
				
					
						
							
							
								 
						
							
								44cab00045 
								
							 
						 
						
							
							
								
								Fix CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll  
							
							... 
							
							
							
							llvm-svn: 25496 
							
						 
						
							2006-01-21 04:27:00 +00:00  
				
					
						
							
							
								 
						
							
								15afe462a8 
								
							 
						 
						
							
							
								
								remove some unintentionally committed code  
							
							... 
							
							
							
							llvm-svn: 25483 
							
						 
						
							2006-01-20 18:40:10 +00:00  
				
					
						
							
							
								 
						
							
								222ceabbee 
								
							 
						 
						
							
							
								
								If the target doesn't support f32 natively, insert the FP_EXTEND in target-indep  
							
							... 
							
							
							
							code, so that the LowerReturn code doesn't have to handle it.
llvm-svn: 25482 
							
						 
						
							2006-01-20 18:38:32 +00:00  
				
					
						
							
							
								 
						
							
								13e8c9d6de 
								
							 
						 
						
							
							
								
								Another typo  
							
							... 
							
							
							
							llvm-svn: 25440 
							
						 
						
							2006-01-19 04:54:52 +00:00  
				
					
						
							
							
								 
						
							
								7599b6e4af 
								
							 
						 
						
							
							
								
								was ignoring the legalized chain in this case, fixed SPASS on alpha  
							
							... 
							
							
							
							llvm-svn: 25428 
							
						 
						
							2006-01-18 23:19:08 +00:00  
				
					
						
							
							
								 
						
							
								6f86a7db07 
								
							 
						 
						
							
							
								
								Bug fix: missing LegalizeOp() on newly created nodes.  
							
							... 
							
							
							
							llvm-svn: 25401 
							
						 
						
							2006-01-17 19:47:13 +00:00  
				
					
						
							
							
								 
						
							
								b9966029fe 
								
							 
						 
						
							
							
								
								Adding basic support for Dwarf line number debug information.  
							
							... 
							
							
							
							I promise to keep future commits smaller.
llvm-svn: 25396 
							
						 
						
							2006-01-17 17:31:53 +00:00  
				
					
						
							
							
								 
						
							
								2642a35f4c 
								
							 
						 
						
							
							
								
								Expand case for 64b Legalize, even though no one should end up using this  
							
							... 
							
							
							
							(itanium supports bswap natively, alpha should custom lower it using the
VAX floating point swapload, ha ha).
llvm-svn: 25356 
							
						 
						
							2006-01-16 07:59:13 +00:00  
				
					
						
							
							
								 
						
							
								59b82f9848 
								
							 
						 
						
							
							
								
								Allow the target to specify 'expand' if they just require the amount to  
							
							... 
							
							
							
							be subtracted from the stack pointer.
llvm-svn: 25331 
							
						 
						
							2006-01-15 08:54:32 +00:00  
				
					
						
							
							
								 
						
							
								2d59142613 
								
							 
						 
						
							
							
								
								Fix custom lowering of dynamic_stackalloc  
							
							... 
							
							
							
							llvm-svn: 25329 
							
						 
						
							2006-01-15 08:43:08 +00:00  
				
					
						
							
							
								 
						
							
								02011c9a4f 
								
							 
						 
						
							
							
								
								Token chain results are not always the first or last result.  Consider copyfromreg nodes, where they are the middle result (the flag result is last)  
							
							... 
							
							
							
							llvm-svn: 25325 
							
						 
						
							2006-01-14 22:41:46 +00:00  
				
					
						
							
							
								 
						
							
								2fba8a3aaa 
								
							 
						 
						
							
							
								
								bswap implementation  
							
							... 
							
							
							
							llvm-svn: 25312 
							
						 
						
							2006-01-14 03:14:10 +00:00  
				
					
						
							
							
								 
						
							
								ed9b3e1c0a 
								
							 
						 
						
							
							
								
								If a target specified a stack pointer with setStackPointerRegisterToSaveRestore,  
							
							... 
							
							
							
							lower STACKSAVE/STACKRESTORE into a copy from/to that register.
llvm-svn: 25276 
							
						 
						
							2006-01-13 17:48:44 +00:00  
				
					
						
							
							
								 
						
							
								b32664583b 
								
							 
						 
						
							
							
								
								Compile llvm.stacksave/restore into STACKSAVE/STACKRESTORE nodes, and allow  
							
							... 
							
							
							
							targets to custom expand them as they desire.
llvm-svn: 25273 
							
						 
						
							2006-01-13 02:50:02 +00:00  
				
					
						
							
							
								 
						
							
								7f4ec8274f 
								
							 
						 
						
							
							
								
								Allow custom lowering of DYNAMIC_STACKALLOC.  
							
							... 
							
							
							
							llvm-svn: 25224 
							
						 
						
							2006-01-11 22:14:47 +00:00  
				
					
						
							
							
								 
						
							
								1b8121b227 
								
							 
						 
						
							
							
								
								Add bswap, rotl, and rotr nodes  
							
							... 
							
							
							
							Add dag combiner code to recognize rotl, rotr
Add ppc code to match rotl
Targets should add rotl/rotr patterns if they have them
llvm-svn: 25222 
							
						 
						
							2006-01-11 21:21:00 +00:00  
				
					
						
							
							
								 
						
							
								fb5f46541c 
								
							 
						 
						
							
							
								
								silence a warning  
							
							... 
							
							
							
							llvm-svn: 25184 
							
						 
						
							2006-01-10 19:43:26 +00:00  
				
					
						
							
							
								 
						
							
								90ba544826 
								
							 
						 
						
							
							
								
								Fix an exponential function in libcall insertion to not be exponential. :)  
							
							... 
							
							
							
							llvm-svn: 25165 
							
						 
						
							2006-01-09 23:21:49 +00:00  
				
					
						
							
							
								 
						
							
								870e4f8e38 
								
							 
						 
						
							
							
								
								* Allow custom lowering of ADD_PARTS, SUB_PARTS, SHL_PARTS, SRA_PARTS,  
							
							... 
							
							
							
							and SRL_PARTS.
* Fix a bug that caused *_PARTS to be custom lowered twice.
llvm-svn: 25157 
							
						 
						
							2006-01-09 18:31:59 +00:00  
				
					
						
							
							
								 
						
							
								fae8afb77f 
								
							 
						 
						
							
							
								
								Unbreak the build :(  
							
							... 
							
							
							
							llvm-svn: 25124 
							
						 
						
							2006-01-06 05:47:48 +00:00  
				
					
						
							
							
								 
						
							
								f35b1c837f 
								
							 
						 
						
							
							
								
								Support for custom lowering of ISD::RET.  
							
							... 
							
							
							
							llvm-svn: 25116 
							
						 
						
							2006-01-06 00:41:43 +00:00  
				
					
						
							
							
								 
						
							
								762e9ec06c 
								
							 
						 
						
							
							
								
								Added initial support for DEBUG_LABEL allowing debug specific labels to be  
							
							... 
							
							
							
							inserted in the code.
llvm-svn: 25104 
							
						 
						
							2006-01-05 01:25:28 +00:00  
				
					
						
							
							
								 
						
							
								219d559824 
								
							 
						 
						
							
							
								
								Applied some recommend changes from sabre.  The dominate one beginning "let the  
							
							... 
							
							
							
							pass manager do it's thing."  Fixes crash when compiling -g files and suppresses
dwarf statements if no debug info is present.
llvm-svn: 25100 
							
						 
						
							2006-01-04 22:28:25 +00:00  
				
					
						
							
							
								 
						
							
								0da76a676a 
								
							 
						 
						
							
							
								
								Add unique id to debug location for debug label use (work in progress.)  
							
							... 
							
							
							
							llvm-svn: 25096 
							
						 
						
							2006-01-04 15:04:11 +00:00  
				
					
						
							
							
								 
						
							
								6f9ff633a6 
								
							 
						 
						
							
							
								
								Change how MachineDebugInfo is fetched.  
							
							... 
							
							
							
							llvm-svn: 25089 
							
						 
						
							2006-01-04 13:42:59 +00:00  
				
					
						
							
							
								 
						
							
								30db2ec59f 
								
							 
						 
						
							
							
								
								allow custom lowering to return null for legal results  
							
							... 
							
							
							
							llvm-svn: 25007 
							
						 
						
							2005-12-25 01:07:37 +00:00  
				
					
						
							
							
								 
						
							
								7259426d88 
								
							 
						 
						
							
							
								
								Support Custom lowering of a few more operations.  
							
							... 
							
							
							
							Alpha needs to custom lower *DIV and *REM
llvm-svn: 25006 
							
						 
						
							2005-12-24 23:42:32 +00:00  
				
					
						
							
							
								 
						
							
								c7037abc5b 
								
							 
						 
						
							
							
								
								unbreak the build :-/  
							
							... 
							
							
							
							llvm-svn: 24992 
							
						 
						
							2005-12-23 16:12:20 +00:00  
				
					
						
							
							
								 
						
							
								31d15fa093 
								
							 
						 
						
							
							
								
								Allow custom lowering of LOAD, EXTLOAD, ZEXTLOAD, STORE, and TRUNCSTORE. Not  
							
							... 
							
							
							
							currently used.
llvm-svn: 24988 
							
						 
						
							2005-12-23 07:29:34 +00:00  
				
					
						
							
							
								 
						
							
								884eb3adc3 
								
							 
						 
						
							
							
								
								Fix a pasto  
							
							... 
							
							
							
							llvm-svn: 24973 
							
						 
						
							2005-12-23 00:52:30 +00:00  
				
					
						
							
							
								 
						
							
								9eae8d5d03 
								
							 
						 
						
							
							
								
								fix a thinko in the bit_convert handling code  
							
							... 
							
							
							
							llvm-svn: 24972 
							
						 
						
							2005-12-23 00:50:25 +00:00  
				
					
						
							
							
								 
						
							
								36e663d6e1 
								
							 
						 
						
							
							
								
								add very simple support for the BIT_CONVERT node  
							
							... 
							
							
							
							llvm-svn: 24970 
							
						 
						
							2005-12-23 00:16:34 +00:00  
				
					
						
							
							
								 
						
							
								177d7af5d5 
								
							 
						 
						
							
							
								
								remove dead code  
							
							... 
							
							
							
							llvm-svn: 24965 
							
						 
						
							2005-12-22 21:16:08 +00:00  
				
					
						
							
							
								 
						
							
								1408c05a8b 
								
							 
						 
						
							
							
								
								The 81st column doesn't like code in it.  
							
							... 
							
							
							
							llvm-svn: 24943 
							
						 
						
							2005-12-22 05:23:45 +00:00  
				
					
						
							
							
								 
						
							
								9e296bee9a 
								
							 
						 
						
							
							
								
								Disengage DEBUG_LOC from non-PPC targets.  
							
							... 
							
							
							
							llvm-svn: 24919 
							
						 
						
							2005-12-21 20:51:37 +00:00  
				
					
						
							
							
								 
						
							
								c1583dbd63 
								
							 
						 
						
							
							
								
								* Added support for X86 RET with an additional operand to specify number of  
							
							... 
							
							
							
							bytes to pop off stack.
* Added support for X86 SETCC.
llvm-svn: 24917 
							
						 
						
							2005-12-21 20:21:51 +00:00  
				
					
						
							
							
								 
						
							
								0fab459362 
								
							 
						 
						
							
							
								
								make sure to relegalize all cases  
							
							... 
							
							
							
							llvm-svn: 24911 
							
						 
						
							2005-12-21 19:40:42 +00:00  
				
					
						
							
							
								 
						
							
								ac12f68424 
								
							 
						 
						
							
							
								
								fix a bug I introduced that broke recursive expansion of nodes (e.g. scalarizing vectors)  
							
							... 
							
							
							
							llvm-svn: 24905 
							
						 
						
							2005-12-21 18:02:52 +00:00  
				
					
						
							
							
								 
						
							
								2af3ee4bdd 
								
							 
						 
						
							
							
								
								Fix a nasty latent bug in the legalizer that was triggered by my patch  
							
							... 
							
							
							
							last night, breaking crafty and twolf.  Make sure that the newly found
legal nodes are themselves not re-legalized until the next iteration.
Also, since this functionality exists now, we can reduce number of legalizer
iterations by depending on this behavior instead of having to misuse 'do
another iteration' to get the same effect.
llvm-svn: 24875 
							
						 
						
							2005-12-20 00:53:54 +00:00  
				
					
						
							
							
								 
						
							
								6fc31046aa 
								
							 
						 
						
							
							
								
								X86 conditional branch support.  
							
							... 
							
							
							
							llvm-svn: 24870 
							
						 
						
							2005-12-19 23:12:38 +00:00  
				
					
						
							
							
								 
						
							
								c06da626b4 
								
							 
						 
						
							
							
								
								Make sure to relegalize new nodes  
							
							... 
							
							
							
							llvm-svn: 24843 
							
						 
						
							2005-12-18 23:54:29 +00:00  
				
					
						
							
							
								 
						
							
								ebcfa0c210 
								
							 
						 
						
							
							
								
								More corrections for flagged copyto/from reg  
							
							... 
							
							
							
							llvm-svn: 24828 
							
						 
						
							2005-12-18 15:36:21 +00:00  
				
					
						
							
							
								 
						
							
								e3c67e97c7 
								
							 
						 
						
							
							
								
								legalize copytoreg and copyfromreg nodes that have flag operands correctly.  
							
							... 
							
							
							
							llvm-svn: 24826 
							
						 
						
							2005-12-18 15:27:43 +00:00  
				
					
						
							
							
								 
						
							
								bf0bd99e03 
								
							 
						 
						
							
							
								
								allow custom expansion of BR_CC  
							
							... 
							
							
							
							llvm-svn: 24804 
							
						 
						
							2005-12-17 23:46:46 +00:00  
				
					
						
							
							
								 
						
							
								225a4d0d6d 
								
							 
						 
						
							
							
								
								X86 lowers SELECT to a cmp / test followed by a conditional move.  
							
							... 
							
							
							
							llvm-svn: 24754 
							
						 
						
							2005-12-17 01:21:05 +00:00  
				
					
						
							
							
								 
						
							
								7c462768ed 
								
							 
						 
						
							
							
								
								Added source file/line correspondence for dwarf (PowerPC only at this point.)  
							
							... 
							
							
							
							llvm-svn: 24748 
							
						 
						
							2005-12-16 22:45:29 +00:00  
				
					
						
							
							
								 
						
							
								956aef45c9 
								
							 
						 
						
							
							
								
								Lowering constant pool entries on ppc exposed a bug in the recently added  
							
							... 
							
							
							
							ConstantVec legalizing code, which would return constantpool nodes that
were not of the target's pointer type.
llvm-svn: 24691 
							
						 
						
							2005-12-13 03:03:23 +00:00  
				
					
						
							
							
								 
						
							
								b42ce7ca63 
								
							 
						 
						
							
							
								
								Fix CodeGen/Generic/2005-12-12-ExpandSextInreg.ll  
							
							... 
							
							
							
							llvm-svn: 24677 
							
						 
						
							2005-12-12 22:27:43 +00:00  
				
					
						
							
							
								 
						
							
								4e56db674c 
								
							 
						 
						
							
							
								
								Add support for TargetConstantPool nodes to the dag isel emitter, and use  
							
							... 
							
							
							
							them in the PPC backend, to simplify some logic out of Select and
SelectAddr.
llvm-svn: 24657 
							
						 
						
							2005-12-10 02:36:00 +00:00  
				
					
						
							
							
								 
						
							
								268d457b69 
								
							 
						 
						
							
							
								
								Teach legalize how to promote sext_inreg to fix a problem Andrew pointed  
							
							... 
							
							
							
							out to me.
llvm-svn: 24644 
							
						 
						
							2005-12-09 17:32:47 +00:00  
				
					
						
							
							
								 
						
							
								ae89d862f5 
								
							 
						 
						
							
							
								
								Fix a crash where ConstantVec nodes were being generated with the wrong  
							
							... 
							
							
							
							type when the target did not support them.  Also teach Legalize how to
expand ConstantVecs.
This allows us to generate
_test:
        lwz r2, 12(r3)
        lwz r4, 8(r3)
        lwz r5, 4(r3)
        lwz r6, 0(r3)
        addi r2, r2, 4
        addi r4, r4, 3
        addi r5, r5, 2
        addi r6, r6, 1
        stw r2, 12(r3)
        stw r4, 8(r3)
        stw r5, 4(r3)
        stw r6, 0(r3)
        blr
For:
void %test(%v4i *%P) {
        %T = load %v4i* %P
        %S = add %v4i %T, <int 1, int 2, int 3, int 4>
        store %v4i %S, %v4i * %P
        ret void
}
On PowerPC.
llvm-svn: 24633 
							
						 
						
							2005-12-07 19:48:11 +00:00  
				
					
						
							
							
								 
						
							
								41b1cdc771 
								
							 
						 
						
							
							
								
								Teach the SelectionDAG ISel how to turn ConstantPacked values into  
							
							... 
							
							
							
							constant nodes with vector types.  Also teach the asm printer how to print
ConstantPacked constant pool entries.  This allows us to generate altivec
code such as the following, which adds a vector constantto a packed float.
LCPI1_0:  <4 x float> < float 0.0e+0, float 0.0e+0, float 0.0e+0, float 1.0e+0 >
        .space  4
        .space  4
        .space  4
        .long   1065353216      ; float 1
        .text
        .align  4
        .globl  _foo
_foo:
        lis r2, ha16(LCPI1_0)
        la r2, lo16(LCPI1_0)(r2)
        li r4, 0
        lvx v0, r4, r2
        lvx v1, r4, r3
        vaddfp v0, v1, v0
        stvx v0, r4, r3
        blr
For the llvm code:
void %foo(<4 x float> * %a) {
entry:
  %tmp1 = load <4 x float> * %a;
  %tmp2 = add <4 x float> %tmp1, < float 0.0, float 0.0, float 0.0, float 1.0 >
  store <4 x float> %tmp2, <4 x float> *%a
  ret void
}
llvm-svn: 24616 
							
						 
						
							2005-12-06 06:18:55 +00:00  
				
					
						
							
							
								 
						
							
								f9b27d7011 
								
							 
						 
						
							
							
								
								bah, must generate all results  
							
							... 
							
							
							
							llvm-svn: 24574 
							
						 
						
							2005-12-02 06:08:08 +00:00  
				
					
						
							
							
								 
						
							
								73420b3795 
								
							 
						 
						
							
							
								
								cycle counter fix  
							
							... 
							
							
							
							llvm-svn: 24573 
							
						 
						
							2005-12-02 04:56:24 +00:00  
				
					
						
							
							
								 
						
							
								05b0b4575b 
								
							 
						 
						
							
							
								
								Promote line and column number information for our friendly 64-bit targets.  
							
							... 
							
							
							
							llvm-svn: 24568 
							
						 
						
							2005-12-01 18:21:35 +00:00  
				
					
						
							
							
								 
						
							
								6ee8566cae 
								
							 
						 
						
							
							
								
								At long last, you can say that f32 isn't supported for setcc  
							
							... 
							
							
							
							llvm-svn: 24537 
							
						 
						
							2005-11-30 17:12:26 +00:00  
				
					
						
							
							
								 
						
							
								8d17c70171 
								
							 
						 
						
							
							
								
								add support for custom lowering SINT_TO_FP  
							
							... 
							
							
							
							llvm-svn: 24531 
							
						 
						
							2005-11-30 06:43:03 +00:00  
				
					
						
							
							
								 
						
							
								435b402e1f 
								
							 
						 
						
							
							
								
								Add support for a new STRING and LOCATION node for line number support, patch  
							
							... 
							
							
							
							contributed by Daniel Berlin, with a few cleanups here and there by me.
llvm-svn: 24515 
							
						 
						
							2005-11-29 06:21:05 +00:00  
				
					
						
							
							
								 
						
							
								89b049af90 
								
							 
						 
						
							
							
								
								Add the majority of the vector machien value types we expect to support,  
							
							... 
							
							
							
							and make a few changes to the legalization machinery to support more than
16 types.
llvm-svn: 24511 
							
						 
						
							2005-11-29 05:45:29 +00:00  
				
					
						
							
							
								 
						
							
								d37c13154a 
								
							 
						 
						
							
							
								
								Check in code to scalarize arbitrarily wide packed types for some simple  
							
							... 
							
							
							
							vector operations (load, add, sub, mul).
This allows us to codegen:
void %foo(<4 x float> * %a) {
entry:
  %tmp1 = load <4 x float> * %a;
  %tmp2 = add <4 x float> %tmp1, %tmp1
  store <4 x float> %tmp2, <4 x float> *%a
  ret void
}
on ppc as:
_foo:
        lfs f0, 12(r3)
        lfs f1, 8(r3)
        lfs f2, 4(r3)
        lfs f3, 0(r3)
        fadds f0, f0, f0
        fadds f1, f1, f1
        fadds f2, f2, f2
        fadds f3, f3, f3
        stfs f0, 12(r3)
        stfs f1, 8(r3)
        stfs f2, 4(r3)
        stfs f3, 0(r3)
        blr
llvm-svn: 24484 
							
						 
						
							2005-11-22 18:16:00 +00:00  
				
					
						
							
							
								 
						
							
								07890bbec4 
								
							 
						 
						
							
							
								
								Rather than attempting to legalize 1 x float, make sure the SD ISel never  
							
							... 
							
							
							
							generates it.  Make MVT::Vector expand-only, and remove the code in
Legalize that attempts to legalize it.
The plan for supporting N x Type is to continually epxand it in ExpandOp
until it gets down to 2 x Type, where it will be scalarized into a pair of
scalars.
llvm-svn: 24482 
							
						 
						
							2005-11-22 01:29:36 +00:00  
				
					
						
							
							
								 
						
							
								44c28c22b7 
								
							 
						 
						
							
							
								
								Legalize MERGE_VALUES, expand READCYCLECOUNTER correctly, so it doesn't  
							
							... 
							
							
							
							break control dependence.
llvm-svn: 24437 
							
						 
						
							2005-11-20 22:56:56 +00:00  
				
					
						
							
							
								 
						
							
								627cbd49b1 
								
							 
						 
						
							
							
								
								The first patch of X86 support for read cycle counter  
							
							... 
							
							
							
							llvm-svn: 24429 
							
						 
						
							2005-11-20 21:32:07 +00:00  
				
					
						
							
							
								 
						
							
								301015a703 
								
							 
						 
						
							
							
								
								Silence a bogus warning  
							
							... 
							
							
							
							llvm-svn: 24420 
							
						 
						
							2005-11-19 05:51:46 +00:00  
				
					
						
							
							
								 
						
							
								b2e089c31b 
								
							 
						 
						
							
							
								
								Teach LLVM how to scalarize packed types.  Currently, this only works on  
							
							... 
							
							
							
							packed types with an element count of 1, although more generic support is
coming.  This allows LLVM to turn the following code:
void %foo(<1 x float> * %a) {
entry:
  %tmp1 = load <1 x float> * %a;
  %tmp2 = add <1 x float> %tmp1, %tmp1
  store <1 x float> %tmp2, <1 x float> *%a
  ret void
}
Into:
_foo:
        lfs f0, 0(r3)
        fadds f0, f0, f0
        stfs f0, 0(r3)
        blr
llvm-svn: 24416 
							
						 
						
							2005-11-19 00:36:38 +00:00  
				
					
						
							
							
								 
						
							
								45ca1c0194 
								
							 
						 
						
							
							
								
								Allow targets to custom legalize leaf nodes like GlobalAddress.  
							
							... 
							
							
							
							llvm-svn: 24387 
							
						 
						
							2005-11-17 06:41:44 +00:00  
				
					
						
							
							
								 
						
							
								4ff65ec745 
								
							 
						 
						
							
							
								
								Teach legalize about targetglobaladdress  
							
							... 
							
							
							
							llvm-svn: 24385 
							
						 
						
							2005-11-17 05:52:24 +00:00  
				
					
						
							
							
								 
						
							
								01aa56397d 
								
							 
						 
						
							
							
								
								continued readcyclecounter support  
							
							... 
							
							
							
							llvm-svn: 24300 
							
						 
						
							2005-11-11 16:47:30 +00:00  
				
					
						
							
							
								 
						
							
								bf4f233214 
								
							 
						 
						
							
							
								
								Switch the allnodes list from a vector of pointers to an ilist of nodes.This eliminates the vector, allows constant time removal of a node froma graph, and makes iteration over the all nodes list stable when adding  
							
							... 
							
							
							
							nodes to the graph.
llvm-svn: 24263 
							
						 
						
							2005-11-09 23:47:37 +00:00  
				
					
						
							
							
								 
						
							
								af3aefa10e 
								
							 
						 
						
							
							
								
								Handle the trivial (but common) two-op case more efficiently  
							
							... 
							
							
							
							llvm-svn: 24259 
							
						 
						
							2005-11-09 18:48:57 +00:00  
				
					
						
							
							
								 
						
							
								c4d6050db6 
								
							 
						 
						
							
							
								
								Allocate the right amount of memory for this vector up front.  
							
							... 
							
							
							
							llvm-svn: 24252 
							
						 
						
							2005-11-08 23:32:44 +00:00  
				
					
						
							
							
								 
						
							
								d8f2a1a0f3 
								
							 
						 
						
							
							
								
								Allow custom lowered FP_TO_SINT ops in the check for whether a larger  
							
							... 
							
							
							
							FP_TO_SINT is preferred to a larger FP_TO_UINT.  This seems to be begging
for a TLI.isOperationCustom() helper function.
llvm-svn: 23992 
							
						 
						
							2005-10-25 23:47:25 +00:00  
				
					
						
							
							
								 
						
							
								5172ce641e 
								
							 
						 
						
							
							
								
								Teach Legalize how to do something with EXTRACT_ELEMENT when the type of  
							
							... 
							
							
							
							the pair of elements is a legal type.
llvm-svn: 23804 
							
						 
						
							2005-10-19 00:06:56 +00:00  
				
					
						
							
							
								 
						
							
								bd5f41a6a6 
								
							 
						 
						
							
							
								
								Legalize BUILD_PAIR appropriately for upcoming 64 bit PowerPC work.  
							
							... 
							
							
							
							llvm-svn: 23776 
							
						 
						
							2005-10-18 00:27:41 +00:00  
				
					
						
							
							
								 
						
							
								b986f471be 
								
							 
						 
						
							
							
								
								Use getExtLoad here instead of getNode, as extloads produce two values.  This  
							
							... 
							
							
							
							fixes a legalize failure on SPASS for itanium.
llvm-svn: 23747 
							
						 
						
							2005-10-15 20:24:07 +00:00  
				
					
						
							
							
								 
						
							
								d59e5a7abb 
								
							 
						 
						
							
							
								
								Relax the checking on zextload generation a bit, since as sabre pointed out  
							
							... 
							
							
							
							you could be AND'ing with the result of a shift that shifts out all the
bits you care about, in addition to a constant.
Also, move over an add/sub_parts fold from legalize to the dag combiner,
where it works for things other than constants.  Woot!
llvm-svn: 23720 
							
						 
						
							2005-10-14 01:12:21 +00:00  
				
					
						
							
							
								 
						
							
								258521d7ea 
								
							 
						 
						
							
							
								
								When ExpandOp'ing a [SZ]EXTLOAD, make sure to remember that the chain  
							
							... 
							
							
							
							is also legal.  Add support for ExpandOp'ing raw EXTLOADs too.
llvm-svn: 23716 
							
						 
						
							2005-10-13 21:44:47 +00:00  
				
					
						
							
							
								 
						
							
								d23f4b7411 
								
							 
						 
						
							
							
								
								Implement PromoteOp for *EXTLOAD, allowing MallocBench/gs to Legalize  
							
							... 
							
							
							
							llvm-svn: 23715 
							
						 
						
							2005-10-13 20:07:41 +00:00  
				
					
						
							
							
								 
						
							
								c3a89c5259 
								
							 
						 
						
							
							
								
								Add support to Legalize for expanding i64 sextload/zextload into hi and lo  
							
							... 
							
							
							
							parts. This should fix the crafty and signed long long unit test failure
on x86 last night.
llvm-svn: 23711 
							
						 
						
							2005-10-13 17:15:37 +00:00  
				
					
						
							
							
								 
						
							
								02b23c6065 
								
							 
						 
						
							
							
								
								Move some Legalize functionality over to the DAGCombiner where it belongs.  
							
							... 
							
							
							
							Kill some dead code.
llvm-svn: 23706 
							
						 
						
							2005-10-13 03:11:28 +00:00  
				
					
						
							
							
								 
						
							
								7bf8d06f02 
								
							 
						 
						
							
							
								
								silence a bogus GCC warning  
							
							... 
							
							
							
							llvm-svn: 23646 
							
						 
						
							2005-10-06 17:39:10 +00:00  
				
					
						
							
							
								 
						
							
								4bbbb9eed7 
								
							 
						 
						
							
							
								
								Make the legalizer completely non-recursive  
							
							... 
							
							
							
							llvm-svn: 23642 
							
						 
						
							2005-10-06 01:20:27 +00:00  
				
					
						
							
							
								 
						
							
								f8221c5e2c 
								
							 
						 
						
							
							
								
								Remove some bad code from Legalize  
							
							... 
							
							
							
							llvm-svn: 23640 
							
						 
						
							2005-10-05 21:44:10 +00:00  
				
					
						
							
							
								 
						
							
								5da6908d65 
								
							 
						 
						
							
							
								
								Fix some faulty logic in the libcall inserter.  
							
							... 
							
							
							
							Since calls return more than one value, don't bail if one of their uses
happens to be a node that's not an MVT::Other when following the chain
from CALLSEQ_START to CALLSEQ_END.
Once we've found a CALLSEQ_START, we can just return; there's no need to
tail-recurse further up the graph.
Most importantly, just because something only has one use doesn't mean we
should use it's one use to follow from start to end.  This faulty logic
caused us to follow a chain of one-use FP operations back to a much earlier
call, putting a cycle in the graph from a later start to an earlier end.
This is a better fix that reverting to the workaround committed earlier
today.
llvm-svn: 23620 
							
						 
						
							2005-10-04 02:10:55 +00:00  
				
					
						
							
							
								 
						
							
								54fb5002e5 
								
							 
						 
						
							
							
								
								Add back a workaround that fixes some breakages from chris's last change.  
							
							... 
							
							
							
							Neither of us have yet figured out why this code is necessary, but stuff
breaks if its not there.  Still tracking this down...
llvm-svn: 23617 
							
						 
						
							2005-10-04 00:37:37 +00:00  
				
					
						
							
							
								 
						
							
								9cfccfb517 
								
							 
						 
						
							
							
								
								Fix a problem where the legalizer would run out of stack space on extremely  
							
							... 
							
							
							
							large basic blocks because it was purely recursive.  This switches it to an
iterative/recursive hybrid.
llvm-svn: 23596 
							
						 
						
							2005-10-02 17:49:46 +00:00  
				
					
						
							
							
								 
						
							
								5b2be1f890 
								
							 
						 
						
							
							
								
								Fix two bugs in my patch earlier today that broke int->fp conversion on X86.  
							
							... 
							
							
							
							llvm-svn: 23522 
							
						 
						
							2005-09-29 06:44:39 +00:00  
				
					
						
							
							
								 
						
							
								6f3b577ee6 
								
							 
						 
						
							
							
								
								Add FP versions of the binary operators, keeping the int and fp worlds seperate.  
							
							... 
							
							
							
							Though I have done extensive testing, it is possible that this will break
things in configs I can't test.  Please let me know if this causes a problem
and I'll fix it ASAP.
llvm-svn: 23504 
							
						 
						
							2005-09-28 22:28:18 +00:00  
				
					
						
							
							
								 
						
							
								2d454bf5be 
								
							 
						 
						
							
							
								
								Allow targets to say they don't support truncstore i1 (which includes a mask  
							
							... 
							
							
							
							when storing to an 8-bit memory location), as most don't.
llvm-svn: 23303 
							
						 
						
							2005-09-10 00:20:18 +00:00  
				
					
						
							
							
								 
						
							
								1a570f1fe4 
								
							 
						 
						
							
							
								
								Clean up some code from the last checkin  
							
							... 
							
							
							
							llvm-svn: 23229 
							
						 
						
							2005-09-02 20:32:45 +00:00  
				
					
						
							
							
								 
						
							
								630226697f 
								
							 
						 
						
							
							
								
								Fix a bug in legalize where it would emit two calls to libcalls that return  
							
							... 
							
							
							
							i64 values on targets that need that expanded to 32-bit registers.  This fixes
PowerPC/2005-09-02-LegalizeDuplicatesCalls.ll and speeds up 189.lucas from
taking 122.72s to 81.96s on my desktop.
llvm-svn: 23228 
							
						 
						
							2005-09-02 20:26:58 +00:00  
				
					
						
							
							
								 
						
							
								d9af1aab51 
								
							 
						 
						
							
							
								
								Make sure to legalize assert[zs]ext's operand correctly  
							
							... 
							
							
							
							llvm-svn: 23208 
							
						 
						
							2005-09-02 01:15:01 +00:00  
				
					
						
							
							
								 
						
							
								7753f175e6 
								
							 
						 
						
							
							
								
								legalize ANY_EXTEND appropriately  
							
							... 
							
							
							
							llvm-svn: 23204 
							
						 
						
							2005-09-02 00:18:10 +00:00  
				
					
						
							
							
								 
						
							
								8a1a5f2818 
								
							 
						 
						
							
							
								
								Allow targets to custom expand shifts that are too large for their registers  
							
							... 
							
							
							
							llvm-svn: 23173 
							
						 
						
							2005-08-31 19:01:53 +00:00  
				
					
						
							
							
								 
						
							
								61d21b1f3c 
								
							 
						 
						
							
							
								
								Fix FreeBench/fourinarow with the dag isel, by not adding a bogus result  
							
							... 
							
							
							
							to SHIFT_PARTS nodes
llvm-svn: 23151 
							
						 
						
							2005-08-30 17:21:17 +00:00  
				
					
						
							
							
								 
						
							
								9a4ad487f0 
								
							 
						 
						
							
							
								
								Fix a miscompile of PtrDist/bc.  Sign extending bools is not the right thing,  
							
							... 
							
							
							
							at least tends to expose problems elsewhere.
llvm-svn: 23149 
							
						 
						
							2005-08-30 16:56:19 +00:00  
				
					
						
							
							
								 
						
							
								43144a2fe0 
								
							 
						 
						
							
							
								
								Add support for AssertSext and AssertZext, folding other extensions with  
							
							... 
							
							
							
							them.  This allows for elminination of redundant extends in the entry
blocks of functions on PowerPC.
Add support for i32 x i32 -> i64 multiplies, by recognizing when the inputs
to ISD::MUL in ExpandOp are actually just extended i32 values and not real
i64 values.  this allows us to codegen
int mulhs(int a, int b) { return ((long long)a * b) >> 32; }
as:
_mulhs:
        mulhw r3, r4, r3
        blr
instead of:
_mulhs:
        mulhwu r2, r4, r3
        srawi r5, r3, 31
        mullw r5, r4, r5
        add r2, r2, r5
        srawi r4, r4, 31
        mullw r3, r4, r3
        add r3, r2, r3
        blr
with a similar improvement on x86.
llvm-svn: 23147 
							
						 
						
							2005-08-30 02:44:00 +00:00  
				
					
						
							
							
								 
						
							
								835cbb364d 
								
							 
						 
						
							
							
								
								Some of us cared about the the promote path  
							
							... 
							
							
							
							llvm-svn: 23130 
							
						 
						
							2005-08-29 20:46:51 +00:00  
				
					
						
							
							
								 
						
							
								dcde1b2b6a 
								
							 
						 
						
							
							
								
								Fix an infinite loop on x86  
							
							... 
							
							
							
							llvm-svn: 23129 
							
						 
						
							2005-08-29 17:30:00 +00:00  
				
					
						
							
							
								 
						
							
								56ca46ee04 
								
							 
						 
						
							
							
								
								Nate noticed that Andrew never did this.  This fixes PR600  
							
							... 
							
							
							
							llvm-svn: 23110 
							
						 
						
							2005-08-26 22:50:40 +00:00  
				
					
						
							
							
								 
						
							
								c30405e0ee 
								
							 
						 
						
							
							
								
								Change ConstantPoolSDNode to actually hold the Constant itself instead of  
							
							... 
							
							
							
							putting it into the constant pool.  This allows the isel machinery to
create constants that it will end up deciding are not needed, without them
ending up in the resultant function constant pool.
llvm-svn: 23081 
							
						 
						
							2005-08-26 17:15:30 +00:00  
				
					
						
							
							
								 
						
							
								c6d481db7a 
								
							 
						 
						
							
							
								
								the 5th operand is the 4th number  
							
							... 
							
							
							
							llvm-svn: 23074 
							
						 
						
							2005-08-26 00:43:46 +00:00  
				
					
						
							
							
								 
						
							
								5f573416cd 
								
							 
						 
						
							
							
								
								Add support for targets that want to custom expand select_cc in some cases.  
							
							... 
							
							
							
							llvm-svn: 23071 
							
						 
						
							2005-08-26 00:23:59 +00:00  
				
					
						
							
							
								 
						
							
								dff50cadaa 
								
							 
						 
						
							
							
								
								Allow LowerOperation to return a null SDOperand in case it wants to lower  
							
							... 
							
							
							
							some things given to it, but not all.
llvm-svn: 23070 
							
						 
						
							2005-08-26 00:14:16 +00:00  
				
					
						
							
							
								 
						
							
								f12eb4d676 
								
							 
						 
						
							
							
								
								Start using isOperationLegal and isTypeLegal to simplify the code  
							
							... 
							
							
							
							llvm-svn: 23012 
							
						 
						
							2005-08-24 16:35:28 +00:00  
				
					
						
							
							
								 
						
							
								987121a61a 
								
							 
						 
						
							
							
								
								Teach Legalize how to turn setcc into select_cc  
							
							... 
							
							
							
							llvm-svn: 22977 
							
						 
						
							2005-08-23 04:29:48 +00:00  
				
					
						
							
							
								 
						
							
								539c3fa863 
								
							 
						 
						
							
							
								
								When legalizing brcond ->brcc or select -> selectcc, make sure to truncate  
							
							... 
							
							
							
							the old condition to a one bit value.  The incoming value must have been
promoted, and the top bits are undefined.  This causes us to generate:
_test:
        rlwinm r2, r3, 0, 31, 31
        li r3, 17
        cmpwi cr0, r2, 0
        bne .LBB_test_2 ;
.LBB_test_1:    ;
        li r3, 1
.LBB_test_2:    ;
        blr
instead of:
_test:
        rlwinm r2, r3, 0, 31, 31
        li r2, 17
        cmpwi cr0, r3, 0
        bne .LBB_test_2 ;
.LBB_test_1:    ;
        li r2, 1
.LBB_test_2:    ;
        or r3, r2, r2
        blr
for:
int %test(bool %c) {
        %retval = select bool %c, int 17, int 1
        ret int %retval
}
llvm-svn: 22947 
							
						 
						
							2005-08-21 18:03:09 +00:00  
				
					
						
							
							
								 
						
							
								b74c666186 
								
							 
						 
						
							
							
								
								Culling out use of unions for converting FP to bits and vice versa.  
							
							... 
							
							
							
							llvm-svn: 22838 
							
						 
						
							2005-08-17 19:34:49 +00:00  
				
					
						
							
							
								 
						
							
								686d6a1cb2 
								
							 
						 
						
							
							
								
								Switched to using BitsToDouble for int_to_float to avoid aliasing problem.  
							
							... 
							
							
							
							llvm-svn: 22831 
							
						 
						
							2005-08-17 17:42:52 +00:00  
				
					
						
							
							
								 
						
							
								898ba557d0 
								
							 
						 
						
							
							
								
								Change hex float constants for the sake of VC++.  
							
							... 
							
							
							
							llvm-svn: 22828 
							
						 
						
							2005-08-17 09:44:59 +00:00  
				
					
						
							
							
								 
						
							
								f2516a9180 
								
							 
						 
						
							
							
								
								Added generic code expansion for [signed|unsigned] i32 to [f32|f64] casts in the  
							
							... 
							
							
							
							legalizer.  PowerPC now uses this expansion instead of ISel version.
Example:
// signed integer to double conversion
double f1(signed x) {
  return (double)x;
}
// unsigned integer to double conversion
double f2(unsigned x) {
  return (double)x;
}
// signed integer to float conversion
float f3(signed x) {
  return (float)x;
}
// unsigned integer to float conversion
float f4(unsigned x) {
  return (float)x;
}
Byte Code:
internal fastcc double %_Z2f1i(int %x) {
entry:
        %tmp.1 = cast int %x to double          ; <double> [#uses=1]
        ret double %tmp.1
}
internal fastcc double %_Z2f2j(uint %x) {
entry:
        %tmp.1 = cast uint %x to double         ; <double> [#uses=1]
        ret double %tmp.1
}
internal fastcc float %_Z2f3i(int %x) {
entry:
        %tmp.1 = cast int %x to float           ; <float> [#uses=1]
        ret float %tmp.1
}
internal fastcc float %_Z2f4j(uint %x) {
entry:
        %tmp.1 = cast uint %x to float          ; <float> [#uses=1]
        ret float %tmp.1
}
internal fastcc double %_Z2g1i(int %x) {
entry:
        %buffer = alloca [2 x uint]             ; <[2 x uint]*> [#uses=3]
        %tmp.0 = getelementptr [2 x uint]* %buffer, int 0, int 0                ; <uint*> [#uses=1]
        store uint 1127219200, uint* %tmp.0
        %tmp.2 = cast int %x to uint            ; <uint> [#uses=1]
        %tmp.3 = xor uint %tmp.2, 2147483648            ; <uint> [#uses=1]
        %tmp.5 = getelementptr [2 x uint]* %buffer, int 0, int 1                ; <uint*> [#uses=1]
        store uint %tmp.3, uint* %tmp.5
        %tmp.9 = cast [2 x uint]* %buffer to double*            ; <double*> [#uses=1]
        %tmp.10 = load double* %tmp.9           ; <double> [#uses=1]
        %tmp.13 = load double* cast (long* %signed_bias to double*)             ; <double> [#uses=1]
        %tmp.14 = sub double %tmp.10, %tmp.13           ; <double> [#uses=1]
        ret double %tmp.14
}
internal fastcc double %_Z2g2j(uint %x) {
entry:
        %buffer = alloca [2 x uint]             ; <[2 x uint]*> [#uses=3]
        %tmp.0 = getelementptr [2 x uint]* %buffer, int 0, int 0                ; <uint*> [#uses=1]
        store uint 1127219200, uint* %tmp.0
        %tmp.1 = getelementptr [2 x uint]* %buffer, int 0, int 1                ; <uint*> [#uses=1]
        store uint %x, uint* %tmp.1
        %tmp.4 = cast [2 x uint]* %buffer to double*            ; <double*> [#uses=1]
        %tmp.5 = load double* %tmp.4            ; <double> [#uses=1]
        %tmp.8 = load double* cast (long* %unsigned_bias to double*)            ; <double> [#uses=1]
        %tmp.9 = sub double %tmp.5, %tmp.8              ; <double> [#uses=1]
        ret double %tmp.9
}
internal fastcc float %_Z2g3i(int %x) {
entry:
        %buffer = alloca [2 x uint]             ; <[2 x uint]*> [#uses=3]
        %tmp.0 = getelementptr [2 x uint]* %buffer, int 0, int 0                ; <uint*> [#uses=1]
        store uint 1127219200, uint* %tmp.0
        %tmp.2 = cast int %x to uint            ; <uint> [#uses=1]
        %tmp.3 = xor uint %tmp.2, 2147483648            ; <uint> [#uses=1]
        %tmp.5 = getelementptr [2 x uint]* %buffer, int 0, int 1                ; <uint*> [#uses=1]
        store uint %tmp.3, uint* %tmp.5
        %tmp.9 = cast [2 x uint]* %buffer to double*            ; <double*> [#uses=1]
        %tmp.10 = load double* %tmp.9           ; <double> [#uses=1]
        %tmp.13 = load double* cast (long* %signed_bias to double*)             ; <double> [#uses=1]
        %tmp.14 = sub double %tmp.10, %tmp.13           ; <double> [#uses=1]
        %tmp.16 = cast double %tmp.14 to float          ; <float> [#uses=1]
        ret float %tmp.16
}
internal fastcc float %_Z2g4j(uint %x) {
entry:
        %buffer = alloca [2 x uint]             ; <[2 x uint]*> [#uses=3]
        %tmp.0 = getelementptr [2 x uint]* %buffer, int 0, int 0                ; <uint*> [#uses=1]
        store uint 1127219200, uint* %tmp.0
        %tmp.1 = getelementptr [2 x uint]* %buffer, int 0, int 1                ; <uint*> [#uses=1]
        store uint %x, uint* %tmp.1
        %tmp.4 = cast [2 x uint]* %buffer to double*            ; <double*> [#uses=1]
        %tmp.5 = load double* %tmp.4            ; <double> [#uses=1]
        %tmp.8 = load double* cast (long* %unsigned_bias to double*)            ; <double> [#uses=1]
        %tmp.9 = sub double %tmp.5, %tmp.8              ; <double> [#uses=1]
        %tmp.11 = cast double %tmp.9 to float           ; <float> [#uses=1]
        ret float %tmp.11
}
PowerPC Code:
        .machine ppc970
        .const
        .align  2
.CPIl1__Z2f1i_0:                                        ; float 0x4330000080000000
        .long   1501560836      ; float 4.5036e+15
        .text
        .align  2
        .globl  l1__Z2f1i
l1__Z2f1i:
.LBBl1__Z2f1i_0:        ; entry
        xoris r2, r3, 32768
        stw r2, -4(r1)
        lis r2, 17200
        stw r2, -8(r1)
        lfd f0, -8(r1)
        lis r2, ha16(.CPIl1__Z2f1i_0)
        lfs f1, lo16(.CPIl1__Z2f1i_0)(r2)
        fsub f1, f0, f1
        blr
        .const
        .align  2
.CPIl2__Z2f2j_0:                                        ; float 0x4330000000000000
        .long   1501560832      ; float 4.5036e+15
        .text
        .align  2
        .globl  l2__Z2f2j
l2__Z2f2j:
.LBBl2__Z2f2j_0:        ; entry
        stw r3, -4(r1)
        lis r2, 17200
        stw r2, -8(r1)
        lfd f0, -8(r1)
        lis r2, ha16(.CPIl2__Z2f2j_0)
        lfs f1, lo16(.CPIl2__Z2f2j_0)(r2)
        fsub f1, f0, f1
        blr
        .const
        .align  2
.CPIl3__Z2f3i_0:                                        ; float 0x4330000080000000
        .long   1501560836      ; float 4.5036e+15
        .text
        .align  2
        .globl  l3__Z2f3i
l3__Z2f3i:
.LBBl3__Z2f3i_0:        ; entry
        xoris r2, r3, 32768
        stw r2, -4(r1)
        lis r2, 17200
        stw r2, -8(r1)
        lfd f0, -8(r1)
        lis r2, ha16(.CPIl3__Z2f3i_0)
        lfs f1, lo16(.CPIl3__Z2f3i_0)(r2)
        fsub f0, f0, f1
        frsp f1, f0
        blr
        .const
        .align  2
.CPIl4__Z2f4j_0:                                        ; float 0x4330000000000000
        .long   1501560832      ; float 4.5036e+15
        .text
        .align  2
        .globl  l4__Z2f4j
l4__Z2f4j:
.LBBl4__Z2f4j_0:        ; entry
        stw r3, -4(r1)
        lis r2, 17200
        stw r2, -8(r1)
        lfd f0, -8(r1)
        lis r2, ha16(.CPIl4__Z2f4j_0)
        lfs f1, lo16(.CPIl4__Z2f4j_0)(r2)
        fsub f0, f0, f1
        frsp f1, f0
        blr
llvm-svn: 22814 
							
						 
						
							2005-08-17 00:39:29 +00:00  
				
					
						
							
							
								 
						
							
								33182325f5 
								
							 
						 
						
							
							
								
								Eliminate the RegSDNode class, which 3 nodes (CopyFromReg/CopyToReg/ImplicitDef)  
							
							... 
							
							
							
							used to tack a register number onto the node.
Instead of doing this, make a new node, RegisterSDNode, which is a leaf
containing a register number.  These three operations just become normal
DAG nodes now, instead of requiring special handling.
Note that with this change, it is no longer correct to make illegal
CopyFromReg/CopyToReg nodes.  The legalizer will not touch them, and this
is bad, so don't do it. :)
llvm-svn: 22806 
							
						 
						
							2005-08-16 21:55:35 +00:00  
				
					
						
							
							
								 
						
							
								371e49515d 
								
							 
						 
						
							
							
								
								Implement BR_CC and BRTWOWAY_CC.  This allows the removal of a rather nasty  
							
							... 
							
							
							
							fixme from the PowerPC backend.  Emit slightly better code for legalizing
select_cc.
llvm-svn: 22805 
							
						 
						
							2005-08-16 19:49:35 +00:00  
				
					
						
							
							
								 
						
							
								1973278b38 
								
							 
						 
						
							
							
								
								Add some methods for dag->dag isel.  
							
							... 
							
							
							
							Split RemoveNodeFromCSEMaps out of DeleteNodesIfDead to do it.
llvm-svn: 22801 
							
						 
						
							2005-08-16 18:17:10 +00:00  
				
					
						
							
							
								 
						
							
								d5e739dcc2 
								
							 
						 
						
							
							
								
								Fix last night's PPC32 regressions by  
							
							... 
							
							
							
							1. Not selecting the false value of a select_cc in the false arm, which
   isn't legal for nested selects.
2. Actually returning the node we created and Legalized in the FP_TO_UINT
   Expander.
llvm-svn: 22789 
							
						 
						
							2005-08-14 18:38:32 +00:00  
				
					
						
							
							
								 
						
							
								36853ee1fd 
								
							 
						 
						
							
							
								
								Teach the legalizer how to legalize FP_TO_UINT.  
							
							... 
							
							
							
							Teach the legalizer to promote FP_TO_UINT to FP_TO_SINT if the wider
  FP_TO_UINT is also illegal.  This allows us on PPC to codegen
  unsigned short foo(float a) { return a; }
as:
_foo:
.LBB_foo_0:     ; entry
        fctiwz f0, f1
        stfd f0, -8(r1)
        lwz r2, -4(r1)
        rlwinm r3, r2, 0, 16, 31
        blr
instead of:
_foo:
.LBB_foo_0:     ; entry
        fctiwz f0, f1
        stfd f0, -8(r1)
        lwz r2, -4(r1)
        lis r3, ha16(.CPI_foo_0)
        lfs f0, lo16(.CPI_foo_0)(r3)
        fcmpu cr0, f1, f0
        blt .LBB_foo_2  ; entry
.LBB_foo_1:     ; entry
        fsubs f0, f1, f0
        fctiwz f0, f0
        stfd f0, -16(r1)
        lwz r2, -12(r1)
        xoris r2, r2, 32768
.LBB_foo_2:     ; entry
        rlwinm r3, r2, 0, 16, 31
        blr
llvm-svn: 22785 
							
						 
						
							2005-08-14 01:20:53 +00:00  
				
					
						
							
							
								 
						
							
								180b08897f 
								
							 
						 
						
							
							
								
								Some SELECT_CC cleanups:  
							
							... 
							
							
							
							1. move assertions for node creation to getNode()
2. legalize the values returned in ExpandOp immediately
3. Move select_cc optimizations from SELECT's getNode() to SELECT_CC's,
   allowing them to be cleaned up significantly.
This paves the way to pick up additional optimizations on SELECT_CC, such
as sum-of-absolute-differences.
llvm-svn: 22757 
							
						 
						
							2005-08-11 01:12:20 +00:00  
				
					
						
							
							
								 
						
							
								e5b86d7442 
								
							 
						 
						
							
							
								
								Add new node, SELECT_CC.  This node is for targets that don't natively  
							
							... 
							
							
							
							implement SELECT.
llvm-svn: 22755 
							
						 
						
							2005-08-10 20:51:12 +00:00  
				
					
						
							
							
								 
						
							
								d47675ed24 
								
							 
						 
						
							
							
								
								Eliminate the SetCCSDNode in favor of a CondCodeSDNode class.  This pulls the  
							
							... 
							
							
							
							CC out of the SetCC operation, making SETCC a standard ternary operation and
CC's a standard DAG leaf.  This will make it possible for other node to use
CC's as operands in the future...
llvm-svn: 22728 
							
						 
						
							2005-08-09 20:20:18 +00:00  
				
					
						
							
							
								 
						
							
								96ad31321a 
								
							 
						 
						
							
							
								
								Change FindEarliestCallSeqEnd (used by libcall insertion) to use a set to  
							
							... 
							
							
							
							avoid revisiting nodes more than once.  This eliminates a source of
potentially exponential behavior.  For a small function in 191.fma3d
(hexah_stress_divergence_), this speeds up isel from taking > 20mins to
taking 0.07s.
llvm-svn: 22680 
							
						 
						
							2005-08-05 18:10:27 +00:00  
				
					
						
							
							
								 
						
							
								cabdc34563 
								
							 
						 
						
							
							
								
								Fix a latent bug in the libcall inserter that was exposed by Nate's patch  
							
							... 
							
							
							
							yesterday.  This fixes whetstone and a bunch of programs in the External tests.
llvm-svn: 22678 
							
						 
						
							2005-08-05 16:23:57 +00:00  
				
					
						
							
							
								 
						
							
								77558da546 
								
							 
						 
						
							
							
								
								Fix a fixme in LegalizeDAG  
							
							... 
							
							
							
							llvm-svn: 22661 
							
						 
						
							2005-08-04 21:43:28 +00:00  
				
					
						
							
							
								 
						
							
								8191442548 
								
							 
						 
						
							
							
								
								Fix PR611, codegen'ing SREM of FP operands to fmod or fmodf instead of  
							
							... 
							
							
							
							the sequence used for integer ops
llvm-svn: 22629 
							
						 
						
							2005-08-03 20:31:37 +00:00  
				
					
						
							
							
								 
						
							
								4398daf069 
								
							 
						 
						
							
							
								
								Fix casts from long to sbyte on ppc  
							
							... 
							
							
							
							llvm-svn: 22570 
							
						 
						
							2005-08-01 18:16:37 +00:00  
				
					
						
							
							
								 
						
							
								546fd5944e 
								
							 
						 
						
							
							
								
								Keep tabs and trailing spaces out.  
							
							... 
							
							
							
							llvm-svn: 22565 
							
						 
						
							2005-07-30 18:33:25 +00:00  
				
					
						
							
							
								 
						
							
								941d84a34d 
								
							 
						 
						
							
							
								
								fix float->long conversions on x86  
							
							... 
							
							
							
							llvm-svn: 22563 
							
						 
						
							2005-07-30 01:40:57 +00:00  
				
					
						
							
							
								 
						
							
								f59b2daddb 
								
							 
						 
						
							
							
								
								Allow targets to have custom expanders for FP_TO_*INT conversions where  
							
							... 
							
							
							
							both the src and dest values are legal
llvm-svn: 22555 
							
						 
						
							2005-07-30 00:04:12 +00:00  
				
					
						
							
							
								 
						
							
								fe68d75aad 
								
							 
						 
						
							
							
								
								Allow targets to define custom expanders for FP_TO_*INT  
							
							... 
							
							
							
							llvm-svn: 22548 
							
						 
						
							2005-07-29 00:33:32 +00:00  
				
					
						
							
							
								 
						
							
								44fe26ff07 
								
							 
						 
						
							
							
								
								allow a target to request that unknown FP_TO_*INT conversion be promoted to  
							
							... 
							
							
							
							a larger integer destination.
llvm-svn: 22547 
							
						 
						
							2005-07-29 00:11:56 +00:00  
				
					
						
							
							
								 
						
							
								f99f8f9081 
								
							 
						 
						
							
							
								
								instead of having all conversions be handled by one case value, and then have  
							
							... 
							
							
							
							subcases inside, break things out earlier.
llvm-svn: 22546 
							
						 
						
							2005-07-28 23:31:12 +00:00  
				
					
						
							
							
								 
						
							
								5f4ef3c5a8 
								
							 
						 
						
							
							
								
								Eliminate all remaining tabs and trailing spaces.  
							
							... 
							
							
							
							llvm-svn: 22523 
							
						 
						
							2005-07-27 06:12:32 +00:00  
				
					
						
							
							
								 
						
							
								b35912e421 
								
							 
						 
						
							
							
								
								The assertion was wrong: the code only worked for i64.  While we're at it,  
							
							... 
							
							
							
							expand the code to work for all integer datatypes.  This should unbreak
alpha.
llvm-svn: 22464 
							
						 
						
							2005-07-18 04:31:14 +00:00  
				
					
						
							
							
								 
						
							
								7e74c834c1 
								
							 
						 
						
							
							
								
								Teach the legalizer how to promote SINT_TO_FP to a wider SINT_TO_FP that  
							
							... 
							
							
							
							the target natively supports.  This eliminates some special-case code from
the x86 backend and generates better code as well.
For an i8 to f64 conversion, before & after:
_x87 before:
        subl $2, %esp
        movb 6(%esp), %al
        movsbw %al, %ax
        movw %ax, (%esp)
        filds (%esp)
        addl $2, %esp
        ret
_x87 after:
        subl $2, %esp
        movsbw 6(%esp), %ax
        movw %ax, (%esp)
        filds (%esp)
        addl $2, %esp
        ret
_sse before:
        subl $12, %esp
        movb 16(%esp), %al
        movsbl %al, %eax
        cvtsi2sd %eax, %xmm0
        addl $12, %esp
        ret
_sse after:
        subl $12, %esp
        movsbl 16(%esp), %eax
        cvtsi2sd %eax, %xmm0
        addl $12, %esp
        ret
llvm-svn: 22452 
							
						 
						
							2005-07-16 02:02:34 +00:00  
				
					
						
							
							
								 
						
							
								e3e847bfd7 
								
							 
						 
						
							
							
								
								Break the code for expanding UINT_TO_FP operations out into its own  
							
							... 
							
							
							
							SelectionDAGLegalize::ExpandLegalUINT_TO_FP method.
Add a new method, PromoteLegalUINT_TO_FP, which allows targets to request
that UINT_TO_FP operations be promoted to a larger input type.  This is
useful for targets that have some UINT_TO_FP or SINT_TO_FP operations but
not all of them (like X86).
The same should be done with SINT_TO_FP, but this patch does not do that
yet.
llvm-svn: 22447 
							
						 
						
							2005-07-16 00:19:57 +00:00  
				
					
						
							
							
								 
						
							
								f9ddfef872 
								
							 
						 
						
							
							
								
								Fix Alpha/2005-07-12-TwoMallocCalls.ll and PR593.  
							
							... 
							
							
							
							It is not safe to call LegalizeOp on something that has already been legalized.
Instead, just force another iteration of legalization.
This could affect all platforms but X86, as this codepath is dynamically
dead on X86 (ISD::MEMSET and friends are legal).
llvm-svn: 22419 
							
						 
						
							2005-07-13 02:00:04 +00:00  
				
					
						
							
							
								 
						
							
								ba08a336f0 
								
							 
						 
						
							
							
								
								Fix test/Regression/CodeGen/Generic/2005-07-12-memcpy-i64-length.ll  
							
							... 
							
							
							
							llvm-svn: 22417 
							
						 
						
							2005-07-13 01:42:45 +00:00  
				
					
						
							
							
								 
						
							
								de0a4b1987 
								
							 
						 
						
							
							
								
								Change *EXTLOAD to use an VTSDNode operand instead of being an MVTSDNode.  
							
							... 
							
							
							
							This is the last MVTSDNode.
This allows us to eliminate a bunch of special case code for handling
MVTSDNodes.
llvm-svn: 22367 
							
						 
						
							2005-07-10 01:55:33 +00:00  
				
					
						
							
							
								 
						
							
								36db1ed06f 
								
							 
						 
						
							
							
								
								Change TRUNCSTORE to use a VTSDNode operand instead of being an MVTSTDNode  
							
							... 
							
							
							
							llvm-svn: 22366 
							
						 
						
							2005-07-10 00:29:18 +00:00  
				
					
						
							
							
								 
						
							
								0b6ba90a72 
								
							 
						 
						
							
							
								
								Introduce a new VTSDNode class with the ultimate goal of eliminating the  
							
							... 
							
							
							
							MVTSDNode class.  This class is used to provide an operand to operators
that require an extra type.  We start by converting FP_ROUND_INREG and
SIGN_EXTEND_INREG over to using it.
llvm-svn: 22364 
							
						 
						
							2005-07-10 00:07:11 +00:00  
				
					
						
							
							
								 
						
							
								80fe411662 
								
							 
						 
						
							
							
								
								2 fixes:  
							
							... 
							
							
							
							1: Legalize operand in UINT_TO_FP expanision
2: SRA x, const i8 was not promoting the constant to shift amount type.
llvm-svn: 22337 
							
						 
						
							2005-07-05 19:52:39 +00:00  
				
					
						
							
							
								 
						
							
								be3a74ca3e 
								
							 
						 
						
							
							
								
								I really didn't think this was necessary.  But, Legalize wasn't running again  
							
							... 
							
							
							
							and legalizing the extload.  Strange.  Should fix most alpha regressions.
llvm-svn: 22329 
							
						 
						
							2005-07-02 20:58:53 +00:00  
				
					
						
							
							
								 
						
							
								0a370f4de5 
								
							 
						 
						
							
							
								
								oops  
							
							... 
							
							
							
							llvm-svn: 22320 
							
						 
						
							2005-06-30 19:32:57 +00:00  
				
					
						
							
							
								 
						
							
								b5597e38f6 
								
							 
						 
						
							
							
								
								FP EXTLOAD is not support on all archs, expand to LOAD and FP_EXTEND  
							
							... 
							
							
							
							llvm-svn: 22319 
							
						 
						
							2005-06-30 19:22:37 +00:00  
				
					
						
							
							
								 
						
							
								d74877a46d 
								
							 
						 
						
							
							
								
								Adapt the code for handling uint -> fp conversion for the 32 bit case to  
							
							... 
							
							
							
							handling it in the 64 bit case.  The two code paths should probably be merged.
llvm-svn: 22302 
							
						 
						
							2005-06-27 23:28:32 +00:00  
				
					
						
							
							
								 
						
							
								3268f244e6 
								
							 
						 
						
							
							
								
								allow token chain at start or end of node  
							
							... 
							
							
							
							llvm-svn: 22020 
							
						 
						
							2005-05-14 08:34:53 +00:00  
				
					
						
							
							
								 
						
							
								865359958b 
								
							 
						 
						
							
							
								
								remove special case hacks for readport/readio from the binary operator  
							
							... 
							
							
							
							codepath
llvm-svn: 22019 
							
						 
						
							2005-05-14 07:45:46 +00:00  
				
					
						
							
							
								 
						
							
								96c262e24b 
								
							 
						 
						
							
							
								
								Eliminate special purpose hacks for dynamic_stack_alloc.  
							
							... 
							
							
							
							llvm-svn: 22015 
							
						 
						
							2005-05-14 07:29:57 +00:00  
				
					
						
							
							
								 
						
							
								669e8c2c9c 
								
							 
						 
						
							
							
								
								Use the general mechanism for creating multi-value nodes instead of using  
							
							... 
							
							
							
							special case hacks.
llvm-svn: 22014 
							
						 
						
							2005-05-14 07:25:05 +00:00  
				
					
						
							
							
								 
						
							
								3eb8693279 
								
							 
						 
						
							
							
								
								legalize target-specific operations  
							
							... 
							
							
							
							llvm-svn: 22010 
							
						 
						
							2005-05-14 06:34:48 +00:00  
				
					
						
							
							
								 
						
							
								29dcc71d83 
								
							 
						 
						
							
							
								
								LowerOperation takes a dag  
							
							... 
							
							
							
							llvm-svn: 22004 
							
						 
						
							2005-05-14 05:50:48 +00:00  
				
					
						
							
							
								 
						
							
								d3cc996a47 
								
							 
						 
						
							
							
								
								Allow targets to have a custom int64->fp expander if desired  
							
							... 
							
							
							
							llvm-svn: 22001 
							
						 
						
							2005-05-14 05:33:54 +00:00  
				
					
						
							
							
								 
						
							
								2e77db6af6 
								
							 
						 
						
							
							
								
								Add an isTailCall flag to LowerCallTo  
							
							... 
							
							
							
							llvm-svn: 21958 
							
						 
						
							2005-05-13 18:50:42 +00:00  
				
					
						
							
							
								 
						
							
								d0feb64443 
								
							 
						 
						
							
							
								
								Handle TAILCALL node  
							
							... 
							
							
							
							llvm-svn: 21957 
							
						 
						
							2005-05-13 18:43:43 +00:00  
				
					
						
							
							
								 
						
							
								bb1d60de9c 
								
							 
						 
						
							
							
								
								Fix a problem that nate reduced for me.  
							
							... 
							
							
							
							llvm-svn: 21923 
							
						 
						
							2005-05-13 05:17:00 +00:00  
				
					
						
							
							
								 
						
							
								5a14c8a18e 
								
							 
						 
						
							
							
								
								rename variables and functions to match renamed DAG nodes.  Bonus feature:  
							
							... 
							
							
							
							I can actually remember which one is which now!
llvm-svn: 21922 
							
						 
						
							2005-05-13 05:09:11 +00:00  
				
					
						
							
							
								 
						
							
								2a4f7312cd 
								
							 
						 
						
							
							
								
								do not call expandop on the same value more than once.  This fixes  
							
							... 
							
							
							
							X86/2004-02-22-Casts.llx
llvm-svn: 21919 
							
						 
						
							2005-05-13 04:45:13 +00:00  
				
					
						
							
							
								 
						
							
								d34cd28aa7 
								
							 
						 
						
							
							
								
								update comment  
							
							... 
							
							
							
							llvm-svn: 21916 
							
						 
						
							2005-05-12 23:24:44 +00:00  
				
					
						
							
							
								 
						
							
								2dce703710 
								
							 
						 
						
							
							
								
								rename the ADJCALLSTACKDOWN/ADJCALLSTACKUP nodes to be CALLSEQ_START/BEGIN.  
							
							... 
							
							
							
							llvm-svn: 21915 
							
						 
						
							2005-05-12 23:24:06 +00:00  
				
					
						
							
							
								 
						
							
								111778e665 
								
							 
						 
						
							
							
								
								Pass calling convention to use into lower call to  
							
							... 
							
							
							
							llvm-svn: 21900 
							
						 
						
							2005-05-12 19:56:57 +00:00  
				
					
						
							
							
								 
						
							
								0bfd177e89 
								
							 
						 
						
							
							
								
								fix expansion of ct[lt]z nodes  
							
							... 
							
							
							
							llvm-svn: 21896 
							
						 
						
							2005-05-12 19:27:51 +00:00  
				
					
						
							
							
								 
						
							
								cf5f6b0ccb 
								
							 
						 
						
							
							
								
								Expand 64-bit ctlz/cttz nodes for 32-bit targets  
							
							... 
							
							
							
							llvm-svn: 21895 
							
						 
						
							2005-05-12 19:05:01 +00:00  
				
					
						
							
							
								 
						
							
								26f0317f46 
								
							 
						 
						
							
							
								
								Fix uint->fp casts on PPC, allowing UnitTests/2005-05-12-Int64ToFP to  
							
							... 
							
							
							
							work on it.
llvm-svn: 21894 
							
						 
						
							2005-05-12 18:52:34 +00:00  
				
					
						
							
							
								 
						
							
								b5a78e0873 
								
							 
						 
						
							
							
								
								Allow something to be legalized multiple times.  This can be used to reduce  
							
							... 
							
							
							
							legalization iteration
llvm-svn: 21892 
							
						 
						
							2005-05-12 16:53:42 +00:00  
				
					
						
							
							
								 
						
							
								153587e555 
								
							 
						 
						
							
							
								
								Oops, don't do this after we figure out where to insert the call chains.  
							
							... 
							
							
							
							llvm-svn: 21890 
							
						 
						
							2005-05-12 07:00:44 +00:00  
				
					
						
							
							
								 
						
							
								8a5ad8468a 
								
							 
						 
						
							
							
								
								Make sure to expand all nodes, avoiding unintentional node duplication.  
							
							... 
							
							
							
							llvm-svn: 21889 
							
						 
						
							2005-05-12 06:54:21 +00:00  
				
					
						
							
							
								 
						
							
								f09c0b435b 
								
							 
						 
						
							
							
								
								add fixme  
							
							... 
							
							
							
							llvm-svn: 21887 
							
						 
						
							2005-05-12 06:04:14 +00:00  
				
					
						
							
							
								 
						
							
								a5bf1030bf 
								
							 
						 
						
							
							
								
								Fix a problem where early legalization can cause token chain problems.  
							
							... 
							
							
							
							llvm-svn: 21885 
							
						 
						
							2005-05-12 04:49:08 +00:00  
				
					
						
							
							
								 
						
							
								8005e91432 
								
							 
						 
						
							
							
								
								Make legalize a bit more efficient, and canonicalize sub X, C -> add X, -C  
							
							... 
							
							
							
							llvm-svn: 21882 
							
						 
						
							2005-05-12 00:17:04 +00:00  
				
					
						
							
							
								 
						
							
								99fa5bc1fa 
								
							 
						 
						
							
							
								
								Necessary changes to codegen cttz efficiently on PowerPC  
							
							... 
							
							
							
							1. Teach LegalizeDAG how to better legalize CTTZ if the target doesn't have
   CTPOP, but does have CTLZ
2. Teach PPC32 how to do sub x, const -> add x, -const for valid consts
3. Teach PPC32 how to do and (xor a, -1) b -> andc b, a
4. Teach PPC32 that ISD::CTLZ -> PPC::CNTLZW
llvm-svn: 21880 
							
						 
						
							2005-05-11 23:43:56 +00:00  
				
					
						
							
							
								 
						
							
								06bbeb646f 
								
							 
						 
						
							
							
								
								Fix the last remaining bug preventing us from switching the X86 BE over  
							
							... 
							
							
							
							from the simple isel to the pattern isel.  This forces inserted libcalls
to serialize against other function calls, which was breaking
UnitTests/2005-05-12-Int64ToFP.  Hopefully this will fix issues on other
targets as well.
llvm-svn: 21872 
							
						 
						
							2005-05-11 19:02:11 +00:00  
				
					
						
							
							
								 
						
							
								56add05671 
								
							 
						 
						
							
							
								
								Make sure to legalize generated ctpop nodes, convert tabs to spaces  
							
							... 
							
							
							
							llvm-svn: 21868 
							
						 
						
							2005-05-11 18:35:21 +00:00  
				
					
						
							
							
								 
						
							
								a1ebbac9c0 
								
							 
						 
						
							
							
								
								expand count-leading/trailing-zeros; the test 2005-05-11-Popcount-ffs-fls.c  
							
							... 
							
							
							
							should now pass (the "LLVM" and "REF" results should be identical)
llvm-svn: 21866 
							
						 
						
							2005-05-11 08:45:08 +00:00  
				
					
						
							
							
								 
						
							
								7247324047 
								
							 
						 
						
							
							
								
								Add some notes for expanding clz/ctz  
							
							... 
							
							
							
							llvm-svn: 21862 
							
						 
						
							2005-05-11 05:27:09 +00:00  
				
					
						
							
							
								 
						
							
								05309bf58e 
								
							 
						 
						
							
							
								
								Simplify this code, use the proper shift amount  
							
							... 
							
							
							
							llvm-svn: 21861 
							
						 
						
							2005-05-11 05:21:31 +00:00  
				
					
						
							
							
								 
						
							
								3740f39883 
								
							 
						 
						
							
							
								
								Legalize this correctly  
							
							... 
							
							
							
							llvm-svn: 21859 
							
						 
						
							2005-05-11 05:09:47 +00:00  
				
					
						
							
							
								 
						
							
								55e9cde37c 
								
							 
						 
						
							
							
								
								implement expansion of ctpop nodes, implementing CodeGen/Generic/llvm-ct-intrinsics.ll  
							
							... 
							
							
							
							llvm-svn: 21856 
							
						 
						
							2005-05-11 04:51:16 +00:00  
				
					
						
							
							
								 
						
							
								ba45e6c432 
								
							 
						 
						
							
							
								
								legalize readio/writeio into a load/store if requested  
							
							... 
							
							
							
							llvm-svn: 21827 
							
						 
						
							2005-05-09 20:36:57 +00:00  
				
					
						
							
							
								 
						
							
								5385db5523 
								
							 
						 
						
							
							
								
								legalize READPORT, WRITEPORT, READIO, WRITEIO, at least in the basic cases  
							
							... 
							
							
							
							where they are directly supported by the architecture.  Wrap a bunch of
long lines :(
llvm-svn: 21826 
							
						 
						
							2005-05-09 20:23:03 +00:00  
				
					
						
							
							
								 
						
							
								2dbbb3ab84 
								
							 
						 
						
							
							
								
								ctpop lowering in legalize  
							
							... 
							
							
							
							llvm-svn: 21697 
							
						 
						
							2005-05-05 15:55:21 +00:00  
				
					
						
							
							
								 
						
							
								dd426dd04d 
								
							 
						 
						
							
							
								
								Make promoteOp work for CT*  
							
							... 
							
							
							
							Proof?
ubyte %bar(ubyte %x) {
entry:
        %tmp.1 = call ubyte %llvm.ctlz( ubyte %x )
        ret ubyte %tmp.1
}
==>
zapnot $16,1,$0
CTLZ $0,$0
subq $0,56,$0
zapnot $0,1,$0
ret $31,($26),1
llvm-svn: 21691 
							
						 
						
							2005-05-04 19:11:05 +00:00  
				
					
						
							
							
								 
						
							
								5e177826fd 
								
							 
						 
						
							
							
								
								Implement count leading zeros (ctlz), count trailing zeros (cttz), and count  
							
							... 
							
							
							
							population (ctpop).  Generic lowering is implemented, however only promotion
is implemented for SelectionDAG at the moment.
More coming soon.
llvm-svn: 21676 
							
						 
						
							2005-05-03 17:19:30 +00:00  
				
					
						
							
							
								 
						
							
								8002640eab 
								
							 
						 
						
							
							
								
								Codegen and legalize sin/cos/llvm.sqrt as FSIN/FCOS/FSQRT calls.  This patch  
							
							... 
							
							
							
							was contributed by Morten Ofstad, with some minor tweaks and bug fixes added
by me.
llvm-svn: 21636 
							
						 
						
							2005-04-30 04:43:14 +00:00  
				
					
						
							
							
								 
						
							
								9d6fa98ec7 
								
							 
						 
						
							
							
								
								Legalize FSQRT, FSIN, FCOS nodes, patch contributed by Morten Ofstad  
							
							... 
							
							
							
							llvm-svn: 21606 
							
						 
						
							2005-04-28 21:44:33 +00:00  
				
					
						
							
							
								 
						
							
								4a73c2cfdc 
								
							 
						 
						
							
							
								
								Implement Value* tracking for loads and stores in the selection DAG.  This enables one to use alias analysis in the backends.  
							
							... 
							
							
							
							(TRUNK)Stores and (EXT|ZEXT|SEXT)Loads have an extra SDOperand which is a SrcValueSDNode which contains the Value*.  Note that if the operation is introduced by the backend, it will still have the operand, but the value* will be null.
llvm-svn: 21599 
							
						 
						
							2005-04-27 20:10:01 +00:00  
				
					
						
							
							
								 
						
							
								835702a094 
								
							 
						 
						
							
							
								
								Remove trailing whitespace  
							
							... 
							
							
							
							llvm-svn: 21420 
							
						 
						
							2005-04-21 22:36:52 +00:00  
				
					
						
							
							
								 
						
							
								e69ad5fd12 
								
							 
						 
						
							
							
								
								Implement expansion of unsigned i64 -> FP.  
							
							... 
							
							
							
							Note that this probably only works for little endian targets, but is enough
to get siod working :)
llvm-svn: 21280 
							
						 
						
							2005-04-13 05:09:42 +00:00  
				
					
						
							
							
								 
						
							
								0efd77eda7 
								
							 
						 
						
							
							
								
								Make expansion of uint->fp cast assert out instead of infinitely recurse.  
							
							... 
							
							
							
							llvm-svn: 21275 
							
						 
						
							2005-04-13 03:42:14 +00:00  
				
					
						
							
							
								 
						
							
								0e852afb4c 
								
							 
						 
						
							
							
								
								Instead of making ZERO_EXTEND_INREG nodes, use the helper method in  
							
							... 
							
							
							
							SelectionDAG to do the job with AND.  Don't legalize Z_E_I anymore as
it is gone
llvm-svn: 21266 
							
						 
						
							2005-04-13 02:38:47 +00:00  
				
					
						
							
							
								 
						
							
								0b73a6d8bc 
								
							 
						 
						
							
							
								
								promote extload i1 -> extload i8  
							
							... 
							
							
							
							llvm-svn: 21258 
							
						 
						
							2005-04-12 20:30:10 +00:00  
				
					
						
							
							
								 
						
							
								aedcabe8db 
								
							 
						 
						
							
							
								
								Emit comparisons against the sign bit better.  Codegen this:  
							
							... 
							
							
							
							bool %test1(long %X) {
        %A = setlt long %X, 0
        ret bool %A
}
like this:
test1:
        cmpl $0, 8(%esp)
        setl %al
        movzbl %al, %eax
        ret
instead of:
test1:
        movl 8(%esp), %ecx
        cmpl $0, %ecx
        setl %al
        movzbw %al, %ax
        cmpl $0, 4(%esp)
        setb %dl
        movzbw %dl, %dx
        cmpl $0, %ecx
        cmove %dx, %ax
        movzbl %al, %eax
        ret
llvm-svn: 21243 
							
						 
						
							2005-04-12 02:19:10 +00:00  
				
					
						
							
							
								 
						
							
								71ff44e46c 
								
							 
						 
						
							
							
								
								Emit long comparison against -1 better.  Instead of this (x86):  
							
							... 
							
							
							
							test2:
        movl 8(%esp), %eax
        notl %eax
        movl 4(%esp), %ecx
        notl %ecx
        orl %eax, %ecx
        cmpl $0, %ecx
        sete %al
        movzbl %al, %eax
        ret
or this (PPC):
_test2:
        nor r2, r4, r4
        nor r3, r3, r3
        or r2, r2, r3
        cntlzw r2, r2
        srwi r3, r2, 5
        blr
Emit this:
test2:
        movl 8(%esp), %eax
        andl 4(%esp), %eax
        cmpl $-1, %eax
        sete %al
        movzbl %al, %eax
        ret
or this:
_test2:
.LBB_test2_0:   ;
        and r2, r4, r3
        cmpwi cr0, r2, -1
        li r3, 1
        li r2, 0
        beq .LBB_test2_2        ;
.LBB_test2_1:   ;
        or r3, r2, r2
.LBB_test2_2:   ;
        blr
it seems like the PPC isel could do better for R32 == -1 case.
llvm-svn: 21242 
							
						 
						
							2005-04-12 01:46:05 +00:00  
				
					
						
							
							
								 
						
							
								8ffd004920 
								
							 
						 
						
							
							
								
								Teach the dag mechanism that this:  
							
							... 
							
							
							
							long long test2(unsigned A, unsigned B) {
        return ((unsigned long long)A << 32) + B;
}
is equivalent to this:
long long test1(unsigned A, unsigned B) {
        return ((unsigned long long)A << 32) | B;
}
Now they are both codegen'd to this on ppc:
_test2:
        blr
or this on x86:
test2:
        movl 4(%esp), %edx
        movl 8(%esp), %eax
        ret
llvm-svn: 21231 
							
						 
						
							2005-04-11 20:29:59 +00:00  
				
					
						
							
							
								 
						
							
								edd197062f 
								
							 
						 
						
							
							
								
								Fix expansion of shifts by exactly NVT bits on arch's (like X86) that have  
							
							... 
							
							
							
							masking shifts.
This fixes the miscompilation of this:
long long test1(unsigned A, unsigned B) {
        return ((unsigned long long)A << 32) | B;
}
into this:
test1:
        movl 4(%esp), %edx
        movl %edx, %eax
        orl 8(%esp), %eax
        ret
allowing us to generate this instead:
test1:
        movl 4(%esp), %edx
        movl 8(%esp), %eax
        ret
llvm-svn: 21230 
							
						 
						
							2005-04-11 20:08:52 +00:00  
				
					
						
							
							
								 
						
							
								add0c63ad2 
								
							 
						 
						
							
							
								
								Fix libcall code to not pass a NULL Chain to LowerCallTo  
							
							... 
							
							
							
							Fix libcall code to not crash or assert looking for an ADJCALLSTACKUP node
  when it is known that there is no ADJCALLSTACKDOWN to match.
Expand i64 multiply when ISD::MULHU is legal for the target.
llvm-svn: 21214 
							
						 
						
							2005-04-11 03:01:51 +00:00  
				
					
						
							
							
								 
						
							
								a3b7ef05f4 
								
							 
						 
						
							
							
								
								Teach legalize to deal with targets that don't support some SEXTLOAD/ZEXTLOADs  
							
							... 
							
							
							
							llvm-svn: 21212 
							
						 
						
							2005-04-10 22:54:25 +00:00  
				
					
						
							
							
								 
						
							
								391a351ede 
								
							 
						 
						
							
							
								
								don't zextload fp values!  
							
							... 
							
							
							
							llvm-svn: 21209 
							
						 
						
							2005-04-10 17:40:35 +00:00  
				
					
						
							
							
								 
						
							
								c53cd501b5 
								
							 
						 
						
							
							
								
								Until we have a dag combiner, promote using zextload's instead of extloads.  
							
							... 
							
							
							
							This gives the optimizer a bit of information about the top-part of the
value.
llvm-svn: 21205 
							
						 
						
							2005-04-10 04:33:47 +00:00  
				
					
						
							
							
								 
						
							
								d8cbfe82ba 
								
							 
						 
						
							
							
								
								Fix a thinko.  If the operand is promoted, pass the promoted value into  
							
							... 
							
							
							
							the new zero extend, not the original operand.  This fixes cast bool -> long
on ppc.
Add an unrelated fixme
llvm-svn: 21196 
							
						 
						
							2005-04-10 01:13:15 +00:00  
				
					
						
							
							
								 
						
							
								fd98678a8a 
								
							 
						 
						
							
							
								
								Legalize BRCONDTWOWAY into a BRCOND/BR pair if a target doesn't support it.  
							
							... 
							
							
							
							llvm-svn: 21166 
							
						 
						
							2005-04-09 03:30:19 +00:00  
				
					
						
							
							
								 
						
							
								b067492535 
								
							 
						 
						
							
							
								
								Teach ExpandShift how to handle shifts by a constant.  This allows targets  
							
							... 
							
							
							
							like PowerPC to codegen long shifts in many fewer instructions.
llvm-svn: 21122 
							
						 
						
							2005-04-06 21:13:14 +00:00  
				
					
						
							
							
								 
						
							
								20b7d2a36f 
								
							 
						 
						
							
							
								
								Expand SREM and UREM for targets that claim not to have them, like PowerPC  
							
							... 
							
							
							
							llvm-svn: 21103 
							
						 
						
							2005-04-06 00:23:54 +00:00  
				
					
						
							
							
								 
						
							
								cc00a7c42d 
								
							 
						 
						
							
							
								
								Handle expanding arguments to ISD::TRUNCATE.  This happens on PowerPC when  
							
							... 
							
							
							
							you have something like i16 = truncate i64.  This fixes Regression/C/casts
llvm-svn: 21073 
							
						 
						
							2005-04-04 00:57:08 +00:00  
				
					
						
							
							
								 
						
							
								4784489de2 
								
							 
						 
						
							
							
								
								Fix sign_extend and zero_extend of promoted value types to expanded value  
							
							... 
							
							
							
							types.  This occurs when casting short to long on PPC for example.
llvm-svn: 21072 
							
						 
						
							2005-04-03 23:41:52 +00:00  
				
					
						
							
							
								 
						
							
								a0c72cf289 
								
							 
						 
						
							
							
								
								Expand fabs into fneg  
							
							... 
							
							
							
							llvm-svn: 21013 
							
						 
						
							2005-04-02 05:26:37 +00:00  
				
					
						
							
							
								 
						
							
								13fe99c807 
								
							 
						 
						
							
							
								
								Several changes mixed up here.  First when legalizing a DAG with pcmarker,  
							
							... 
							
							
							
							dont' regen the whole dag if unneccesary.  Second, fix and ugly bug with
the _PARTS nodes that caused legalize to produce multiples of them.
Finally, implement initial support for FABS and FNEG.  Currently FNEG is
the only one to be trusted though.
llvm-svn: 21009 
							
						 
						
							2005-04-02 05:00:07 +00:00  
				
					
						
							
							
								 
						
							
								4157c417a1 
								
							 
						 
						
							
							
								
								fix some bugs in the implementation of SHL_PARTS and friends.  
							
							... 
							
							
							
							llvm-svn: 21004 
							
						 
						
							2005-04-02 04:00:59 +00:00  
				
					
						
							
							
								 
						
							
								2e5872c671 
								
							 
						 
						
							
							
								
								Turn expanded shift operations into (e.g.) SHL_PARTS if the target supports it.  
							
							... 
							
							
							
							llvm-svn: 21002 
							
						 
						
							2005-04-02 03:38:53 +00:00  
				
					
						
							
							
								 
						
							
								07f97d5f55 
								
							 
						 
						
							
							
								
								Fix a bug when inserting a libcall into a function with no other calls.  
							
							... 
							
							
							
							llvm-svn: 20999 
							
						 
						
							2005-04-02 03:22:40 +00:00  
				
					
						
							
							
								 
						
							
								69d39433c4 
								
							 
						 
						
							
							
								
								Fix a warning about an unhandled switch case  
							
							... 
							
							
							
							llvm-svn: 20994 
							
						 
						
							2005-04-02 00:41:14 +00:00  
				
					
						
							
							
								 
						
							
								cda9aa7fa9 
								
							 
						 
						
							
							
								
								Add ISD::UNDEF node  
							
							... 
							
							
							
							Teach the SelectionDAG code how to expand and promote it
Have PPC32 LowerCallTo generate ISD::UNDEF for int arg regs used up by fp
  arguments, but not shadowing their value.  This allows us to do the right
  thing with both fixed and vararg floating point arguments.
llvm-svn: 20988 
							
						 
						
							2005-04-01 22:34:39 +00:00  
				
					
						
							
							
								 
						
							
								dec53920b4 
								
							 
						 
						
							
							
								
								PCMarker support for DAG and Alpha  
							
							... 
							
							
							
							llvm-svn: 20965 
							
						 
						
							2005-03-31 21:24:06 +00:00  
				
					
						
							
							
								 
						
							
								32e08b7c06 
								
							 
						 
						
							
							
								
								implement legalization of build_pair for nate  
							
							... 
							
							
							
							llvm-svn: 20901 
							
						 
						
							2005-03-28 22:03:13 +00:00  
				
					
						
							
							
								 
						
							
								f656525cb6 
								
							 
						 
						
							
							
								
								Change interface to LowerCallTo to take a boolean isVarArg argument.  
							
							... 
							
							
							
							llvm-svn: 20842 
							
						 
						
							2005-03-26 01:29:23 +00:00  
				
					
						
							
							
								 
						
							
								a474313902 
								
							 
						 
						
							
							
								
								Fix a bug in the 'store fpimm, ptr' -> 'store intimm, ptr' handling code.  
							
							... 
							
							
							
							Changing 'op' here caused us to not enter the store into a map, causing
reemission of the code!!  In practice, a simple loop like this:
no_exit:                ; preds = %no_exit, %entry
        %indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ]            ; <uint> [#uses=3]
        %tmp.4 = getelementptr "complex long double"* %P, uint %indvar, uint 0          ; <double*> [#uses=1]
        store double 0.000000e+00, double* %tmp.4
        %indvar.next = add uint %indvar, 1              ; <uint> [#uses=2]
        %exitcond = seteq uint %indvar.next, %N         ; <bool> [#uses=1]
        br bool %exitcond, label %return, label %no_exit
was being code gen'd to:
.LBBtest_1:     # no_exit
        movl %edx, %esi
        shll $4, %esi
        movl $0, 4(%eax,%esi)
        movl $0, (%eax,%esi)
        incl %edx
        movl $0, (%eax,%esi)
        movl $0, 4(%eax,%esi)
        cmpl %ecx, %edx
        jne .LBBtest_1  # no_exit
Note that we are doing 4 32-bit stores instead of 2.  Now we generate:
.LBBtest_1:     # no_exit
        movl %edx, %esi
        incl %esi
        shll $4, %edx
        movl $0, (%eax,%edx)
        movl $0, 4(%eax,%edx)
        cmpl %ecx, %esi
        movl %esi, %edx
        jne .LBBtest_1  # no_exit
This is much happier, though it would be even better if the increment of ESI
was scheduled after the compare :-/
llvm-svn: 20265 
							
						 
						
							2005-02-22 07:23:39 +00:00  
				
					
						
							
							
								 
						
							
								0559691163 
								
							 
						 
						
							
							
								
								Fix a case where were incorrectly compiled cast from short to int on 64-bit  
							
							... 
							
							
							
							targets.
llvm-svn: 20030 
							
						 
						
							2005-02-04 18:39:19 +00:00  
				
					
						
							
							
								 
						
							
								5aa75e4ce5 
								
							 
						 
						
							
							
								
								Fix yet another memset issue.  
							
							... 
							
							
							
							llvm-svn: 19986 
							
						 
						
							2005-02-02 03:44:41 +00:00  
				
					
						
							
							
								 
						
							
								4487b2e5a6 
								
							 
						 
						
							
							
								
								Fix some bugs andrew noticed legalizing memset for alpha  
							
							... 
							
							
							
							llvm-svn: 19969 
							
						 
						
							2005-02-01 18:38:28 +00:00  
				
					
						
							
							
								 
						
							
								bc7497d5f5 
								
							 
						 
						
							
							
								
								Alpha doesn't have a native f32 extload instruction.  
							
							... 
							
							
							
							llvm-svn: 19880 
							
						 
						
							2005-01-28 22:58:25 +00:00  
				
					
						
							
							
								 
						
							
								bf8c1ad313 
								
							 
						 
						
							
							
								
								implement legalization of truncates whose results and sources need to be  
							
							... 
							
							
							
							truncated, e.g. (truncate:i8 something:i16) on a 32 or 64-bit RISC.
llvm-svn: 19879 
							
						 
						
							2005-01-28 22:52:50 +00:00  
				
					
						
							
							
								 
						
							
								a4cfafe31a 
								
							 
						 
						
							
							
								
								Get alpha working with memset/memcpy/memmove  
							
							... 
							
							
							
							llvm-svn: 19878 
							
						 
						
							2005-01-28 22:29:18 +00:00  
				
					
						
							
							
								 
						
							
								eb6614d719 
								
							 
						 
						
							
							
								
								CopyFromReg produces two values.  Make sure that we remember that both are  
							
							... 
							
							
							
							legalized, and actually return the correct result when we legalize the chain first.
llvm-svn: 19866 
							
						 
						
							2005-01-28 06:27:38 +00:00  
				
					
						
							
							
								 
						
							
								0dfd7d3a0d 
								
							 
						 
						
							
							
								
								Silence optimized warnings.  
							
							... 
							
							
							
							llvm-svn: 19797 
							
						 
						
							2005-01-23 23:19:44 +00:00  
				
					
						
							
							
								 
						
							
								4add7e356f 
								
							 
						 
						
							
							
								
								Adjust to changes in SelectionDAG interfaces  
							
							... 
							
							
							
							The first half of correct chain insertion for libcalls. This is not enough
to fix Fhourstones yet though.
llvm-svn: 19781 
							
						 
						
							2005-01-23 04:42:50 +00:00  
				
					
						
							
							
								 
						
							
								ec2183713c 
								
							 
						 
						
							
							
								
								Fix problems with non-x86 targets.  
							
							... 
							
							
							
							llvm-svn: 19738 
							
						 
						
							2005-01-22 00:31:52 +00:00  
				
					
						
							
							
								 
						
							
								aac464e6c0 
								
							 
						 
						
							
							
								
								Refactor libcall code a bit.  Initial implementation of expanding int -> FP  
							
							... 
							
							
							
							operations for 64-bit integers.
llvm-svn: 19724 
							
						 
						
							2005-01-21 06:05:23 +00:00  
				
					
						
							
							
								 
						
							
								4d25c04f94 
								
							 
						 
						
							
							
								
								Simplify the shift-expansion code.  
							
							... 
							
							
							
							llvm-svn: 19721 
							
						 
						
							2005-01-20 20:29:23 +00:00  
				
					
						
							
							
								 
						
							
								b3f83b28a5 
								
							 
						 
						
							
							
								
								Expand add/sub into ADD_PARTS/SUB_PARTS instead of a non-existant libcall.  
							
							... 
							
							
							
							llvm-svn: 19715 
							
						 
						
							2005-01-20 18:52:28 +00:00  
				
					
						
							
							
								 
						
							
								3d95c14d94 
								
							 
						 
						
							
							
								
								Add support for targets that pass args in registers to calls.  
							
							... 
							
							
							
							llvm-svn: 19703 
							
						 
						
							2005-01-19 20:24:35 +00:00  
				
					
						
							
							
								 
						
							
								55562fa99a 
								
							 
						 
						
							
							
								
								Fold single use token factor nodes into other token factor nodes.  
							
							... 
							
							
							
							llvm-svn: 19701 
							
						 
						
							2005-01-19 19:10:54 +00:00  
				
					
						
							
							
								 
						
							
								0d03eb45a8 
								
							 
						 
						
							
							
								
								Realize the individual pieces of an expanded copytoreg/store/load are  
							
							... 
							
							
							
							independent of each other.
llvm-svn: 19700 
							
						 
						
							2005-01-19 18:02:17 +00:00  
				
					
						
							
							
								 
						
							
								2a7f8a94f4 
								
							 
						 
						
							
							
								
								Implement a way of expanding shifts.  This applies to targets that offer  
							
							... 
							
							
							
							select operations or to shifts that are by a constant.  This automatically
implements (with no special code) all of the special cases for shift by 32,
shift by < 32 and shift by > 32.
llvm-svn: 19679 
							
						 
						
							2005-01-19 04:19:40 +00:00  
				
					
						
							
							
								 
						
							
								42993e45b6 
								
							 
						 
						
							
							
								
								Zero is cheaper than sign extend.  
							
							... 
							
							
							
							llvm-svn: 19675 
							
						 
						
							2005-01-18 21:57:59 +00:00  
				
					
						
							
							
								 
						
							
								d65c3f3118 
								
							 
						 
						
							
							
								
								Fix some fixmes (promoting bools for select and brcond), fix promotion  
							
							... 
							
							
							
							of zero and sign extends.
llvm-svn: 19671 
							
						 
						
							2005-01-18 19:27:06 +00:00  
				
					
						
							
							
								 
						
							
								9f2c4a5200 
								
							 
						 
						
							
							
								
								Teach legalize to promote copy(from|to)reg, instead of making the isel pass  
							
							... 
							
							
							
							do it.  This results in better code on X86 for floats (because if strict
precision is not required, we can elide some more expensive double -> float
conversions like the old isel did), and allows other targets to emit
CopyFromRegs that are not legal for arguments.
llvm-svn: 19668 
							
						 
						
							2005-01-18 17:54:55 +00:00  
				
					
						
							
							
								 
						
							
								2cb338d7b5 
								
							 
						 
						
							
							
								
								Teach legalize to promote SetCC results.  
							
							... 
							
							
							
							llvm-svn: 19657 
							
						 
						
							2005-01-18 02:59:52 +00:00  
				
					
						
							
							
								 
						
							
								b07e2d2084 
								
							 
						 
						
							
							
								
								Allow setcc operations to have nonbool types.  
							
							... 
							
							
							
							llvm-svn: 19656 
							
						 
						
							2005-01-18 02:52:03 +00:00  
				
					
						
							
							
								 
						
							
								5c8a85e2d8 
								
							 
						 
						
							
							
								
								Implement legalize of call nodes.  
							
							... 
							
							
							
							llvm-svn: 19617 
							
						 
						
							2005-01-16 19:46:48 +00:00  
				
					
						
							
							
								 
						
							
								3c0dd46a3b 
								
							 
						 
						
							
							
								
								Revamp supported ops.  Instead of just being supported or not, we now keep  
							
							... 
							
							
							
							track of how to deal with it, and provide the target with a hook that they
can use to legalize arbitrary operations in arbitrary ways.
Implement custom lowering for a couple of ops, implement promotion for select
operations (which x86 needs).
llvm-svn: 19613 
							
						 
						
							2005-01-16 07:29:19 +00:00  
				
					
						
							
							
								 
						
							
								3ba56b3fe7 
								
							 
						 
						
							
							
								
								Implement some more missing promotions.  
							
							... 
							
							
							
							llvm-svn: 19606 
							
						 
						
							2005-01-16 05:06:12 +00:00  
				
					
						
							
							
								 
						
							
								73b6977700 
								
							 
						 
						
							
							
								
								Clarify assertion.  
							
							... 
							
							
							
							llvm-svn: 19597 
							
						 
						
							2005-01-16 02:23:34 +00:00  
				
					
						
							
							
								 
						
							
								87a769cbd4 
								
							 
						 
						
							
							
								
								Move some information into the TargetLowering object.  
							
							... 
							
							
							
							llvm-svn: 19583 
							
						 
						
							2005-01-16 01:11:45 +00:00  
				
					
						
							
							
								 
						
							
								71d7f6e86f 
								
							 
						 
						
							
							
								
								legalize a bunch of operations that I missed.  
							
							... 
							
							
							
							llvm-svn: 19580 
							
						 
						
							2005-01-16 00:38:00 +00:00  
				
					
						
							
							
								 
						
							
								207a962c2c 
								
							 
						 
						
							
							
								
								Fix some serious bugs in promotion.  
							
							... 
							
							
							
							llvm-svn: 19578 
							
						 
						
							2005-01-16 00:17:42 +00:00  
				
					
						
							
							
								 
						
							
								4d97864e92 
								
							 
						 
						
							
							
								
								Implement promotion of a whole bunch more operators.  I think that this is  
							
							... 
							
							
							
							basically everything.
llvm-svn: 19576 
							
						 
						
							2005-01-15 22:16:26 +00:00  
				
					
						
							
							
								 
						
							
								99222f706c 
								
							 
						 
						
							
							
								
								Add support for legalizing FP_ROUND_INREG, SIGN_EXTEND_INREG, and  
							
							... 
							
							
							
							ZERO_EXTEND_INREG for targets that don't support them.
llvm-svn: 19573 
							
						 
						
							2005-01-15 07:15:18 +00:00  
				
					
						
							
							
								 
						
							
								c6c9a5b07d 
								
							 
						 
						
							
							
								
								Add support for promoting ADD/MUL.  
							
							... 
							
							
							
							Add support for new SIGN_EXTEND_INREG, ZERO_EXTEND_INREG, and FP_ROUND_INREG operators.
Realize that if we do any promotions, we need to iterate SelectionDAG
construction.
llvm-svn: 19569 
							
						 
						
							2005-01-15 06:18:18 +00:00  
				
					
						
							
							
								 
						
							
								1f2c9d82fa 
								
							 
						 
						
							
							
								
								Add intitial support for promoting some operators.  
							
							... 
							
							
							
							llvm-svn: 19565 
							
						 
						
							2005-01-15 05:21:40 +00:00  
				
					
						
							
							
								 
						
							
								3b8e719d1d 
								
							 
						 
						
							
							
								
								Adjust to CopyFromReg changes, implement deletion of truncating/extending  
							
							... 
							
							
							
							stores/loads.
llvm-svn: 19562 
							
						 
						
							2005-01-14 22:38:01 +00:00  
				
					
						
							
							
								 
						
							
								39c6744c9f 
								
							 
						 
						
							
							
								
								Start implementing truncating stores and extending loads.  
							
							... 
							
							
							
							llvm-svn: 19559 
							
						 
						
							2005-01-14 22:08:15 +00:00  
				
					
						
							
							
								 
						
							
								e727af06c8 
								
							 
						 
						
							
							
								
								Add new ImplicitDef node, rename CopyRegSDNode class to RegSDNode.  
							
							... 
							
							
							
							llvm-svn: 19535 
							
						 
						
							2005-01-13 20:50:02 +00:00  
				
					
						
							
							
								 
						
							
								05b4e37e85 
								
							 
						 
						
							
							
								
								Legalize new node, add assertion.  
							
							... 
							
							
							
							llvm-svn: 19527 
							
						 
						
							2005-01-13 17:59:25 +00:00  
				
					
						
							
							
								 
						
							
								9864b08f94 
								
							 
						 
						
							
							
								
								Fix sign extend to long.  When coming from sbyte, we used to generate:  
							
							... 
							
							
							
							movsbl 4(%esp), %eax
        movl %eax, %edx
        sarl $7, %edx
Now we generate:
        movsbl 4(%esp), %eax
        movl %eax, %edx
        sarl $31, %edx
Which is right.
llvm-svn: 19515 
							
						 
						
							2005-01-12 18:19:52 +00:00  
				
					
						
							
							
								 
						
							
								6dced92447 
								
							 
						 
						
							
							
								
								Shut up warnings with GCC 3.4.3 about uninitialized variables.  
							
							... 
							
							
							
							llvm-svn: 19512 
							
						 
						
							2005-01-12 14:53:45 +00:00  
				
					
						
							
							
								 
						
							
								f49c27c65c 
								
							 
						 
						
							
							
								
								Squelch optimized warning.  
							
							... 
							
							
							
							llvm-svn: 19475 
							
						 
						
							2005-01-11 17:46:49 +00:00  
				
					
						
							
							
								 
						
							
								85d70c6fd5 
								
							 
						 
						
							
							
								
								Teach legalize to lower MEMSET/MEMCPY/MEMMOVE operations if the target  
							
							... 
							
							
							
							does not support them.
llvm-svn: 19465 
							
						 
						
							2005-01-11 05:57:22 +00:00  
				
					
						
							
							
								 
						
							
								be02d430a9 
								
							 
						 
						
							
							
								
								Lower to the correct functions.  This fixes FreeBench/fourinarow  
							
							... 
							
							
							
							llvm-svn: 19436 
							
						 
						
							2005-01-10 21:02:37 +00:00  
				
					
						
							
							
								 
						
							
								9242c504da 
								
							 
						 
						
							
							
								
								Fix a bug legalizing call instructions (make sure to remember all result  
							
							... 
							
							
							
							values), and eliminate some switch statements.
llvm-svn: 19417 
							
						 
						
							2005-01-09 19:43:23 +00:00  
				
					
						
							
							
								 
						
							
								02f5ce2077 
								
							 
						 
						
							
							
								
								Fix a minor bug legalizing dynamic_stackalloc.  This allows us to compile  
							
							... 
							
							
							
							std::__pad<wchar_t, std::char_traits<wchar_t> >::_S_pad(std::ios_base&, wchar_t, wchar_t*, wchar_t const*, int, int, bool)
from libstdc++
llvm-svn: 19416 
							
						 
						
							2005-01-09 19:07:54 +00:00  
				
					
						
							
							
								 
						
							
								ec26b48d61 
								
							 
						 
						
							
							
								
								Teach legalize to deal with DYNAMIC_STACKALLOC (aka a dynamic llvm alloca)  
							
							... 
							
							
							
							llvm-svn: 19415 
							
						 
						
							2005-01-09 19:03:49 +00:00  
				
					
						
							
							
								 
						
							
								c0f31c5e96 
								
							 
						 
						
							
							
								
								Tighten up assertions.  
							
							... 
							
							
							
							llvm-svn: 19397 
							
						 
						
							2005-01-08 20:35:13 +00:00  
				
					
						
							
							
								 
						
							
								d006195517 
								
							 
						 
						
							
							
								
								Silence VS warnings.  
							
							... 
							
							
							
							llvm-svn: 19384 
							
						 
						
							2005-01-08 19:52:31 +00:00  
				
					
						
							
							
								 
						
							
								7e6eeba6c5 
								
							 
						 
						
							
							
								
								Implement handling of most long operators through libcalls.  
							
							... 
							
							
							
							Fix a bug legalizing "ret (Val,Val)"
llvm-svn: 19375 
							
						 
						
							2005-01-08 19:27:05 +00:00  
				
					
						
							
							
								 
						
							
								2a6db3c351 
								
							 
						 
						
							
							
								
								Add support for FP->INT conversions and back.  
							
							... 
							
							
							
							llvm-svn: 19369 
							
						 
						
							2005-01-08 08:08:56 +00:00  
				
					
						
							
							
								 
						
							
								e69daaf71d 
								
							 
						 
						
							
							
								
								Implement the 'store FPIMM, Ptr' -> 'store INTIMM, Ptr' optimization for  
							
							... 
							
							
							
							all targets.
llvm-svn: 19366 
							
						 
						
							2005-01-08 06:25:56 +00:00  
				
					
						
							
							
								 
						
							
								a65a2f0c36 
								
							 
						 
						
							
							
								
								Add support for truncating integer casts from long.  
							
							... 
							
							
							
							llvm-svn: 19358 
							
						 
						
							2005-01-07 22:37:48 +00:00  
				
					
						
							
							
								 
						
							
								ea4ca94cae 
								
							 
						 
						
							
							
								
								Fix a bug in load expansion legalization and ret legalization.  This fixes  
							
							... 
							
							
							
							CodeGen/Generic/select.ll:castconst.
llvm-svn: 19357 
							
						 
						
							2005-01-07 22:28:47 +00:00  
				
					
						
							
							
								 
						
							
								68a12140c0 
								
							 
						 
						
							
							
								
								Legalize unconditional branches too  
							
							... 
							
							
							
							llvm-svn: 19356 
							
						 
						
							2005-01-07 22:12:08 +00:00  
				
					
						
							
							
								 
						
							
								19a83990e1 
								
							 
						 
						
							
							
								
								Implement support for long GEP indices on 32-bit archs and support for  
							
							... 
							
							
							
							int GEP indices on 64-bit archs.
llvm-svn: 19354 
							
						 
						
							2005-01-07 21:56:57 +00:00  
				
					
						
							
							
								 
						
							
								32f20bfa93 
								
							 
						 
						
							
							
								
								implement legalization of a bunch more operators.  
							
							... 
							
							
							
							llvm-svn: 19352 
							
						 
						
							2005-01-07 21:45:56 +00:00  
				
					
						
							
							
								 
						
							
								fa854eb012 
								
							 
						 
						
							
							
								
								Fix another bug legalizing calls!  
							
							... 
							
							
							
							llvm-svn: 19350 
							
						 
						
							2005-01-07 21:35:32 +00:00  
				
					
						
							
							
								 
						
							
								f025d6788c 
								
							 
						 
						
							
							
								
								Fix a bug legalizing calls  
							
							... 
							
							
							
							llvm-svn: 19348 
							
						 
						
							2005-01-07 21:34:13 +00:00  
				
					
						
							
							
								 
						
							
								473825ccec 
								
							 
						 
						
							
							
								
								After legalizing a DAG, delete dead nodes to save space.  
							
							... 
							
							
							
							llvm-svn: 19346 
							
						 
						
							2005-01-07 21:09:37 +00:00  
				
					
						
							
							
								 
						
							
								ec3fe7c4a8 
								
							 
						 
						
							
							
								
								Teach legalize how to handle condbranches  
							
							... 
							
							
							
							llvm-svn: 19339 
							
						 
						
							2005-01-07 08:19:42 +00:00  
				
					
						
							
							
								 
						
							
								dc75059005 
								
							 
						 
						
							
							
								
								Initial implementation of the DAG legalization. This still has a long way  
							
							... 
							
							
							
							to go, but it does work for some non-trivial cases now.
llvm-svn: 19329 
							
						 
						
							2005-01-07 07:47:09 +00:00