Chris Lattner 
							
						 
					 
					
						
						
							
						
						27e9b41464 
					 
					
						
						
							
							Do not memoize ADJCALLSTACKDOWN nodes, provide a method to hack on them.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21871  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-05-11 18:57:39 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						276260b16d 
					 
					
						
						
							
							Print bit count nodes correctly  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21855  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-05-11 04:50:30 +00:00 
						 
				 
			
				
					
						
							
							
								Jeff Cohen 
							
						 
					 
					
						
						
							
						
						19bb2283e6 
					 
					
						
						
							
							Silence some VC++ warnings  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21838  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-05-10 02:22:38 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						3c6910153c 
					 
					
						
						
							
							Add support for READPORT, WRITEPORT, READIO, WRITEIO  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21824  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-05-09 20:22:17 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						57aa5961a9 
					 
					
						
						
							
							Fold shifts into subsequent SHL's.  These shifts often arise due to addrses  
						
						... 
						
						
						
						arithmetic lowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21818  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-05-09 17:06:45 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						fd414a27fd 
					 
					
						
						
							
							Don't use the load/store instruction as the source pointer, use the pointer  
						
						... 
						
						
						
						being stored/loaded through!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21806  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-05-09 04:28:51 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						0437cdd6dc 
					 
					
						
						
							
							memoize all nodes, even null Value* nodes.  Do not add two token chain outputs  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21805  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-05-09 04:14:13 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						2bf3c26b2b 
					 
					
						
						
							
							Print SrcValue nodes correctly  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21803  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-05-09 04:08:27 +00:00 
						 
				 
			
				
					
						
							
							
								Andrew Lenharth 
							
						 
					 
					
						
						
							
						
						691ef2ba06 
					 
					
						
						
							
							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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21676  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-05-03 17:19:30 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						7f64464ff1 
					 
					
						
						
							
							Add FSQRT, FSIN, FCOS nodes, patch contributed by Morten Ofstad  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21605  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-28 21:44:03 +00:00 
						 
				 
			
				
					
						
							
							
								Andrew Lenharth 
							
						 
					 
					
						
						
							
						
						2d86ea21dd 
					 
					
						
						
							
							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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21599  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-27 20:10:01 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						d36f979085 
					 
					
						
						
							
							Fold  (X >  -1) | (Y >  -1)  -->   (X&Y >  -1)  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21552  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-26 01:18:33 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						229ab2e7b2 
					 
					
						
						
							
							implement some more logical compares with constants, so that:  
						
						... 
						
						
						
						int foo1(int x, int y) {
  int t1 = x >= 0;
  int t2 = y >= 0;
  return t1 & t2;
}
int foo2(int x, int y) {
  int t1 = x == -1;
  int t2 = y == -1;
  return t1 & t2;
}
produces:
_foo1:
        or r2, r4, r3
        srwi r2, r2, 31
        xori r3, r2, 1
        blr
_foo2:
        and r2, r4, r3
        addic r2, r2, 1
        li r2, 0
        addze r3, r2
        blr
instead of:
_foo1:
        srwi r2, r4, 31
        xori r2, r2, 1
        srwi r3, r3, 31
        xori r3, r3, 1
        and r3, r2, r3
        blr
_foo2:
        addic r2, r4, 1
        li r2, 0
        addze r2, r2
        addic r3, r3, 1
        li r3, 0
        addze r3, r3
        and r3, r2, r3
        blr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21547  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-25 21:20:28 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						6ea9279304 
					 
					
						
						
							
							Codegen x < 0 | y < 0 as (x|y) < 0.  This allows us to compile this to:  
						
						... 
						
						
						
						_foo:
        or r2, r4, r3
        srwi r3, r2, 31
        blr
instead of:
_foo:
        srwi r2, r4, 31
        srwi r3, r3, 31
        or r3, r2, r3
        blr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21544  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-25 21:03:25 +00:00 
						 
				 
			
				
					
						
							
							
								Misha Brukman 
							
						 
					 
					
						
						
							
						
						dedf2bd5a3 
					 
					
						
						
							
							Convert tabs to spaces  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21439  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-22 04:01:18 +00:00 
						 
				 
			
				
					
						
							
							
								Misha Brukman 
							
						 
					 
					
						
						
							
						
						edf128a7fa 
					 
					
						
						
							
							Remove trailing whitespace  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21420  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-21 22:36:52 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						588bbbffa1 
					 
					
						
						
							
							Improve and elimination.  On PPC, for:  
						
						... 
						
						
						
						bool %test(int %X) {
        %Y = and int %X, 8
        %Z = setne int %Y, 0
        ret bool %Z
}
we now generate this:
        rlwinm r2, r3, 0, 28, 28
        srwi r3, r2, 3
instead of this:
        rlwinm r2, r3, 0, 28, 28
        srwi r2, r2, 3
        rlwinm r3, r2, 0, 31, 31
I'll leave it to Nate to get it down to one instruction. :)
---------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21391  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-21 06:28:15 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						1c2a9b95dc 
					 
					
						
						
							
							Fold (x & 8) != 0 and (x & 8) == 8  into (x & 8) >> 3.  
						
						... 
						
						
						
						This turns this PPC code:
        rlwinm r2, r3, 0, 28, 28
        cmpwi cr7, r2, 8
        mfcr r2
        rlwinm r3, r2, 31, 31, 31
into this:
        rlwinm r2, r3, 0, 28, 28
        srwi r2, r2, 3
        rlwinm r3, r2, 0, 31, 31
Next up, nuking the extra and.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21390  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-21 06:12:41 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						fda2b55e1b 
					 
					
						
						
							
							Fold setcc of MVT::i1 operands into logical operations  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21319  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-18 04:48:12 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						4a44c8df19 
					 
					
						
						
							
							Another minor simplification: handle setcc (zero_extend x), c -> setcc(x, c')  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21318  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-18 04:30:45 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						7467c9b086 
					 
					
						
						
							
							Another simple xform  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21317  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-18 04:11:19 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						706aa9685a 
					 
					
						
						
							
							Fold:  
						
						... 
						
						
						
						// (X != 0) | (Y != 0) -> (X|Y != 0)
        // (X == 0) & (Y == 0) -> (X|Y == 0)
Compiling this:
int %bar(int %a, int %b) {
        entry:
        %tmp.1 = setne int %a, 0
        %tmp.2 = setne int %b, 0
        %tmp.3 = or bool %tmp.1, %tmp.2
        %retval = cast bool %tmp.3 to int
        ret int %retval
        }
to this:
_bar:
        or r2, r3, r4
        addic r3, r2, -1
        subfe r3, r3, r2
        blr
instead of:
_bar:
        addic r2, r3, -1
        subfe r2, r2, r3
        addic r3, r4, -1
        subfe r3, r3, r4
        or r3, r2, r3
        blr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21316  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-18 03:59:53 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						36019aa5c6 
					 
					
						
						
							
							Make the AND elimination operation recursive and significantly more powerful,  
						
						... 
						
						
						
						eliminating an and for Nate's testcase:
int %bar(int %a, int %b) {
        entry:
        %tmp.1 = setne int %a, 0
        %tmp.2 = setne int %b, 0
        %tmp.3 = or bool %tmp.1, %tmp.2
        %retval = cast bool %tmp.3 to int
        ret int %retval
        }
generating:
_bar:
        addic r2, r3, -1
        subfe r2, r2, r3
        addic r3, r4, -1
        subfe r3, r3, r4
        or r3, r2, r3
        blr
instead of:
_bar:
        addic r2, r3, -1
        subfe r2, r2, r3
        addic r3, r4, -1
        subfe r3, r3, r4
        or r2, r2, r3
        rlwinm r3, r2, 0, 31, 31
        blr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21315  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-18 03:48:41 +00:00 
						 
				 
			
				
					
						
							
							
								Nate Begeman 
							
						 
					 
					
						
						
							
						
						72ea281d61 
					 
					
						
						
							
							Add a couple missing transforms in getSetCC that were triggering assertions  
						
						... 
						
						
						
						in the PPC Pattern ISel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21297  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-14 08:56:52 +00:00 
						 
				 
			
				
					
						
							
							
								Nate Begeman 
							
						 
					 
					
						
						
							
						
						eea805e74c 
					 
					
						
						
							
							Disbale the broken fold of shift + sz[ext] for now  
						
						... 
						
						
						
						Move the transform for select (a < 0) ? b : 0 into the dag from ppc isel
Enable the dag to fold and (setcc, 1) -> setcc for targets where setcc
  always produces zero or one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21291  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-13 21:23:31 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						97e001dec7 
					 
					
						
						
							
							fix an infinite loop  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21289  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-13 20:06:29 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						fd8d389ede 
					 
					
						
						
							
							fix some serious miscompiles on ia64, alpha, and ppc  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21288  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-13 19:53:40 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						51679c430f 
					 
					
						
						
							
							avoid work when possible, perhaps fix the problem nate and andrew are seeing  
						
						... 
						
						
						
						with != 0 comparisons vanishing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21287  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-13 19:41:05 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						e666fcfbdd 
					 
					
						
						
							
							add back the optimization that Nate added for shl X, (zext_inreg y)  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21273  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-13 02:58:13 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						8a8dbfa57c 
					 
					
						
						
							
							Oops, remove these too.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21272  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-13 02:47:57 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						0f2287baa1 
					 
					
						
						
							
							Remove all foldings of ZERO_EXTEND_INREG, moving them to work for AND nodes  
						
						... 
						
						
						
						instead.  OVerall, this increases the amount of folding we can do.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21265  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-13 02:38:18 +00:00 
						 
				 
			
				
					
						
							
							
								Nate Begeman 
							
						 
					 
					
						
						
							
						
						db81ebab89 
					 
					
						
						
							
							Fold shift x, [sz]ext(y) -> shift x, y  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21262  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-12 23:32:28 +00:00 
						 
				 
			
				
					
						
							
							
								Nate Begeman 
							
						 
					 
					
						
						
							
						
						b882752bd0 
					 
					
						
						
							
							Fold shift by size larger than type size to undef  
						
						... 
						
						
						
						Make llvm undef values generate ISD::UNDEF nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21261  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-12 23:12:17 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						fd1f1ee0ba 
					 
					
						
						
							
							Remove some redundant checks, add a couple of new ones.  This allows us to  
						
						... 
						
						
						
						compile this:
int foo (unsigned long a, unsigned long long g) {
  return a >= g;
}
To:
foo:
        movl 8(%esp), %eax
        cmpl %eax, 4(%esp)
        setae %al
        cmpl $0, 12(%esp)
        sete %cl
        andb %al, %cl
        movzbl %cl, %eax
        ret
instead of:
foo:
        movl 8(%esp), %eax
        cmpl %eax, 4(%esp)
        setae %al
        movzbw %al, %cx
        movl 12(%esp), %edx
        cmpl $0, %edx
        sete %al
        movzbw %al, %ax
        cmpl $0, %edx
        cmove %cx, %ax
        movzbl %al, %eax
        ret
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21244  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-12 02:54:39 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						3b2c1d95a2 
					 
					
						
						
							
							canonicalize x <u 1 -> x == 0.  On this testcase:  
						
						... 
						
						
						
						unsigned long long g;
unsigned long foo (unsigned long a) {
  return (a >= g) ? 1 : 0;
}
It changes the ppc code from:
_foo:
.LBB_foo_0:     ; entry
        mflr r11
        stw r11, 8(r1)
        bl "L00000$pb"
"L00000$pb":
        mflr r2
        addis r2, r2, ha16(L_g$non_lazy_ptr-"L00000$pb")
        lwz r2, lo16(L_g$non_lazy_ptr-"L00000$pb")(r2)
        lwz r4, 0(r2)
        lwz r2, 4(r2)
        cmplw cr0, r3, r2
        li r2, 1
        li r3, 0
        bge .LBB_foo_2  ; entry
.LBB_foo_1:     ; entry
        or r2, r3, r3
.LBB_foo_2:     ; entry
        cmplwi cr0, r4, 1
        li r3, 1
        li r5, 0
        blt .LBB_foo_4  ; entry
.LBB_foo_3:     ; entry
        or r3, r5, r5
.LBB_foo_4:     ; entry
        cmpwi cr0, r4, 0
        beq .LBB_foo_6  ; entry
.LBB_foo_5:     ; entry
        or r2, r3, r3
.LBB_foo_6:     ; entry
        rlwinm r3, r2, 0, 31, 31
        lwz r11, 8(r1)
        mtlr r11
        blr
to:
_foo:
.LBB_foo_0:     ; entry
        mflr r11
        stw r11, 8(r1)
        bl "L00000$pb"
"L00000$pb":
        mflr r2
        addis r2, r2, ha16(L_g$non_lazy_ptr-"L00000$pb")
        lwz r2, lo16(L_g$non_lazy_ptr-"L00000$pb")(r2)
        lwz r4, 0(r2)
        lwz r2, 4(r2)
        cmplw cr0, r3, r2
        li r2, 1
        li r3, 0
        bge .LBB_foo_2  ; entry
.LBB_foo_1:     ; entry
        or r2, r3, r3
.LBB_foo_2:     ; entry
        cntlzw r3, r4
        srwi r3, r3, 5
        cmpwi cr0, r4, 0
        beq .LBB_foo_4  ; entry
.LBB_foo_3:     ; entry
        or r2, r3, r3
.LBB_foo_4:     ; entry
        rlwinm r3, r2, 0, 31, 31
        lwz r11, 8(r1)
        mtlr r11
        blr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21241  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-12 00:28:49 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						2bb6f41282 
					 
					
						
						
							
							Don't bother sign/zext_inreg'ing the result of an and operation if we know  
						
						... 
						
						
						
						the result does change as a result of the extend.
This improves codegen for Alpha on this testcase:
int %a(ushort* %i) {
        %tmp.1 = load ushort* %i
        %tmp.2 = cast ushort %tmp.1 to int
        %tmp.4 = and int %tmp.2, 1
        ret int %tmp.4
}
Generating:
a:
        ldgp $29, 0($27)
        ldwu $0,0($16)
        and $0,1,$0
        ret $31,($26),1
instead of:
a:
        ldgp $29, 0($27)
        ldwu $0,0($16)
        and $0,1,$0
        addl $0,0,$0
        ret $31,($26),1
btw, alpha really should switch to livein/outs for args :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21213  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-10 23:37:16 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						45278e37eb 
					 
					
						
						
							
							Fold zext_inreg(zextload), likewise for sext's  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21204  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-10 04:33:08 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						edeecfcbd5 
					 
					
						
						
							
							add a simple xform  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21203  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-10 04:04:49 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						dea29e25c3 
					 
					
						
						
							
							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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21196  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-10 01:13:15 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						a2daa8c78d 
					 
					
						
						
							
							add a little peephole optimization.  This allows us to codegen:  
						
						... 
						
						
						
						int a(short i) {
        return i & 1;
}
as
_a:
        andi. r3, r3, 1
        blr
instead of:
_a:
        rlwinm r2, r3, 0, 16, 31
        andi. r3, r2, 1
        blr
on ppc.  It should also help the other risc targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21189  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-09 21:43:54 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						59723e9698 
					 
					
						
						
							
							recognize some patterns as fabs operations, so that fabs at the source level  
						
						... 
						
						
						
						is deconstructed then reconstructed here.  This catches 19 fabs's in 177.mesa
9 in 168.wupwise, 5 in 171.swim, 3 in 172.mgrid, and 14 in 173.applu out of
specfp2000.
This allows the X86 code generator to make MUCH better code than before for
each of these and saves one instr on ppc.
This depends on the previous CFE patch to expose these correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21171  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-09 05:15:53 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						ef847df087 
					 
					
						
						
							
							print and fold BRCONDTWOWAY correctly  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21165  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-09 03:27:28 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						485df9b84b 
					 
					
						
						
							
							canonicalize a bunch of operations involving fneg  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21160  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-09 03:02:46 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						5a6bace3ab 
					 
					
						
						
							
							If a target zero or sign extends the result of its setcc, allow folding of  
						
						... 
						
						
						
						this into sign/zero extension instructions later.
On PPC, for example, this testcase:
%G = external global sbyte
implementation
void %test(int %X, int %Y) {
  %C = setlt int %X, %Y
  %D = cast bool %C to sbyte
  store sbyte %D, sbyte* %G
  ret void
}
Now codegens to:
        cmpw cr0, r3, r4
        li r3, 1
        li r4, 0
        blt .LBB_test_2 ;
.LBB_test_1:    ;
        or r3, r4, r4
.LBB_test_2:    ;
        addis r2, r2, ha16(L_G$non_lazy_ptr-"L00000$pb")
        lwz r2, lo16(L_G$non_lazy_ptr-"L00000$pb")(r2)
        stb r3, 0(r2)
instead of:
        cmpw cr0, r3, r4
        li r3, 1
        li r4, 0
        blt .LBB_test_2 ;
.LBB_test_1:    ;
        or r3, r4, r4
.LBB_test_2:    ;
***     rlwinm r3, r3, 0, 31, 31
        addis r2, r2, ha16(L_G$non_lazy_ptr-"L00000$pb")
        lwz r2, lo16(L_G$non_lazy_ptr-"L00000$pb")(r2)
        stb r3, 0(r2)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21148  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-07 19:43:53 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						2467392c59 
					 
					
						
						
							
							Remove somethign I had for testing  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21144  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-07 18:58:54 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						67255a1d17 
					 
					
						
						
							
							This patch does two things.  First, it canonicalizes 'X >= C' -> 'X > C-1'  
						
						... 
						
						
						
						(likewise for <= >=u >=u).
Second, it implements a special case hack to turn 'X gtu SINTMAX' -> 'X lt 0'
On powerpc, for example, this changes this:
        lis r2, 32767
        ori r2, r2, 65535
        cmplw cr0, r3, r2
        bgt .LBB_test_2
into:
        cmpwi cr0, r3, 0
        blt .LBB_test_2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21142  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-07 18:14:58 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						8e8bd656b3 
					 
					
						
						
							
							Fix a really scary bug that Nate found where we weren't deleting the right  
						
						... 
						
						
						
						elements auto of the autoCSE maps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21128  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-07 00:30:13 +00:00 
						 
				 
			
				
					
						
							
							
								Nate Begeman 
							
						 
					 
					
						
						
							
						
						1867054643 
					 
					
						
						
							
							Add MULHU and MULHS nodes for the high part of an (un)signed 32x32=64b  
						
						... 
						
						
						
						multiply.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21102  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-05 22:36:56 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						ff9fd0a99c 
					 
					
						
						
							
							print fneg/fabs  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21008  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-02 04:58:41 +00:00 
						 
				 
			
				
					
						
							
							
								Chris Lattner 
							
						 
					 
					
						
						
							
						
						5b359c6c4f 
					 
					
						
						
							
							fix some bugs in the implementation of SHL_PARTS and friends.  
						
						... 
						
						
						
						git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21004  91177308-0d34-0410-b5e6-96231b3b80d8 
						
						
					 
					
						2005-04-02 04:00:59 +00:00