Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								247aef884c 
								
							 
						 
						
							
							
								
								When transforming &A[i] < &A[j]  ->  i < j, make sure to perform the comparison  
							
							 
							
							... 
							
							
							
							as a signed compare.  This patch may fix PR597, but is correct in any case.
llvm-svn: 22465 
							
						 
						
							2005-07-18 23:07:33 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4ed40f7c6f 
								
							 
						 
						
							
							
								
								Fix a problem that instcombine would hit when dealing with unreachable code.  
							
							 
							
							... 
							
							
							
							Because the instcombine has to scan the entire function when it starts up
to begin with, we might as well do it in DFO so we can nuke unreachable code.
This fixes: Transforms/InstCombine/2005-07-07-DeadPHILoop.ll
llvm-svn: 22348 
							
						 
						
							2005-07-07 20:40:38 +00:00  
						
					 
				
					
						
							
							
								 
								Andrew Lenharth
							
						 
						
							 
							
							
							
							
								
							
							
								cf52eb2b99 
								
							 
						 
						
							
							
								
								prevent va_arg from being hoisted from a loop  
							
							 
							
							... 
							
							
							
							llvm-svn: 22265 
							
						 
						
							2005-06-20 13:36:33 +00:00  
						
					 
				
					
						
							
							
								 
								Andrew Lenharth
							
						 
						
							 
							
							
							
							
								
							
							
								9144ec4764 
								
							 
						 
						
							
							
								
								core changes for varargs  
							
							 
							
							... 
							
							
							
							llvm-svn: 22254 
							
						 
						
							2005-06-18 18:34:52 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								4fdd96c4e0 
								
							 
						 
						
							
							
								
								Clean up some uninitialized variables and missing return statements that  
							
							 
							
							... 
							
							
							
							GCC 4.0.0 compiler (sometimes incorrectly) warns about under release build.
llvm-svn: 22249 
							
						 
						
							2005-06-18 17:37:34 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2ceb6ee576 
								
							 
						 
						
							
							
								
								This is not true: (X != 13 | X < 15) -> X < 15  
							
							 
							
							... 
							
							
							
							It is actually always true.  This fixes PR586 and
Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll
llvm-svn: 22236 
							
						 
						
							2005-06-17 03:59:17 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								73bcba5f61 
								
							 
						 
						
							
							
								
								Don't crash when dealing with INTMIN.  This fixes PR585 and  
							
							 
							
							... 
							
							
							
							Transforms/InstCombine/2005-06-16-RangeCrash.ll
llvm-svn: 22234 
							
						 
						
							2005-06-17 02:05:55 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c53cb9d3ff 
								
							 
						 
						
							
							
								
								avoid constructing out of range shift amounts.  
							
							 
							
							... 
							
							
							
							llvm-svn: 22230 
							
						 
						
							2005-06-17 01:29:28 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								89dc4f16f5 
								
							 
						 
						
							
							
								
								Fix PR583 and testcase Transforms/InstCombine/2005-06-15-DivSelectCrash.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 22227 
							
						 
						
							2005-06-16 04:55:52 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								252a845e30 
								
							 
						 
						
							
							
								
								Fix PR571, removing code that does just the WRONG thing :)  
							
							 
							
							... 
							
							
							
							llvm-svn: 22225 
							
						 
						
							2005-06-16 03:00:08 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								104002bee3 
								
							 
						 
						
							
							
								
								Fix a bug in my previous patch.  Do not get the shift amount type (which  
							
							 
							
							... 
							
							
							
							is always ubyte, get the type being shifted).  This unbreaks espresso
llvm-svn: 22224 
							
						 
						
							2005-06-16 01:52:07 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								df81539278 
								
							 
						 
						
							
							
								
								Fix PR582.  The rewriter can move casts around, which invalidated the  
							
							 
							
							... 
							
							
							
							BB iterator.  This fixes Transforms/IndVarsSimplify/2005-06-15-InstMoveCrash.ll
llvm-svn: 22221 
							
						 
						
							2005-06-15 21:29:31 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								19b57f55aa 
								
							 
						 
						
							
							
								
								Fix PR577 and testcase InstCombine/2005-06-15-ShiftSetCCCrash.ll.  
							
							 
							
							... 
							
							
							
							Do not perform undefined out of range shifts.
llvm-svn: 22217 
							
						 
						
							2005-06-15 20:53:31 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								a299d6f701 
								
							 
						 
						
							
							
								
								Put the hack back in that removes features, causes regressions to fail, but  
							
							 
							
							... 
							
							
							
							allows test programs to succeed. Actual fix for this is forthcoming.
llvm-svn: 22213 
							
						 
						
							2005-06-15 18:25:30 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								6d231e55fa 
								
							 
						 
						
							
							
								
								Unbreak several InstCombine regression checks introduced by a hack to  
							
							 
							
							... 
							
							
							
							fix the bzip2 test. A better hack is needed.
llvm-svn: 22209 
							
						 
						
							2005-06-13 06:41:26 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1609a541cd 
								
							 
						 
						
							
							
								
								Fix a 64-bit problem, passing (int)0 through ... instead of (void*)0  
							
							 
							
							... 
							
							
							
							llvm-svn: 22206 
							
						 
						
							2005-06-09 03:32:54 +00:00  
						
					 
				
					
						
							
							
								 
								Andrew Lenharth
							
						 
						
							 
							
							
							
							
								
							
							
								ffe65458e7 
								
							 
						 
						
							
							
								
								hack to fix bzip2 (bug 571)  
							
							 
							
							... 
							
							
							
							llvm-svn: 22192 
							
						 
						
							2005-06-04 12:43:56 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								05c703ea85 
								
							 
						 
						
							
							
								
								preserve calling conventions when hacking on code  
							
							 
							
							... 
							
							
							
							llvm-svn: 22024 
							
						 
						
							2005-05-14 12:25:32 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								61d9d81770 
								
							 
						 
						
							
							
								
								calling a function with the wrong CC is undefined, turn it into an unreachable  
							
							 
							
							... 
							
							
							
							instruction.  This is useful for catching optimizers that don't preserve
calling conventions
llvm-svn: 21928 
							
						 
						
							2005-05-13 07:09:09 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ca968393ab 
								
							 
						 
						
							
							
								
								When lowering invokes to calls, amke sure to preserve the calling conv.  This  
							
							 
							
							... 
							
							
							
							fixes Ptrdist/anagram with x86 llcbeta
llvm-svn: 21925 
							
						 
						
							2005-05-13 06:27:02 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ae186e012c 
								
							 
						 
						
							
							
								
								Prefer int 0 instead of long 0 for GEP arguments.  
							
							 
							
							... 
							
							
							
							llvm-svn: 21924 
							
						 
						
							2005-05-13 06:10:12 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								31c667e234 
								
							 
						 
						
							
							
								
								Fix Reassociate/shifttest.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 21839 
							
						 
						
							2005-05-10 03:39:25 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								bfc796f622 
								
							 
						 
						
							
							
								
								If a function contains no allocas, all of the calls in it are trivially  
							
							 
							
							... 
							
							
							
							suitable for tail calls.
llvm-svn: 21836 
							
						 
						
							2005-05-09 23:51:13 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b62f5082c5 
								
							 
						 
						
							
							
								
								implement and.ll:test33  
							
							 
							
							... 
							
							
							
							llvm-svn: 21809 
							
						 
						
							2005-05-09 04:58:36 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								df3332660f 
								
							 
						 
						
							
							
								
								Implement Reassociate/mul-neg-add.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 21788 
							
						 
						
							2005-05-08 21:41:35 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c4f8e2b0ed 
								
							 
						 
						
							
							
								
								Bail out earlier  
							
							 
							
							... 
							
							
							
							llvm-svn: 21786 
							
						 
						
							2005-05-08 21:33:47 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								877b114037 
								
							 
						 
						
							
							
								
								Teach reassociate that 0-X === X*-1  
							
							 
							
							... 
							
							
							
							llvm-svn: 21785 
							
						 
						
							2005-05-08 21:28:52 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9f284e0a3c 
								
							 
						 
						
							
							
								
								Fix PR557 and basictest[34].ll.  
							
							 
							
							... 
							
							
							
							This makes reassociate realize that loads should be treated as unmovable, and
gives distinct ranks to distinct values defined in the same basic block, allowing
reassociate to do its thing.
llvm-svn: 21783 
							
						 
						
							2005-05-08 20:57:04 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9187f3905e 
								
							 
						 
						
							
							
								
								Add debugging information  
							
							 
							
							... 
							
							
							
							llvm-svn: 21781 
							
						 
						
							2005-05-08 20:09:57 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								08582be283 
								
							 
						 
						
							
							
								
								eliminate gotos  
							
							 
							
							... 
							
							
							
							llvm-svn: 21780 
							
						 
						
							2005-05-08 19:48:43 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								5847e5e10c 
								
							 
						 
						
							
							
								
								Improve reassociation handling of inverses, implementing inverses.ll.  
							
							 
							
							... 
							
							
							
							llvm-svn: 21778 
							
						 
						
							2005-05-08 18:59:37 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4922118dc4 
								
							 
						 
						
							
							
								
								clean up and modernize this pass.  
							
							 
							
							... 
							
							
							
							llvm-svn: 21776 
							
						 
						
							2005-05-08 18:45:26 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b18dbbfff5 
								
							 
						 
						
							
							
								
								Strength reduce SAR into SHR if there is no way sign bits could be shifted  
							
							 
							
							... 
							
							
							
							in.  This tends to get cases like this:
  X = cast ubyte to int
  Y = shr int X, ...
Tested by: shift.ll:test24
llvm-svn: 21775 
							
						 
						
							2005-05-08 17:34:56 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								e1850b86b6 
								
							 
						 
						
							
							
								
								Refactor some code  
							
							 
							
							... 
							
							
							
							llvm-svn: 21772 
							
						 
						
							2005-05-08 00:19:31 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6e2086d7e4 
								
							 
						 
						
							
							
								
								Handle some simple cases where we can see that values get annihilated.  
							
							 
							
							... 
							
							
							
							llvm-svn: 21771 
							
						 
						
							2005-05-08 00:08:33 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4294cec0f1 
								
							 
						 
						
							
							
								
								Fix a miscompilation of crafty by clobbering the "A" variable.  
							
							 
							
							... 
							
							
							
							llvm-svn: 21770 
							
						 
						
							2005-05-07 23:49:08 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1e5065052a 
								
							 
						 
						
							
							
								
								Rewrite the guts of the reassociate pass to be more efficient and logical.  Instead  
							
							 
							
							... 
							
							
							
							of trying to do local reassociation tweaks at each level, only process an expression
tree once (at its root).  This does not improve the reassociation pass in any real way.
llvm-svn: 21768 
							
						 
						
							2005-05-07 21:59:39 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								cea579932d 
								
							 
						 
						
							
							
								
								Convert shifts to muls to assist reassociation.  This implements  
							
							 
							
							... 
							
							
							
							Reassociate/shifttest.ll
llvm-svn: 21761 
							
						 
						
							2005-05-07 04:24:13 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f43e974abd 
								
							 
						 
						
							
							
								
								Simplify the code and rearrange it.  No major functionality changes here.  
							
							 
							
							... 
							
							
							
							llvm-svn: 21759 
							
						 
						
							2005-05-07 04:08:02 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6aacb0f9da 
								
							 
						 
						
							
							
								
								Preserve tail marker  
							
							 
							
							... 
							
							
							
							llvm-svn: 21737 
							
						 
						
							2005-05-06 06:48:21 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ef298a3b8a 
								
							 
						 
						
							
							
								
								Teach instcombine propagate zeroness through shl instructions, implementing  
							
							 
							
							... 
							
							
							
							and.ll:test31
llvm-svn: 21717 
							
						 
						
							2005-05-06 04:53:20 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								873804168e 
								
							 
						 
						
							
							
								
								Implement shift.ll:test23.  If we are shifting right then immediately truncating  
							
							 
							
							... 
							
							
							
							the result, turn signed shift rights into unsigned shift rights if possible.
This leads to later simplification and happens *often* in 176.gcc.  For example,
this testcase:
struct xxx { unsigned int code : 8; };
enum codes { A, B, C, D, E, F };
int foo(struct xxx *P) {
  if ((enum codes)P->code == A)
     bar();
}
used to be compiled to:
int %foo(%struct.xxx* %P) {
        %tmp.1 = getelementptr %struct.xxx* %P, int 0, uint 0           ; <uint*> [#uses=1]
        %tmp.2 = load uint* %tmp.1              ; <uint> [#uses=1]
        %tmp.3 = cast uint %tmp.2 to int                ; <int> [#uses=1]
        %tmp.4 = shl int %tmp.3, ubyte 24               ; <int> [#uses=1]
        %tmp.5 = shr int %tmp.4, ubyte 24               ; <int> [#uses=1]
        %tmp.6 = cast int %tmp.5 to sbyte               ; <sbyte> [#uses=1]
        %tmp.8 = seteq sbyte %tmp.6, 0          ; <bool> [#uses=1]
        br bool %tmp.8, label %then, label %UnifiedReturnBlock
Now it is compiled to:
        %tmp.1 = getelementptr %struct.xxx* %P, int 0, uint 0           ; <uint*> [#uses=1]
        %tmp.2 = load uint* %tmp.1              ; <uint> [#uses=1]
        %tmp.2 = cast uint %tmp.2 to sbyte              ; <sbyte> [#uses=1]
        %tmp.8 = seteq sbyte %tmp.2, 0          ; <bool> [#uses=1]
        br bool %tmp.8, label %then, label %UnifiedReturnBlock
which is the difference between this:
foo:
        subl $4, %esp
        movl 8(%esp), %eax
        movl (%eax), %eax
        shll $24, %eax
        sarl $24, %eax
        testb %al, %al
        jne .LBBfoo_2
and this:
foo:
        subl $4, %esp
        movl 8(%esp), %eax
        movl (%eax), %eax
        testb %al, %al
        jne .LBBfoo_2
This occurs 3243 times total in the External tests, 215x in povray,
6x in each f2c'd program, 1451x in 176.gcc, 7x in crafty, 20x in perl,
25x in gap, 3x in m88ksim, 25x in ijpeg.
Maybe this will cause a little jump on gcc tommorow :)
llvm-svn: 21715 
							
						 
						
							2005-05-06 04:18:52 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7208616ec0 
								
							 
						 
						
							
							
								
								Implement xor.ll:test22  
							
							 
							
							... 
							
							
							
							llvm-svn: 21713 
							
						 
						
							2005-05-06 02:07:39 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4c2d3781aa 
								
							 
						 
						
							
							
								
								implement and.ll:test30 and set.ll:test21  
							
							 
							
							... 
							
							
							
							llvm-svn: 21712 
							
						 
						
							2005-05-06 01:53:19 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								dd1e562ec3 
								
							 
						 
						
							
							
								
								implement or.ll:test20  
							
							 
							
							... 
							
							
							
							llvm-svn: 21709 
							
						 
						
							2005-05-06 00:58:50 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								809dfac421 
								
							 
						 
						
							
							
								
								Instcombine: cast (X != 0) to int, cast (X == 1) to int  -> X iff X has only the low bit set.  
							
							 
							
							... 
							
							
							
							This implements set.ll:test20.
This triggers 2x on povray, 9x on mesa, 11x on gcc, 2x on crafty, 1x on eon,
6x on perlbmk and 11x on m88ksim.
It allows us to compile these two functions into the same code:
struct s { unsigned int bit : 1; };
unsigned foo(struct s *p) {
  if (p->bit)
    return 1;
  else
    return 0;
}
unsigned bar(struct s *p) { return p->bit; }
llvm-svn: 21690 
							
						 
						
							2005-05-04 19:10:26 +00:00  
						
					 
				
					
						
							
							
								 
								John Criswell
							
						 
						
							 
							
							
							
							
								
							
							
								f42ed7bdaf 
								
							 
						 
						
							
							
								
								Fixed a comment.  
							
							 
							
							... 
							
							
							
							llvm-svn: 21653 
							
						 
						
							2005-05-02 14:47:42 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a816eee427 
								
							 
						 
						
							
							
								
								Implement getelementptr.ll:test11  
							
							 
							
							... 
							
							
							
							llvm-svn: 21647 
							
						 
						
							2005-05-01 04:42:15 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a9d84e3388 
								
							 
						 
						
							
							
								
								Check for volatile loads only once.  
							
							 
							
							... 
							
							
							
							Implement load.ll:test7
llvm-svn: 21645 
							
						 
						
							2005-05-01 04:24:53 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								bd43b9db9d 
								
							 
						 
						
							
							
								
								Fix the compile failures from last night.  
							
							 
							
							... 
							
							
							
							llvm-svn: 21565 
							
						 
						
							2005-04-26 14:40:41 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a21bf8d1be 
								
							 
						 
						
							
							
								
								implement getelementptr.ll:test10  
							
							 
							
							... 
							
							
							
							llvm-svn: 21541 
							
						 
						
							2005-04-25 20:17:30 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2f1457fd83 
								
							 
						 
						
							
							
								
								Eliminate cases where we could << by 64, which is undefined in C.  
							
							 
							
							... 
							
							
							
							llvm-svn: 21500 
							
						 
						
							2005-04-24 17:46:05 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d6f636a340 
								
							 
						 
						
							
							
								
								Implement xor.ll:test21:  select (not C), A, B -> select C, B, A  
							
							 
							
							... 
							
							
							
							llvm-svn: 21495 
							
						 
						
							2005-04-24 07:30:14 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d1f46d3bf9 
								
							 
						 
						
							
							
								
								Use getPrimitiveSizeInBits() instead of getPrimitiveSize()*8  
							
							 
							
							... 
							
							
							
							Completely rework the 'setcc (cast x to larger), y' code.  This code has
the advantage of implementing setcc.ll:test19 (being more general than
the previous code) and being correct in all cases.
This allows us to unxfail 2004-11-27-SetCCForCastLargerAndConstant.ll,
and close PR454.
llvm-svn: 21491 
							
						 
						
							2005-04-24 06:59:08 +00:00  
						
					 
				
					
						
							
							
								 
								Jeff Cohen
							
						 
						
							 
							
							
							
							
								
							
							
								82639853c0 
								
							 
						 
						
							
							
								
								Eliminate tabs and trailing spaces  
							
							 
							
							... 
							
							
							
							llvm-svn: 21480 
							
						 
						
							2005-04-23 21:38:35 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								77c32c34d7 
								
							 
						 
						
							
							
								
								Generalize the setcc -> PHI and Select  folding optimizations to work with  
							
							 
							
							... 
							
							
							
							any constant RHS, not just a constant integer RHS.  This implements
select.ll:test17
llvm-svn: 21470 
							
						 
						
							2005-04-23 15:31:55 +00:00  
						
					 
				
					
						
							
							
								 
								Misha Brukman
							
						 
						
							 
							
							
							
							
								
							
							
								b1c9317bb4 
								
							 
						 
						
							
							
								
								Remove trailing whitespace  
							
							 
							
							... 
							
							
							
							llvm-svn: 21427 
							
						 
						
							2005-04-21 23:48:37 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								374e659466 
								
							 
						 
						
							
							
								
								Instcombine this:  
							
							 
							
							... 
							
							
							
							%shortcirc_val = select bool %tmp.1, bool true, bool %tmp.4             ; <bool> [#uses=1]
        %tmp.6 = cast bool %shortcirc_val to int                ; <int> [#uses=1]
into this:
        %shortcirc_val = or bool %tmp.1, %tmp.4         ; <bool> [#uses=1]
        %tmp.6 = cast bool %shortcirc_val to int                ; <int> [#uses=1]
not this:
        %tmp.4.cast = cast bool %tmp.4 to int           ; <int> [#uses=1]
        %tmp.6 = select bool %tmp.1, int 1, int %tmp.4.cast             ; <int> [#uses=1]
llvm-svn: 21389 
							
						 
						
							2005-04-21 05:43:13 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8cb10a1775 
								
							 
						 
						
							
							
								
								Wrap some long lines.  
							
							 
							
							... 
							
							
							
							Make IPSCCP strip off dead constant exprs that are using functions, making
them appear as though their address is taken.  This allows us to propagate
some more pool descriptors, lowering the overhead of pool alloc.
llvm-svn: 21363 
							
						 
						
							2005-04-19 19:16:19 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								5c219469a0 
								
							 
						 
						
							
							
								
								Eliminate a broken transformation, fixing PR548  
							
							 
							
							... 
							
							
							
							llvm-svn: 21354 
							
						 
						
							2005-04-19 06:04:18 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ee84413730 
								
							 
						 
						
							
							
								
								silence a bogus warning  
							
							 
							
							... 
							
							
							
							llvm-svn: 21320 
							
						 
						
							2005-04-18 05:26:21 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								16a50fd0a0 
								
							 
						 
						
							
							
								
								a new simple pass, which will be extended to be more useful in the future.  
							
							 
							
							... 
							
							
							
							This pass forward branches through conditions when it can show that the
conditions is either always true or false for a predecessor.  This currently
only handles the most simple cases of this, but is successful at threading
across 2489 branches and 65 switch instructions in 176.gcc, which isn't bad.
llvm-svn: 21306 
							
						 
						
							2005-04-15 19:28:32 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4236261930 
								
							 
						 
						
							
							
								
								Fix bug: InstCombine/2005-05-07-UDivSelectCrash.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 21152 
							
						 
						
							2005-04-08 04:03:26 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4706046e68 
								
							 
						 
						
							
							
								
								Implement the following xforms:  
							
							 
							
							... 
							
							
							
							(X-Y)-X --> -Y
A + (B - A) --> B
(B - A) + A --> B
llvm-svn: 21138 
							
						 
						
							2005-04-07 17:14:51 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c7f3c1a00e 
								
							 
						 
						
							
							
								
								Implement InstCombine/add.ll:test28, transforming C1-(X+C2) --> (C1-C2)-X.  
							
							 
							
							... 
							
							
							
							This occurs several dozen times in specint2k, particularly in crafty and gcc
apparently.
llvm-svn: 21136 
							
						 
						
							2005-04-07 16:28:01 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a9be4490d8 
								
							 
						 
						
							
							
								
								Transform X-(X+Y) == -Y and X-(Y+X) == -Y  
							
							 
							
							... 
							
							
							
							llvm-svn: 21134 
							
						 
						
							2005-04-07 16:15:25 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ecfa9b5810 
								
							 
						 
						
							
							
								
								disable this transformation in the one obscure case that really pessimizes  
							
							 
							
							... 
							
							
							
							pointer analysis.
llvm-svn: 20916 
							
						 
						
							2005-03-29 06:37:47 +00:00  
						
					 
				
					
						
							
							
								 
								Alkis Evlogimenos
							
						 
						
							 
							
							
							
							
								
							
							
								9ead0d7b4c 
								
							 
						 
						
							
							
								
								Rename createPromoteMemoryToRegister() to  
							
							 
							
							... 
							
							
							
							createPromoteMemoryToRegisterPass() to be consistent with other pass
creation functions.
llvm-svn: 20885 
							
						 
						
							2005-03-28 02:01:12 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								514e843e89 
								
							 
						 
						
							
							
								
								Enhance loopsimplify to preserve alias analysis instead of clobbering it.  
							
							 
							
							... 
							
							
							
							This prevents crashes on some programs when using -ds-aa -licm.
llvm-svn: 20831 
							
						 
						
							2005-03-25 06:37:22 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								faf7791fea 
								
							 
						 
						
							
							
								
								Fix a bug where LICM was not updating AA information properly when sinking  
							
							 
							
							... 
							
							
							
							a pointer value out of a loop causing it to be duplicated.
llvm-svn: 20828 
							
						 
						
							2005-03-25 00:22:36 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1c790bf656 
								
							 
						 
						
							
							
								
								enable -debug-only=licm  
							
							 
							
							... 
							
							
							
							llvm-svn: 20788 
							
						 
						
							2005-03-23 21:00:12 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								531f9e92d4 
								
							 
						 
						
							
							
								
								This mega patch converts us from using Function::a{iterator|begin|end} to  
							
							 
							
							... 
							
							
							
							using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.
This patch is contributed by Gabor Greif, thanks!
llvm-svn: 20597 
							
						 
						
							2005-03-15 04:54:21 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8c79559443 
								
							 
						 
						
							
							
								
								fix a bug where we thought arguments were constants :(  
							
							 
							
							... 
							
							
							
							llvm-svn: 20506 
							
						 
						
							2005-03-06 22:52:29 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2ce303b406 
								
							 
						 
						
							
							
								
								Fix Regression/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll,  
							
							 
							
							... 
							
							
							
							hopefully not breaking too many other things.
llvm-svn: 20505 
							
						 
						
							2005-03-06 22:36:12 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								45403e5052 
								
							 
						 
						
							
							
								
								implement Transforms/LoopStrengthReduce/invariant_value_first_arg.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 20501 
							
						 
						
							2005-03-06 22:06:22 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d3874fad44 
								
							 
						 
						
							
							
								
								minor simplifications of the code.  
							
							 
							
							... 
							
							
							
							llvm-svn: 20497 
							
						 
						
							2005-03-06 21:58:22 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								dd3ec92085 
								
							 
						 
						
							
							
								
								trivial simplification  
							
							 
							
							... 
							
							
							
							llvm-svn: 20494 
							
						 
						
							2005-03-06 21:35:38 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								238f6df546 
								
							 
						 
						
							
							
								
								Fix a bug where we could corrupt a parent loop's header info if we unrolled  
							
							 
							
							... 
							
							
							
							a nested loop.  This fixes Transforms/LoopUnroll/2005-03-06-BadLoopInfoUpdate.ll
and PR532
llvm-svn: 20493 
							
						 
						
							2005-03-06 20:57:32 +00:00  
						
					 
				
					
						
							
							
								 
								Jeff Cohen
							
						 
						
							 
							
							
							
							
								
							
							
								4abcea3a69 
								
							 
						 
						
							
							
								
								Reformat comments to fix 80 columns.  
							
							 
							
							... 
							
							
							
							llvm-svn: 20467 
							
						 
						
							2005-03-05 22:45:40 +00:00  
						
					 
				
					
						
							
							
								 
								Jeff Cohen
							
						 
						
							 
							
							
							
							
								
							
							
								be37fa07fd 
								
							 
						 
						
							
							
								
								Reuse induction variables created for strength-reduced GEPs by other similar GEPs.  
							
							 
							
							... 
							
							
							
							llvm-svn: 20466 
							
						 
						
							2005-03-05 22:40:34 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								cfe2822cdf 
								
							 
						 
						
							
							
								
								Do not compute 1ULL << 64, which is undefined.  This fixes Ptrdist/ks on the  
							
							 
							
							... 
							
							
							
							sparc, and testcase Regression/Transforms/InstCombine/2005-03-04-ShiftOverflow.ll
llvm-svn: 20445 
							
						 
						
							2005-03-04 23:21:33 +00:00  
						
					 
				
					
						
							
							
								 
								Jeff Cohen
							
						 
						
							 
							
							
							
							
								
							
							
								a2c59b7423 
								
							 
						 
						
							
							
								
								Add support for not strength reducing GEPs where the element size is a small  
							
							 
							
							... 
							
							
							
							power of two.  This emphatically includes the zeroeth power of two.
llvm-svn: 20429 
							
						 
						
							2005-03-04 04:04:26 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ef1e989e4f 
								
							 
						 
						
							
							
								
								Add an optional argument to lower to a specific constant value instead of  
							
							 
							
							... 
							
							
							
							to a "sizeof" expression.
llvm-svn: 20414 
							
						 
						
							2005-03-03 01:03:43 +00:00  
						
					 
				
					
						
							
							
								 
								Jeff Cohen
							
						 
						
							 
							
							
							
							
								
							
							
								8ea6f9e821 
								
							 
						 
						
							
							
								
								Fixed the following LSR bugs:  
							
							 
							
							... 
							
							
							
							* Loop invariant code does not dominate the loop header, but rather
    the end of the loop preheader.
  * The base for a reduced GEP isn't a constant unless all of its
    operands (preceding the induction variable) are constant.
  * Allow induction variable elimination for the simple case after all.
Also made changes recommended by Chris for properly deleting
instructions.
llvm-svn: 20383 
							
						 
						
							2005-03-01 03:46:11 +00:00  
						
					 
				
					
						
							
							
								 
								Jeff Cohen
							
						 
						
							 
							
							
							
							
								
							
							
								dcaa48b5c4 
								
							 
						 
						
							
							
								
								Fix crash in LSR due to attempt to remove original induction variable.  However,  
							
							 
							
							... 
							
							
							
							for reasons explained in the comments, I also deactivated this code as it needs
more thought.
llvm-svn: 20367 
							
						 
						
							2005-02-28 00:08:56 +00:00  
						
					 
				
					
						
							
							
								 
								Jeff Cohen
							
						 
						
							 
							
							
							
							
								
							
							
								fd63d3af0d 
								
							 
						 
						
							
							
								
								PHI nodes were incorrectly placed when more than one GEP is reduced in a loop.  
							
							 
							
							... 
							
							
							
							llvm-svn: 20360 
							
						 
						
							2005-02-27 21:08:04 +00:00  
						
					 
				
					
						
							
							
								 
								Jeff Cohen
							
						 
						
							 
							
							
							
							
								
							
							
								39751c3b7c 
								
							 
						 
						
							
							
								
								First pass at improved Loop Strength Reduction.  Still not yet ready for prime time.  
							
							 
							
							... 
							
							
							
							llvm-svn: 20358 
							
						 
						
							2005-02-27 19:37:07 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								52e931b37d 
								
							 
						 
						
							
							
								
								Remove use of bind_obj  
							
							 
							
							... 
							
							
							
							llvm-svn: 20276 
							
						 
						
							2005-02-22 23:22:58 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7b5d9e2217 
								
							 
						 
						
							
							
								
								Do not mark obviously unreachable blocks live when processing PHI nodes,  
							
							 
							
							... 
							
							
							
							and handle incomplete control dependences correctly.  This fixes:
Regression/Transforms/ADCE/dead-phi-edge.ll
  -> a missed optimization
Regression/Transforms/ADCE/dead-phi-edge.ll
  -> a compiler crash distilled from QT4
llvm-svn: 20227 
							
						 
						
							2005-02-17 19:28:49 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								31f3382b3b 
								
							 
						 
						
							
							
								
								Fix the second bug attached to PR504.  
							
							 
							
							... 
							
							
							
							llvm-svn: 20181 
							
						 
						
							2005-02-14 20:11:45 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								e616fea3bc 
								
							 
						 
						
							
							
								
								Fix for testcase Transforms/IndVarsSimplify/2005-02-11-InvokeCrash.ll  
							
							 
							
							... 
							
							
							
							and PR504.
llvm-svn: 20129 
							
						 
						
							2005-02-12 03:26:49 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								82b42c5d85 
								
							 
						 
						
							
							
								
								API change.  
							
							 
							
							... 
							
							
							
							llvm-svn: 19959 
							
						 
						
							2005-02-01 01:23:49 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								72684fecf8 
								
							 
						 
						
							
							
								
								Implement InstCombine/cast.ll:test25, a case that occurs many times  
							
							 
							
							... 
							
							
							
							in spec
llvm-svn: 19953 
							
						 
						
							2005-01-31 05:51:45 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								31f486c775 
								
							 
						 
						
							
							
								
								Implement the trivial cases in InstCombine/store.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 19950 
							
						 
						
							2005-01-31 05:36:43 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								fe1b0b8b24 
								
							 
						 
						
							
							
								
								Implement Transforms/InstCombine/cast-load-gep.ll, which allows us to devirtualize  
							
							 
							
							... 
							
							
							
							11 indirect calls in perlbmk.
llvm-svn: 19947 
							
						 
						
							2005-01-31 04:50:46 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d8e20188c6 
								
							 
						 
						
							
							
								
								Adjust to changes in instruction interfaces.  
							
							 
							
							... 
							
							
							
							llvm-svn: 19900 
							
						 
						
							2005-01-29 00:39:08 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								cd517ff0c7 
								
							 
						 
						
							
							
								
								* add some DEBUG statements  
							
							 
							
							... 
							
							
							
							* Properly compile this:
struct a {};
int test() {
  struct a b[2];
  if (&b[0] != &b[1])
    abort ();
  return 0;
}
to 'return 0', not abort().
llvm-svn: 19875 
							
						 
						
							2005-01-28 19:32:01 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9e2c7facb2 
								
							 
						 
						
							
							
								
								Get rid of a several dozen more and instructions in specint.  
							
							 
							
							... 
							
							
							
							llvm-svn: 19786 
							
						 
						
							2005-01-23 20:26:55 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								fc4429e7c1 
								
							 
						 
						
							
							
								
								Handle comparisons of gep instructions that have different typed indices  
							
							 
							
							... 
							
							
							
							as long as they are the same size.
llvm-svn: 19734 
							
						 
						
							2005-01-21 23:06:49 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								411336fe04 
								
							 
						 
						
							
							
								
								Add two optimizations.  The first folds (X+Y)-X -> Y  
							
							 
							
							... 
							
							
							
							The second folds operations into selects, e.g. (select C, (X+Y), (Y+Z))
-> (Y+(select C, X, Z)
This occurs a few times across spec, e.g.
         select    add/sub
mesa:    83        0
povray:  5         2
gcc      4         2
parser   0         22
perlbmk  13        30
twolf    0         3
llvm-svn: 19706 
							
						 
						
							2005-01-19 21:50:18 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								715364364b 
								
							 
						 
						
							
							
								
								Delete PHI nodes that are not dead but are locked in a cycle of single  
							
							 
							
							... 
							
							
							
							useness.
llvm-svn: 19629 
							
						 
						
							2005-01-17 05:10:15 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								03f06f11aa 
								
							 
						 
						
							
							
								
								Move code out of indentation one level to make it easier to read.  
							
							 
							
							... 
							
							
							
							Disable the xform for < > cases.  It turns out that the following is being
miscompiled:
bool %test(sbyte %S) {
        %T = cast sbyte %S to uint
        %V = setgt uint %T, 255
        ret bool %V
}
llvm-svn: 19628 
							
						 
						
							2005-01-17 03:20:02 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								51726c47fe 
								
							 
						 
						
							
							
								
								Fix some bugs in an xform added yesterday.  This fixes Prolangs-C/allroots.  
							
							 
							
							... 
							
							
							
							llvm-svn: 19553 
							
						 
						
							2005-01-14 17:35:12 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7aa41cfa88 
								
							 
						 
						
							
							
								
								Fix a compile crash on spiff  
							
							 
							
							... 
							
							
							
							llvm-svn: 19552 
							
						 
						
							2005-01-14 17:17:59 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4fa89827e2 
								
							 
						 
						
							
							
								
								if two gep comparisons only differ by one index, compare that index directly.  
							
							 
							
							... 
							
							
							
							This allows us to better optimize begin() -> end() comparisons in common cases.
llvm-svn: 19542 
							
						 
						
							2005-01-14 00:20:05 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d35d210ea0 
								
							 
						 
						
							
							
								
								Do not overrun iterators.  This fixes a 176.gcc crash  
							
							 
							
							... 
							
							
							
							llvm-svn: 19541 
							
						 
						
							2005-01-13 23:26:48 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a04c904c4c 
								
							 
						 
						
							
							
								
								Turn select C, (X+Y), (X-Y) --> (X+(select C, Y, (-Y))).  This occurs in  
							
							 
							
							... 
							
							
							
							the 'sim' program and probably elsewhere.  In sim, it comes up for cases
like this:
#define round(x) ((x)>0.0 ? (x)+0.5 : (x)-0.5)
double G;
void T(double X) { G = round(X); }
(it uses the round macro a lot).  This changes the LLVM code from:
        %tmp.1 = setgt double %X, 0.000000e+00          ; <bool> [#uses=1]
        %tmp.4 = add double %X, 5.000000e-01            ; <double> [#uses=1]
        %tmp.6 = sub double %X, 5.000000e-01            ; <double> [#uses=1]
        %mem_tmp.0 = select bool %tmp.1, double %tmp.4, double %tmp.6
        store double %mem_tmp.0, double* %G
to:
        %tmp.1 = setgt double %X, 0.000000e+00          ; <bool> [#uses=1]
        %mem_tmp.0.p = select bool %tmp.1, double 5.000000e-01, double -5.000000e-01
        %mem_tmp.0 = add double %mem_tmp.0.p, %X
        store double %mem_tmp.0, double* %G
        ret void
llvm-svn: 19537 
							
						 
						
							2005-01-13 22:52:24 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								81e8417614 
								
							 
						 
						
							
							
								
								Implement an optimization for == and != comparisons like this:  
							
							 
							
							... 
							
							
							
							_Bool test2(int X, int Y) {
  return &arr[X][Y] == arr;
}
instead of generating this:
bool %test2(int %X, int %Y) {
        %tmp.3.idx = mul int %X, 160            ; <int> [#uses=1]
        %tmp.3.idx1 = shl int %Y, ubyte 2               ; <int> [#uses=1]
        %tmp.3.offs2 = sub int 0, %tmp.3.idx            ; <int> [#uses=1]
        %tmp.7 = seteq int %tmp.3.idx1, %tmp.3.offs2            ; <bool> [#uses=1]
        ret bool %tmp.7
}
generate this:
bool %test2(int %X, int %Y) {
        seteq int %X, 0         ; <bool>:0 [#uses=1]
        seteq int %Y, 0         ; <bool>:1 [#uses=1]
        %tmp.7 = and bool %0, %1                ; <bool> [#uses=1]
        ret bool %tmp.7
}
This idiom occurs in C++ programs when iterating from begin() to end(),
in a vector or array.  For example, we now compile this:
void test(int X, int Y) {
  for (int *i = arr; i != arr+100; ++i)
    foo(*i);
}
to this:
no_exit:                ; preds = %entry, %no_exit
	...
        %exitcond = seteq uint %indvar.next, 100                ; <bool> [#uses=1]
        br bool %exitcond, label %return, label %no_exit
instead of this:
no_exit:                ; preds = %entry, %no_exit
	...
        %inc5 = getelementptr [100 x [40 x int]]* %arr, int 0, int 0, int %inc.rec              ; <int*> [#uses=1]
        %tmp.8 = seteq int* %inc5, getelementptr ([100 x [40 x int]]* %arr, int 0, int 100, int 0)              ; <bool> [#uses=1]
        %indvar.next = add uint %indvar, 1              ; <uint> [#uses=1]
        br bool %tmp.8, label %return, label %no_exit
llvm-svn: 19536 
							
						 
						
							2005-01-13 22:25:21 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4cb9fa373b 
								
							 
						 
						
							
							
								
								Fix some bugs in code I didn't mean to check in.  
							
							 
							
							... 
							
							
							
							llvm-svn: 19534 
							
						 
						
							2005-01-13 20:40:58 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								0798af33a5 
								
							 
						 
						
							
							
								
								Fix a crash compiling 129.compress  
							
							 
							
							... 
							
							
							
							llvm-svn: 19533 
							
						 
						
							2005-01-13 20:14:25 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								fdfe3e49fe 
								
							 
						 
						
							
							
								
								Fix uint64_t -> unsigned VS warnings.  
							
							 
							
							... 
							
							
							
							llvm-svn: 19381 
							
						 
						
							2005-01-08 19:42:22 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								47f395cd85 
								
							 
						 
						
							
							
								
								Silence VS warnings.  
							
							 
							
							... 
							
							
							
							llvm-svn: 19380 
							
						 
						
							2005-01-08 19:37:20 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ce274ce93d 
								
							 
						 
						
							
							
								
								Silence warnings  
							
							 
							
							... 
							
							
							
							llvm-svn: 19379 
							
						 
						
							2005-01-08 19:34:41 +00:00  
						
					 
				
					
						
							
							
								 
								Jeff Cohen
							
						 
						
							 
							
							
							
							
								
							
							
								677babc4d4 
								
							 
						 
						
							
							
								
								Add more missing createXxxPass functions.  
							
							 
							
							... 
							
							
							
							llvm-svn: 19370 
							
						 
						
							2005-01-08 17:21:40 +00:00  
						
					 
				
					
						
							
							
								 
								Jeff Cohen
							
						 
						
							 
							
							
							
							
								
							
							
								eca0d0f2da 
								
							 
						 
						
							
							
								
								Put createLoopUnswitchPass() into proper namespace  
							
							 
							
							... 
							
							
							
							llvm-svn: 19306 
							
						 
						
							2005-01-06 05:47:18 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								86102b8ad5 
								
							 
						 
						
							
							
								
								This is a bulk commit that implements the following primary improvements:  
							
							 
							
							... 
							
							
							
							* We can now fold cast instructions into select instructions that
    have at least one constant operand.
  * We now optimize expressions more aggressively based on bits that are
    known to be zero.  These optimizations occur a lot in code that uses
    bitfields even in simple ways.
  * We now turn more cast-cast sequences into AND instructions.  Before we
    would only do this if it if all types were unsigned.  Now only the
    middle type needs to be unsigned (guaranteeing a zero extend).
  * We transform sign extensions into zero extensions in several cases.
This corresponds to these test/Regression/Transforms/InstCombine testcases:
  2004-11-22-Missed-and-fold.ll
  and.ll: test28-29
  cast.ll: test21-24
  and-or-and.ll
  cast-cast-to-and.ll
  zeroext-and-reduce.ll
llvm-svn: 19220 
							
						 
						
							2005-01-01 16:22:27 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								13516fe2e7 
								
							 
						 
						
							
							
								
								Fix PR491 and testcase Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 19180 
							
						 
						
							2004-12-29 04:36:02 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b17f3e13ec 
								
							 
						 
						
							
							
								
								Adjust to new interfaces  
							
							 
							
							... 
							
							
							
							llvm-svn: 18958 
							
						 
						
							2004-12-15 07:22:25 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9ad0d55025 
								
							 
						 
						
							
							
								
								Constant exprs are not efficiently negatable in practice.  This disables  
							
							 
							
							... 
							
							
							
							turning X - (constantexpr) into X + (-constantexpr) among other things.
llvm-svn: 18935 
							
						 
						
							2004-12-14 20:08:06 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8f430a3b59 
								
							 
						 
						
							
							
								
								Get rid of getSizeOf, using ConstantExpr::getSizeOf instead.  
							
							 
							
							... 
							
							
							
							do not insert a prototype for malloc of: void* malloc(uint): on 64-bit u
targets this is not correct.  Instead of prototype it as void *malloc(...),
and pass the correct intptr_t through the "...".
Finally, fix Regression/CodeGen/SparcV9/2004-12-13-MallocCrash.ll, by not
forming constantexpr casts from pointer to uint.
llvm-svn: 18908 
							
						 
						
							2004-12-13 20:00:02 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a199e3c1e2 
								
							 
						 
						
							
							
								
								Change indentation of a whole bunch of code, no real changes here.  
							
							 
							
							... 
							
							
							
							llvm-svn: 18843 
							
						 
						
							2004-12-12 23:49:37 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								14d07db44d 
								
							 
						 
						
							
							
								
								More substantial simplifications and speedups.  This makes ADCE about 20% faster  
							
							 
							
							... 
							
							
							
							in some cases.
llvm-svn: 18842 
							
						 
						
							2004-12-12 23:40:17 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9115eb3024 
								
							 
						 
						
							
							
								
								More minor microoptimizations  
							
							 
							
							... 
							
							
							
							llvm-svn: 18841 
							
						 
						
							2004-12-12 22:44:30 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d4298781c1 
								
							 
						 
						
							
							
								
								Remove some more set operations  
							
							 
							
							... 
							
							
							
							llvm-svn: 18840 
							
						 
						
							2004-12-12 22:22:18 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a538439bf0 
								
							 
						 
						
							
							
								
								Reduce number of set operations.  
							
							 
							
							... 
							
							
							
							llvm-svn: 18839 
							
						 
						
							2004-12-12 22:16:13 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								bf5b7cf638 
								
							 
						 
						
							
							
								
								Optimize div/rem + select combinations more.  
							
							 
							
							... 
							
							
							
							In particular, implement div.ll:test10 and rem.ll:test4.
llvm-svn: 18838 
							
						 
						
							2004-12-12 21:48:58 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								88deefa303 
								
							 
						 
						
							
							
								
								Simplify code and do not invalidate iterators.  
							
							 
							
							... 
							
							
							
							This fixes a crash compiling TimberWolfMC that was exposed due to recent
optimizer changes.
llvm-svn: 18831 
							
						 
						
							2004-12-12 18:23:20 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								cbc0161d1f 
								
							 
						 
						
							
							
								
								If one side of and/or is known to be 0/-1, it doesn't matter  
							
							 
							
							... 
							
							
							
							if the other side is overdefined.
This allows us to fold conditions like:  if (X < Y || Y > Z) in some cases.
llvm-svn: 18807 
							
						 
						
							2004-12-11 23:15:19 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2f687fd9d6 
								
							 
						 
						
							
							
								
								Two bug fixes:  
							
							 
							
							... 
							
							
							
							1. Actually increment the Statistic for the GV elim optzn
 2. When resolving undef branches, only resolve branches in executable blocks,
    avoiding marking a bunch of completely dead blocks live.  This has a big
    impact on the quality of the generated code.
With this patch, we positively rip up vortex, compiling Ut_MoveBytes to a
single memcpy call. In vortex we get this:
     12 ipsccp           - Number of globals found to be constant
    986 ipsccp           - Number of arguments constant propagated
   1378 ipsccp           - Number of basic blocks unreachable
   8919 ipsccp           - Number of instructions removed
llvm-svn: 18796 
							
						 
						
							2004-12-11 06:05:53 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8525ebe465 
								
							 
						 
						
							
							
								
								Do not delete the entry block to a function.  
							
							 
							
							... 
							
							
							
							llvm-svn: 18795 
							
						 
						
							2004-12-11 05:32:19 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								91dbae6fee 
								
							 
						 
						
							
							
								
								Implement Transforms/SCCP/ipsccp-gvar.ll, by tracking values stored to  
							
							 
							
							... 
							
							
							
							non-address-taken global variables.
llvm-svn: 18790 
							
						 
						
							2004-12-11 05:15:59 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								99e1295645 
								
							 
						 
						
							
							
								
								Fix a bug where we could delete dead invoke instructions with uses.  
							
							 
							
							... 
							
							
							
							In functions where we fully constant prop the return value, replace all
ret instructions with 'ret undef'.
llvm-svn: 18786 
							
						 
						
							2004-12-11 02:53:57 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								bae4b64553 
								
							 
						 
						
							
							
								
								Implement SCCP/ipsccp-conditional.ll, by totally deleting dead blocks.  
							
							 
							
							... 
							
							
							
							llvm-svn: 18781 
							
						 
						
							2004-12-10 22:29:08 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7285f43836 
								
							 
						 
						
							
							
								
								Fix SCCP/2004-12-10-UndefBranchBug.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 18776 
							
						 
						
							2004-12-10 20:41:50 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b439464c61 
								
							 
						 
						
							
							
								
								This is the initial implementation of IPSCCP, as requested by Brian.  
							
							 
							
							... 
							
							
							
							This implements SCCP/ipsccp-basic.ll, rips apart Olden/mst (as described in
PR415), and does other nice things.
There is still more to come with this, but it's a start.
llvm-svn: 18752 
							
						 
						
							2004-12-10 08:02:06 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								36d39cecb4 
								
							 
						 
						
							
							
								
								note to self: Do not check in debugging code!  
							
							 
							
							... 
							
							
							
							llvm-svn: 18693 
							
						 
						
							2004-12-09 07:15:52 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f17a2fb849 
								
							 
						 
						
							
							
								
								Implement trivial sinking for load instructions.  This causes us to sink 567 loads in spec  
							
							 
							
							... 
							
							
							
							llvm-svn: 18692 
							
						 
						
							2004-12-09 07:14:34 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								39c98bb31c 
								
							 
						 
						
							
							
								
								Do extremely simple sinking of instructions when they are only used in a  
							
							 
							
							... 
							
							
							
							successor block.  This turns cases like this:
x = a op b
if (c) {
  use x
}
into:
if (c) {
  x = a op b
  use x
}
This triggers 3965 times in spec, and is tested by
Regression/Transforms/InstCombine/sink_instruction.ll
This appears to expose a bug in the X86 backend for 177.mesa, which I'm
looking in to.
llvm-svn: 18677 
							
						 
						
							2004-12-08 23:43:58 +00:00  
						
					 
				
					
						
							
							
								 
								Alkis Evlogimenos
							
						 
						
							 
							
							
							
							
								
							
							
								a1291a0679 
								
							 
						 
						
							
							
								
								Fix this regression and remove the XFAIL from this test.  
							
							 
							
							... 
							
							
							
							llvm-svn: 18674 
							
						 
						
							2004-12-08 23:10:30 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8f30caf549 
								
							 
						 
						
							
							
								
								Fix Transforms/InstCombine/2004-12-08-RemInfiniteLoop.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 18670 
							
						 
						
							2004-12-08 22:20:34 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								9273d480ad 
								
							 
						 
						
							
							
								
								For PR387:\  
							
							 
							
							... 
							
							
							
							Add doInitialization method to avoid overloaded virtuals
llvm-svn: 18602 
							
						 
						
							2004-12-07 08:11:36 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a4c9808603 
								
							 
						 
						
							
							
								
								This pass is moving to lib IPO  
							
							 
							
							... 
							
							
							
							llvm-svn: 18439 
							
						 
						
							2004-12-02 21:24:40 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								951673a94c 
								
							 
						 
						
							
							
								
								This pass is completely broken.  
							
							 
							
							... 
							
							
							
							llvm-svn: 18387 
							
						 
						
							2004-11-30 17:09:06 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6e455608e2 
								
							 
						 
						
							
							
								
								Allow hoisting loads of globals and alloca's in conditionals.  
							
							 
							
							... 
							
							
							
							llvm-svn: 18363 
							
						 
						
							2004-11-29 21:26:12 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								279fa256a2 
								
							 
						 
						
							
							
								
								Fix for PR454:  
							
							 
							
							... 
							
							
							
							* Make sure we handle signed to unsigned conversion correctly
* Move this visitSetCondInst case to its own method.
llvm-svn: 18312 
							
						 
						
							2004-11-28 21:31:15 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6ea2888832 
								
							 
						 
						
							
							
								
								Make DSE potentially more aggressive by being more specific about alloca sizes.  
							
							 
							
							... 
							
							
							
							llvm-svn: 18309 
							
						 
						
							2004-11-28 20:44:37 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								14f3cdc227 
								
							 
						 
						
							
							
								
								Implement Regression/Transforms/InstCombine/getelementptr_cast.ll, which  
							
							 
							
							... 
							
							
							
							occurs many times in crafty
llvm-svn: 18273 
							
						 
						
							2004-11-27 17:55:46 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b137409926 
								
							 
						 
						
							
							
								
								Provide size information when checking to see if we can LICM a load, this  
							
							 
							
							... 
							
							
							
							allows us to hoist more loads in some cases.
llvm-svn: 18265 
							
						 
						
							2004-11-26 21:20:09 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								540e5f92b4 
								
							 
						 
						
							
							
								
								Do not count debugger intrinsics in size estimation.  
							
							 
							
							... 
							
							
							
							llvm-svn: 18110 
							
						 
						
							2004-11-22 17:23:57 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6d048a0d32 
								
							 
						 
						
							
							
								
								Do not consider debug intrinsics in the size computations for loop unrolling.  
							
							 
							
							... 
							
							
							
							Patch contributed by Michael McCracken!
llvm-svn: 18108 
							
						 
						
							2004-11-22 17:18:36 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								446948e094 
								
							 
						 
						
							
							
								
								Fix the exposed prototype for the lower packed pass, thanks to  
							
							 
							
							... 
							
							
							
							Morten Ofstad.
llvm-svn: 17996 
							
						 
						
							2004-11-19 16:49:34 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								953075442d 
								
							 
						 
						
							
							
								
								Delete stoppoints that occur for the same source line.  
							
							 
							
							... 
							
							
							
							llvm-svn: 17970 
							
						 
						
							2004-11-18 21:41:39 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c08ac110df 
								
							 
						 
						
							
							
								
								Check in hook that I forgot  
							
							 
							
							... 
							
							
							
							llvm-svn: 17956 
							
						 
						
							2004-11-18 17:24:20 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								27af257ea0 
								
							 
						 
						
							
							
								
								Do not delete dead invoke instructions!  
							
							 
							
							... 
							
							
							
							llvm-svn: 17897 
							
						 
						
							2004-11-16 16:32:28 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								9339638e9c 
								
							 
						 
						
							
							
								
								Remove unused variable for compilation by VC++.  
							
							 
							
							... 
							
							
							
							Patch contributed by Morten Ofstad.
llvm-svn: 17830 
							
						 
						
							2004-11-15 17:29:41 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1890f94413 
								
							 
						 
						
							
							
								
								Minor cleanups.  There is no reason for SCCP to derive from instvisitor anymore.  
							
							 
							
							... 
							
							
							
							llvm-svn: 17825 
							
						 
						
							2004-11-15 07:15:04 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9a038a3a5e 
								
							 
						 
						
							
							
								
								Count more accurately  
							
							 
							
							... 
							
							
							
							llvm-svn: 17824 
							
						 
						
							2004-11-15 07:02:42 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								97013636cd 
								
							 
						 
						
							
							
								
								Quiet warnings on the persephone tester  
							
							 
							
							... 
							
							
							
							llvm-svn: 17821 
							
						 
						
							2004-11-15 05:54:07 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d18c16b842 
								
							 
						 
						
							
							
								
								Two minor improvements:  
							
							 
							
							... 
							
							
							
							1. Speedup getValueState by having it not consider Arguments.  It's better
    to just add them before we start SCCP'ing.
 2. SCCP can delete the contents of dead blocks.  No really, it's ok!  This
    reduces the size of the IR for subsequent passes, even though
    simplifycfg would do the same job.  In practice, simplifycfg does not
    run until much later than sccp in gccas
llvm-svn: 17820 
							
						 
						
							2004-11-15 05:45:33 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4f0316229c 
								
							 
						 
						
							
							
								
								rename InstValue to LatticeValue, as it holds for more than instructions.  
							
							 
							
							... 
							
							
							
							llvm-svn: 17818 
							
						 
						
							2004-11-15 05:03:30 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								074be1f6e4 
								
							 
						 
						
							
							
								
								Substantially refactor the SCCP class into an SCCP pass and an SCCPSolver  
							
							 
							
							... 
							
							
							
							class.  The only changes are minor:
 * Do not try to SCCP instructions that return void in the rewrite loop.
   This is silly and fool hardy, wasting a map lookup and adding an entry
   to the map which is never used.
 * If we decide something has an undefined value, rewrite it to undef,
   potentially leading to further simplications.
llvm-svn: 17816 
							
						 
						
							2004-11-15 04:44:20 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								46dd5a6304 
								
							 
						 
						
							
							
								
								This optimization makes MANY phi nodes that all have the same incoming value.  
							
							 
							
							... 
							
							
							
							If this happens, detect it early instead of relying on instcombine to notice
it later.  This can be a big speedup, because PHI nodes can have many
incoming values.
llvm-svn: 17741 
							
						 
						
							2004-11-14 19:29:34 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7515cabe2a 
								
							 
						 
						
							
							
								
								Implement instcombine/phi.ll:test6 - pulling operations through PHI nodes.  
							
							 
							
							... 
							
							
							
							This exposes subsequent optimization possiblities and reduces code size.
This triggers 1423 times in spec.
llvm-svn: 17740 
							
						 
						
							2004-11-14 19:13:23 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								15ff1e1885 
								
							 
						 
						
							
							
								
								Transform this:  
							
							 
							
							... 
							
							
							
							%X = alloca ...
  %Y = alloca ...
    X == Y
into false.  This allows us to simplify some stuff in eon (and probably
many other C++ programs) where operator= was checking for self assignment.
Folding this allows us to SROA several additional structs.
llvm-svn: 17735 
							
						 
						
							2004-11-14 07:33:16 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								fe3f4e6ebd 
								
							 
						 
						
							
							
								
								Teach SROA how to promote an array index that is variable, if the dimension  
							
							 
							
							... 
							
							
							
							of the array is just two.  This occurs 8 times in gcc, 6 times in crafty, and
12 times in 099.go.
This implements ScalarRepl/sroa_two.ll
llvm-svn: 17727 
							
						 
						
							2004-11-14 05:00:19 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8881912d71 
								
							 
						 
						
							
							
								
								Rearrange some code, no functionality changes.  
							
							 
							
							... 
							
							
							
							llvm-svn: 17724 
							
						 
						
							2004-11-14 04:24:28 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8c3e7b92af 
								
							 
						 
						
							
							
								
								Simplify handling of shifts to be the same as we do for adds.  Add support  
							
							 
							
							... 
							
							
							
							for (X * C1) + (X * C2) (where * can be mul or shl), allowing us to fold:
   Y+Y+Y+Y+Y+Y+Y+Y
into
         %tmp.8 = shl long %Y, ubyte 3           ; <long> [#uses=1]
instead of
        %tmp.4 = shl long %Y, ubyte 2           ; <long> [#uses=1]
        %tmp.12 = shl long %Y, ubyte 2          ; <long> [#uses=1]
        %tmp.8 = add long %tmp.4, %tmp.12               ; <long> [#uses=1]
This implements add.ll:test25
Also add support for (X*C1)-(X*C2) -> X*(C1-C2), implementing sub.ll:test18
llvm-svn: 17704 
							
						 
						
							2004-11-13 19:50:12 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4efe20a103 
								
							 
						 
						
							
							
								
								Fold:  
							
							 
							
							... 
							
							
							
							(X + (X << C2)) --> X * ((1 << C2) + 1)
   ((X << C2) + X) --> X * ((1 << C2) + 1)
This means that we now canonicalize "Y+Y+Y" into:
        %tmp.2 = mul long %Y, 3         ; <long> [#uses=1]
instead of:
        %tmp.10 = shl long %Y, ubyte 1          ; <long> [#uses=1]
        %tmp.6 = add long %Y, %tmp.10               ; <long> [#uses=1]
llvm-svn: 17701 
							
						 
						
							2004-11-13 19:31:40 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2858e17538 
								
							 
						 
						
							
							
								
								Lazily create the abort message, so only translation units that use unwind  
							
							 
							
							... 
							
							
							
							will actually get it.
llvm-svn: 17700 
							
						 
						
							2004-11-13 19:07:32 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								5c1d84c769 
								
							 
						 
						
							
							
								
								Simplify handling of constant initializers  
							
							 
							
							... 
							
							
							
							llvm-svn: 17696 
							
						 
						
							2004-11-12 22:42:57 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								595016d090 
								
							 
						 
						
							
							
								
								This is V9 specific, move it there.  
							
							 
							
							... 
							
							
							
							llvm-svn: 17545 
							
						 
						
							2004-11-07 00:39:26 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								33eb909939 
								
							 
						 
						
							
							
								
								Fix some warnings on VC++  
							
							 
							
							... 
							
							
							
							llvm-svn: 17481 
							
						 
						
							2004-11-05 04:45:43 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								96f6616479 
								
							 
						 
						
							
							
								
								* Rearrange code slightly  
							
							 
							
							... 
							
							
							
							* Disable broken transforms for simplifying (setcc (cast X to larger), CI)
  where CC is not != or ==
llvm-svn: 17422 
							
						 
						
							2004-11-02 03:50:32 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8af7424920 
								
							 
						 
						
							
							
								
								Speed up the tail duplication pass on the testcase below from 68.2s to 1.23s:  
							
							 
							
							... 
							
							
							
							#define CL0(a) case a: f(); goto c;
 #define CL1(a) CL0(a##0) CL0(a##1) CL0(a##2) CL0(a##3) CL0(a##4) CL0(a##5) \
 CL0(a##6) CL0(a##7) CL0(a##8) CL0(a##9)
 #define CL2(a) CL1(a##0) CL1(a##1) CL1(a##2) CL1(a##3) CL1(a##4) CL1(a##5) \
 CL1(a##6) CL1(a##7) CL1(a##8) CL1(a##9)
 #define CL3(a) CL2(a##0) CL2(a##1) CL2(a##2) CL2(a##3) CL2(a##4) CL2(a##5) \
 CL2(a##6) CL2(a##7) CL2(a##8) CL2(a##9)
 #define CL4(a) CL3(a##0) CL3(a##1) CL3(a##2) CL3(a##3) CL3(a##4) CL3(a##5) \
 CL3(a##6) CL3(a##7) CL3(a##8) CL3(a##9)
 void f();
 void a() {
     int b;
  c: switch (b) {
         CL4(1)
     }
 }
This comes from GCC PR 15524
llvm-svn: 17390 
							
						 
						
							2004-11-01 07:05:07 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								57cbe39d1e 
								
							 
						 
						
							
							
								
								Change Library Names Not To Conflict With Others When Installed  
							
							 
							
							... 
							
							
							
							llvm-svn: 17286 
							
						 
						
							2004-10-27 23:18:45 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7dfc2d29ac 
								
							 
						 
						
							
							
								
								Convert 'struct' to 'class' in various places to adhere to the coding standards  
							
							 
							
							... 
							
							
							
							and work better with VC++.  Patch contributed by Morten Ofstad!
llvm-svn: 17281 
							
						 
						
							2004-10-27 16:14:51 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								70c2039b39 
								
							 
						 
						
							
							
								
								Hrm, this code was severely botched.  As it turns out, this patch:  
							
							 
							
							... 
							
							
							
							http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041018/019708.html 
exposed ANOTHER latent bug in this xform, which caused Prolangs-C/bison to fill
the zion nightly tester disk up and make the tester barf.
This is obviously not a good thing, so lets fix this bug shall we? :)
llvm-svn: 17276 
							
						 
						
							2004-10-27 05:57:15 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								845afe9b20 
								
							 
						 
						
							
							
								
								Initialize with the correct constant type  
							
							 
							
							... 
							
							
							
							llvm-svn: 17270 
							
						 
						
							2004-10-27 03:55:24 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d57638c4a7 
								
							 
						 
						
							
							
								
								Fix compatibility with MSVC, patch by Morten Ofstad  
							
							 
							
							... 
							
							
							
							llvm-svn: 17218 
							
						 
						
							2004-10-25 18:45:16 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								5c3c21e10a 
								
							 
						 
						
							
							
								
								Fix a bug Nate noticed, where we miscompiled a simple testcase  
							
							 
							
							... 
							
							
							
							llvm-svn: 17157 
							
						 
						
							2004-10-22 04:53:16 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								c1c320c335 
								
							 
						 
						
							
							
								
								We won't use automake  
							
							 
							
							... 
							
							
							
							llvm-svn: 17155 
							
						 
						
							2004-10-22 03:35:04 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								257b284038 
								
							 
						 
						
							
							
								
								Hrm, some people complain when the compiler cheerfully tells them what it's  
							
							 
							
							... 
							
							
							
							doing... I guess they're right.
llvm-svn: 17142 
							
						 
						
							2004-10-19 06:33:16 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								6a11a75f31 
								
							 
						 
						
							
							
								
								Initial automake generated Makefile template  
							
							 
							
							... 
							
							
							
							llvm-svn: 17136 
							
						 
						
							2004-10-18 23:55:41 +00:00  
						
					 
				
					
						
							
							
								 
								Nate Begeman
							
						 
						
							 
							
							
							
							
								
							
							
								b18121e6a9 
								
							 
						 
						
							
							
								
								Initial implementation of the strength reduction for GEP instructions in  
							
							 
							
							... 
							
							
							
							loops.  This optimization is not turned on by default yet, but may be run
with the opt tool's -loop-reduce flag.  There are many FIXMEs listed in the
code that will make it far more applicable to a wide range of code, but you
have to start somewhere :)
This limited version currently triggers on the following tests in the
MultiSource directory:
pcompress2: 7 times
cfrac: 5 times
anagram: 2 times
ks: 6 times
yacr2: 2 times
llvm-svn: 17134 
							
						 
						
							2004-10-18 21:08:22 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								ce0783318b 
								
							 
						 
						
							
							
								
								Correction to allow compilation with Visual C++.  
							
							 
							
							... 
							
							
							
							Patch contributed by Morten Ofstad. Thanks Morten!
llvm-svn: 17123 
							
						 
						
							2004-10-18 14:38:48 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a67dd32004 
								
							 
						 
						
							
							
								
								Turn store -> null/undef into the LLVM unreachable instruction!  This simple  
							
							 
							
							... 
							
							
							
							change hacks off 10K of bytecode from perlbmk (.5%) even though the front-end
is not generating them yet and we are not optimizing the resultant code.
This isn't too bad.
llvm-svn: 17111 
							
						 
						
							2004-10-18 03:00:50 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8ba9ec9bbb 
								
							 
						 
						
							
							
								
								Turn things with obviously undefined semantics into 'store -> null'  
							
							 
							
							... 
							
							
							
							llvm-svn: 17110 
							
						 
						
							2004-10-18 02:59:09 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3b92f17165 
								
							 
						 
						
							
							
								
								My friend the invoke instruction does not dominate all basic blocks if it  
							
							 
							
							... 
							
							
							
							occurs in the entry node of a function
llvm-svn: 17109 
							
						 
						
							2004-10-18 01:48:31 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6a792feb02 
								
							 
						 
						
							
							
								
								Getting ADCE to interact well with unreachable instructions seems like a nontrivial  
							
							 
							
							... 
							
							
							
							exercise that I'm not interested in tackling right now.  Just punt and treat them
like unwind's.
This 'fixes' test/Regression/Transforms/ADCE/unreachable-function.ll
llvm-svn: 17106 
							
						 
						
							2004-10-17 23:45:06 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								107c15c33d 
								
							 
						 
						
							
							
								
								Remove printout, realize that instructions in the entry block dominate all  
							
							 
							
							... 
							
							
							
							other blocks.
llvm-svn: 17099 
							
						 
						
							2004-10-17 21:31:34 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								e29d634a94 
								
							 
						 
						
							
							
								
								hasConstantValue will soon return instructions that don't dominate the PHI node,  
							
							 
							
							... 
							
							
							
							so prepare for this.
llvm-svn: 17095 
							
						 
						
							2004-10-17 21:22:38 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								67f0545daf 
								
							 
						 
						
							
							
								
								Fix a type violation  
							
							 
							
							... 
							
							
							
							llvm-svn: 17069 
							
						 
						
							2004-10-16 23:28:04 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								684c5c6587 
								
							 
						 
						
							
							
								
								Kill the bogon that slipped into my buffer before I committed.  
							
							 
							
							... 
							
							
							
							llvm-svn: 17067 
							
						 
						
							2004-10-16 19:46:33 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6580e09fef 
								
							 
						 
						
							
							
								
								Implement InstCombine/getelementptr.ll:test9, which is the source of many  
							
							 
							
							... 
							
							
							
							ugly and giant constnat exprs in some programs.
llvm-svn: 17066 
							
						 
						
							2004-10-16 19:44:59 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								81a7a23494 
								
							 
						 
						
							
							
								
								Optimize instructions involving undef values.  For example X+undef == undef.  
							
							 
							
							... 
							
							
							
							llvm-svn: 17047 
							
						 
						
							2004-10-16 18:11:37 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								646354bae1 
								
							 
						 
						
							
							
								
								Handle undef values as undefined on the constant lattice  
							
							 
							
							... 
							
							
							
							ignore unreachable instructions
llvm-svn: 17044 
							
						 
						
							2004-10-16 18:09:41 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6ac3ef950d 
								
							 
						 
						
							
							
								
								Add note  
							
							 
							
							... 
							
							
							
							llvm-svn: 17043 
							
						 
						
							2004-10-16 18:09:25 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								ace94df71f 
								
							 
						 
						
							
							
								
								Update to reflect changes in Makefile rules.  
							
							 
							
							... 
							
							
							
							llvm-svn: 16950 
							
						 
						
							2004-10-13 11:46:52 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								00648e1f86 
								
							 
						 
						
							
							
								
								Transform memmove -> memcpy when the source is obviously constant memory.  
							
							 
							
							... 
							
							
							
							llvm-svn: 16932 
							
						 
						
							2004-10-12 04:52:52 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7cabf6f87a 
								
							 
						 
						
							
							
								
								Fix a REALLY obscure bug in my previous checkin, which was splicing the END  
							
							 
							
							... 
							
							
							
							marker from one ilist into the middle of another basic block!
llvm-svn: 16925 
							
						 
						
							2004-10-12 01:02:29 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9776f7259b 
								
							 
						 
						
							
							
								
								Handle a common case more carefully.  In particular, instead of transforming  
							
							 
							
							... 
							
							
							
							pointer recurrences into expressions from this:
  %P_addr.0.i.0 = phi sbyte* [ getelementptr ([8 x sbyte]* %.str_1, int 0, int 0), %entry ], [ %inc.0.i, %no_exit.i ]
  %inc.0.i = getelementptr sbyte* %P_addr.0.i.0, int 1            ; <sbyte*> [#uses=2]
into this:
  %inc.0.i = getelementptr sbyte* getelementptr ([8 x sbyte]* %.str_1, int 0, int 0), int %inc.0.i.rec
Actually create something nice, like this:
  %inc.0.i = getelementptr [8 x sbyte]* %.str_1, int 0, int %inc.0.i.rec
llvm-svn: 16924 
							
						 
						
							2004-10-11 23:06:50 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a92af96c56 
								
							 
						 
						
							
							
								
								Reenable the transform, turning X/-10 < 1 into X > -10  
							
							 
							
							... 
							
							
							
							llvm-svn: 16918 
							
						 
						
							2004-10-11 19:40:04 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								97327f05fc 
								
							 
						 
						
							
							
								
								Initial version of automake Makefile.am file.  
							
							 
							
							... 
							
							
							
							llvm-svn: 16893 
							
						 
						
							2004-10-10 22:20:40 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								5c91c8f18b 
								
							 
						 
						
							
							
								
								Use DEBUG instead of DebugFlag directly, as DebugFlag does not respect  
							
							 
							
							... 
							
							
							
							-debug-only!
llvm-svn: 16868 
							
						 
						
							2004-10-09 19:30:36 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4ad08352b4 
								
							 
						 
						
							
							
								
								Implement sub.ll:test17, -X/C -> X/-C  
							
							 
							
							... 
							
							
							
							llvm-svn: 16863 
							
						 
						
							2004-10-09 02:50:40 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								0b41e861b6 
								
							 
						 
						
							
							
								
								Temporarily disable a buggy transformation until it can be fixed.  This fixes  
							
							 
							
							... 
							
							
							
							254.gap.
llvm-svn: 16853 
							
						 
						
							2004-10-08 19:15:44 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								bff91d9a2e 
								
							 
						 
						
							
							
								
								Instcombine (X & FF00) + xx00  -> (X+xx00) & FF00, implementing and.ll:test27  
							
							 
							
							... 
							
							
							
							This comes up when doing adds to bitfield elements.
llvm-svn: 16836 
							
						 
						
							2004-10-08 05:07:56 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								44bd392cbf 
								
							 
						 
						
							
							
								
								Little patch to turn (shl (add X, 123), 4) -> (add (shl X, 4), 123 << 4)  
							
							 
							
							... 
							
							
							
							This triggers in cases of bitfield additions, opening opportunities for
future improvements.
llvm-svn: 16834 
							
						 
						
							2004-10-08 03:46:20 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								0aee4b7947 
								
							 
						 
						
							
							
								
								Instcombine: -(X sdiv C)  -> (X sdiv -C), tested by sub.ll:test16  
							
							 
							
							... 
							
							
							
							llvm-svn: 16769 
							
						 
						
							2004-10-06 15:08:25 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2ce32df8b0 
								
							 
						 
						
							
							
								
								Reduce code growth implied by the tail duplication pass by not duplicating  
							
							 
							
							... 
							
							
							
							an instruction if it can be hoisted to a common dominator of the block.
This implements: test/Regression/Transforms/TailDup/MergeTest.ll
llvm-svn: 16758 
							
						 
						
							2004-10-06 03:27:37 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								abae776b18 
								
							 
						 
						
							
							
								
								Hrm, debugging printouts do not need to be in here  
							
							 
							
							... 
							
							
							
							llvm-svn: 16598 
							
						 
						
							2004-09-29 21:21:14 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6862fbd2cf 
								
							 
						 
						
							
							
								
								* Pull range optimization code out into new InsertRangeTest function.  
							
							 
							
							... 
							
							
							
							* SubOne/AddOne functions always return ConstantInt, declare them as such
* Pull code for handling setcc X, cst, where cst is at the end of the range,
  or cc is LE or GE up earlier in visitSetCondInst.  This reduces #iterations
  in some cases.
* Fold: (div X, C1) op C2 -> range check, implementing div.ll:test6 - test9.
llvm-svn: 16588 
							
						 
						
							2004-09-29 17:40:11 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6a4adcda4c 
								
							 
						 
						
							
							
								
								Fold binary expressions and casts into PHI nodes that have all constant inputs.  
							
							 
							
							... 
							
							
							
							This takes something like this:
%A = phi int [ 3, %cond_false.0 ], [ 2, %endif.0.i ], [ 2, %endif.1.i ]
%B = div int %tmp.243, 4
and turns it into:
%A = phi int [ 3/4, %cond_false.0 ], [ 2/4, %endif.0.i ], [ 2/4, %endif.1.i ]
which is later simplified (in this case) into %A = 0.
This triggers thousands of times in spec, for example, 269 times in 176.gcc.
This is tested by InstCombine/add.ll:test23 and set.ll:test18.
llvm-svn: 16582 
							
						 
						
							2004-09-29 05:07:12 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c949128b2f 
								
							 
						 
						
							
							
								
								Hrm, really, all tests passed without this, but it is scary to think how...  
							
							 
							
							... 
							
							
							
							llvm-svn: 16568 
							
						 
						
							2004-09-29 03:16:24 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								be7a69ebd8 
								
							 
						 
						
							
							
								
								Remove debugging printout  
							
							 
							
							... 
							
							
							
							Instcombine (setcc (truncate X), C1).
This occurs THOUSANDS of times in many benchmarks.  Particularlly common
seem to be things like (seteq (cast bool X to int), int 0)
This turns it into (seteq bool %X, false), which then becomes (not %X).
llvm-svn: 16567 
							
						 
						
							2004-09-29 03:09:18 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								dcf756ec22 
								
							 
						 
						
							
							
								
								Fold (X setcc C1) | (X setcc C2)  
							
							 
							
							... 
							
							
							
							This implements or.ll:test1[89]
llvm-svn: 16561 
							
						 
						
							2004-09-28 22:33:08 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								623826c888 
								
							 
						 
						
							
							
								
								Fold (and (setcc X, C1), (setcc X, C2))  
							
							 
							
							... 
							
							
							
							This is important for several reasons:
1. Benchmarks have lots of code that looks like this (perlbmk in particular):
  %tmp.2.i = setne int %tmp.0.i, 128              ; <bool> [#uses=1]
  %tmp.6343 = seteq int %tmp.0.i, 1               ; <bool> [#uses=1]
  %tmp.63 = and bool %tmp.2.i, %tmp.6343          ; <bool> [#uses=1]
   we now fold away the setne, a clear improvement.
2. In the more important cases, such as (X >= 10) & (X < 20), we now produce
   smaller code: (X-10) < 10.
3. Perhaps the nicest effect of this patch is that it really helps out the
   code generators.  In particular, for a 'range test' like the above,
   instead of generating this on X86 (the difference on PPC is even more
   pronounced):
        cmp %EAX, 50
        setge %CL
        cmp %EAX, 100
        setl %AL
        and %CL, %AL
        cmp %CL, 0
   we now generate this:
        add %EAX, -50
        cmp %EAX, 50
   Furthermore, this causes setcc's to be folded into branches more often.
These combinations trigger dozens of times in the spec benchmarks, particularly
in 176.gcc, 186.crafty, 253.perlbmk, 254.gap, & 099.go.
llvm-svn: 16559 
							
						 
						
							2004-09-28 21:48:02 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								272d5ca9e0 
								
							 
						 
						
							
							
								
								Implement X / C1 / C2 folding  
							
							 
							
							... 
							
							
							
							Implement (setcc (shl X, C1), C2) folding.
The second one occurs several dozen times in spec.  The first was added
just in case.  :)
These are tested by shift.ll:test2[12], and div.ll:test5
llvm-svn: 16549 
							
						 
						
							2004-09-28 18:22:15 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6afc02f816 
								
							 
						 
						
							
							
								
								shl is always zero extending, so always use a zero extending shift right.  
							
							 
							
							... 
							
							
							
							This latent bug was exposed by recent changes, and is tested as:
llvm/test/Regression/Transforms/InstCombine/2004-09-28-BadShiftAndSetCC.llx
llvm-svn: 16546 
							
						 
						
							2004-09-28 17:54:07 +00:00  
						
					 
				
					
						
							
							
								 
								Alkis Evlogimenos
							
						 
						
							 
							
							
							
							
								
							
							
								3ce42ec7ee 
								
							 
						 
						
							
							
								
								Pull assignment out of for loop conditional in order for this to  
							
							 
							
							... 
							
							
							
							compile under windows. Patch contributed by Paolo Invernizzi!
llvm-svn: 16534 
							
						 
						
							2004-09-28 02:40:37 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								bfff18a869 
								
							 
						 
						
							
							
								
								Fix two bugs: one where a condition was mistakenly swapped, and another  
							
							 
							
							... 
							
							
							
							where we folded (X & 254) -> X < 1 instead of X < 2.  These problems were
latent problems exposed by the latest patch.
llvm-svn: 16528 
							
						 
						
							2004-09-27 19:29:18 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1023b8726e 
								
							 
						 
						
							
							
								
								Fold: (setcc (shr X, ShAmt), CI), where 'cc' is eq or ne.  This xform  
							
							 
							
							... 
							
							
							
							triggers often, for example:
6x in povray, 1x in gzip, 279x in gcc, 1x in crafty, 8x in eon, 11x in perlbmk,
362x in gap, 4x in vortex, 14 in m88ksim, 211x in 126.gcc, 1x in compress,
11x in ijpeg, and 4x in 147.vortex.
llvm-svn: 16521 
							
						 
						
							2004-09-27 16:18:50 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7e794273f5 
								
							 
						 
						
							
							
								
								Implement shift-and combinations, implementing InstCombine/and.ll:test19-21  
							
							 
							
							... 
							
							
							
							These combinations trigger 4 times in povray, 7x in gcc, 4x in gap, and 2x in bzip2.
llvm-svn: 16508 
							
						 
						
							2004-09-24 15:21:34 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								e1b4d2a470 
								
							 
						 
						
							
							
								
								Move LHSI->hasOneUse() into the arms of the conditional, reindenting code.  
							
							 
							
							... 
							
							
							
							No functionality changes here.
llvm-svn: 16505 
							
						 
						
							2004-09-23 21:52:49 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8fc5af4da9 
								
							 
						 
						
							
							
								
								Implement Transforms/InstCombine/and.ll:test18, a case that occurs 20 times  
							
							 
							
							... 
							
							
							
							in perlbmk
llvm-svn: 16504 
							
						 
						
							2004-09-23 21:46:38 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								bdcf41a8a2 
								
							 
						 
						
							
							
								
								Implement select.ll:test16: fold   load (select C, X, null)  -> load X  
							
							 
							
							... 
							
							
							
							llvm-svn: 16499 
							
						 
						
							2004-09-23 15:46:00 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b121ae1cec 
								
							 
						 
						
							
							
								
								Do not fold (X + C1 != C2) if there are other users of the add.  Doing  
							
							 
							
							... 
							
							
							
							this transformation used to take a loop like this:
int Array[1000];
void test(int X) {
  int i;
  for (i = 0; i < 1000; ++i)
    Array[i] += X;
}
Compiled to LLVM is:
no_exit:                ; preds = %entry, %no_exit
        %indvar = phi uint [ 0, %entry ], [ %indvar.next, %no_exit ]            ; <uint> [#uses=2]
        %tmp.4 = getelementptr [1000 x int]* %Array, int 0, uint %indvar                ; <int*> [#uses=2]
        %tmp.7 = load int* %tmp.4               ; <int> [#uses=1]
        %tmp.9 = add int %tmp.7, %X             ; <int> [#uses=1]
        store int %tmp.9, int* %tmp.4
***     %indvar.next = add uint %indvar, 1              ; <uint> [#uses=2]
***     %exitcond = seteq uint %indvar.next, 1000               ; <bool> [#uses=1]
        br bool %exitcond, label %return, label %no_exit
and turn it into a loop like this:
no_exit:                ; preds = %entry, %no_exit
        %indvar = phi uint [ 0, %entry ], [ %indvar.next, %no_exit ]            ; <uint> [#uses=3]
        %tmp.4 = getelementptr [1000 x int]* %Array, int 0, uint %indvar                ; <int*> [#uses=2]
        %tmp.7 = load int* %tmp.4               ; <int> [#uses=1]
        %tmp.9 = add int %tmp.7, %X             ; <int> [#uses=1]
        store int %tmp.9, int* %tmp.4
***     %indvar.next = add uint %indvar, 1              ; <uint> [#uses=1]
***     %exitcond = seteq uint %indvar, 999             ; <bool> [#uses=1]
        br bool %exitcond, label %return, label %no_exit
Note that indvar.next and indvar can no longer be coallesced.  In machine
code terms, this patch changes this code:
.LBBtest_1:     # no_exit
        mov %EDX, OFFSET Array
        mov %ESI, %EAX
        add %ESI, DWORD PTR [%EDX + 4*%ECX]
        mov %EDX, OFFSET Array
        mov DWORD PTR [%EDX + 4*%ECX], %ESI
        mov %EDX, %ECX
        inc %EDX
        cmp %ECX, 999
        mov %ECX, %EDX
        jne .LBBtest_1  # no_exit
into this:
.LBBtest_1:     # no_exit
        mov %EDX, OFFSET Array
        mov %ESI, %EAX
        add %ESI, DWORD PTR [%EDX + 4*%ECX]
        mov %EDX, OFFSET Array
        mov DWORD PTR [%EDX + 4*%ECX], %ESI
        inc %ECX
        cmp %ECX, 1000
        jne .LBBtest_1  # no_exit
We need better instruction selection to get this:
.LBBtest_1:     # no_exit
        add DWORD PTR [Array + 4*%ECX], EAX
        inc %ECX
        cmp %ECX, 1000
        jne .LBBtest_1  # no_exit
... but at least there is less register juggling
llvm-svn: 16473 
							
						 
						
							2004-09-21 21:35:23 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								42618551d5 
								
							 
						 
						
							
							
								
								Fix potential miscompilations: InstCombine/2004-09-20-BadLoadCombine*.llx  
							
							 
							
							... 
							
							
							
							llvm-svn: 16447 
							
						 
						
							2004-09-20 10:15:10 +00:00  
						
					 
				
					
						
							
							
								 
								Alkis Evlogimenos
							
						 
						
							 
							
							
							
							
								
							
							
								d59cebf87a 
								
							 
						 
						
							
							
								
								Fix loop condition so that we don't decrement off the beginning of the  
							
							 
							
							... 
							
							
							
							list.
llvm-svn: 16440 
							
						 
						
							2004-09-20 06:42:58 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3e86084641 
								
							 
						 
						
							
							
								
								Prototype these functions more accurately  
							
							 
							
							... 
							
							
							
							llvm-svn: 16432 
							
						 
						
							2004-09-20 04:43:15 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								e6f13093e6 
								
							 
						 
						
							
							
								
								Make isSafeToLoadUnconditionally a bit smarter, implementing PR362 and  
							
							 
							
							... 
							
							
							
							Regression/Transforms/InstCombine/CPP_min_max.llx
llvm-svn: 16409 
							
						 
						
							2004-09-19 19:18:10 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f62ea8ef4b 
								
							 
						 
						
							
							
								
								Make instruction combining a bit more aggressive in the face of volatile  
							
							 
							
							... 
							
							
							
							loads, and implement two new transforms: InstCombine/load.ll:test[56].
llvm-svn: 16404 
							
						 
						
							2004-09-19 18:43:46 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								6614946443 
								
							 
						 
						
							
							
								
								Convert code to compile with vc7.1.  
							
							 
							
							... 
							
							
							
							Patch contributed by Paolo Invernizzi. Thanks Paolo!
llvm-svn: 16368 
							
						 
						
							2004-09-15 17:06:42 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f11216d24f 
								
							 
						 
						
							
							
								
								Fix a bug in the previous checkin that broke 255.vortex  
							
							 
							
							... 
							
							
							
							llvm-svn: 16355 
							
						 
						
							2004-09-15 02:34:40 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a346578d92 
								
							 
						 
						
							
							
								
								Make sure to update alias analysis information as we transform the function.  
							
							 
							
							... 
							
							
							
							This fixes PR420 and Regression/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.llx
llvm-svn: 16348 
							
						 
						
							2004-09-15 01:04:07 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f41b80a05f 
								
							 
						 
						
							
							
								
								Remove a long-dead pass.  Actually, this pass was never used at all.  
							
							 
							
							... 
							
							
							
							llvm-svn: 16337 
							
						 
						
							2004-09-14 16:33:01 +00:00  
						
					 
				
					
						
							
							
								 
								Alkis Evlogimenos
							
						 
						
							 
							
							
							
							
								
							
							
								a5c04ee50f 
								
							 
						 
						
							
							
								
								Fixes to make LLVM compile with vc7.1.  
							
							 
							
							... 
							
							
							
							Patch contributed by Paolo Invernizzi!
llvm-svn: 16152 
							
						 
						
							2004-09-03 18:19:51 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								7c16caa336 
								
							 
						 
						
							
							
								
								Changes For Bug 352  
							
							 
							
							... 
							
							
							
							Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.
llvm-svn: 16137 
							
						 
						
							2004-09-01 22:55:40 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								f39f66e3ef 
								
							 
						 
						
							
							
								
								Initial checkin of a pass to lower packed operations to scalars operations.  
							
							 
							
							... 
							
							
							
							This also registers the pass with opt with a -lower-packed command line
option.
Patch contributed by Brad Jones.
llvm-svn: 15987 
							
						 
						
							2004-08-21 21:39:24 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4456da6a4c 
								
							 
						 
						
							
							
								
								Fix InstCombine/2004-08-10-BoolSetCC.ll, a bug that is miscompiling  
							
							 
							
							... 
							
							
							
							176.gcc.  Note that this is apparently not the only bug miscompiling gcc
though. :(
llvm-svn: 15639 
							
						 
						
							2004-08-11 00:50:51 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8e7260652b 
								
							 
						 
						
							
							
								
								Fix InstCombine/2004-08-09-RemInfLoop.llx  
							
							 
							
							... 
							
							
							
							This should go into the 1.3 branch
llvm-svn: 15593 
							
						 
						
							2004-08-09 21:05:48 +00:00  
						
					 
				
					
						
							
							
								 
								Alkis Evlogimenos
							
						 
						
							 
							
							
							
							
								
							
							
								832437255d 
								
							 
						 
						
							
							
								
								Stop using getValues().  
							
							 
							
							... 
							
							
							
							llvm-svn: 15487 
							
						 
						
							2004-08-04 08:44:43 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7aa2d4747a 
								
							 
						 
						
							
							
								
								Fix a regression in InstCombine/xor.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 15410 
							
						 
						
							2004-08-01 19:42:59 +00:00  
						
					 
				
					
						
							
							
								 
								Misha Brukman
							
						 
						
							 
							
							
							
							
								
							
							
								9c003d8f65 
								
							 
						 
						
							
							
								
								Fix De Morgan's name.  
							
							 
							
							... 
							
							
							
							llvm-svn: 15343 
							
						 
						
							2004-07-30 12:50:08 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d4252a7c64 
								
							 
						 
						
							
							
								
								Start using the PatternMatcher a bit.  
							
							 
							
							... 
							
							
							
							llvm-svn: 15342 
							
						 
						
							2004-07-30 07:50:03 +00:00  
						
					 
				
					
						
							
							
								 
								Misha Brukman
							
						 
						
							 
							
							
							
							
								
							
							
								63b38bd2ed 
								
							 
						 
						
							
							
								
								Fix #includes of i*.h => Instructions.h as per PR403.  
							
							 
							
							... 
							
							
							
							llvm-svn: 15334 
							
						 
						
							2004-07-29 17:30:56 +00:00  
						
					 
				
					
						
							
							
								 
								Misha Brukman
							
						 
						
							 
							
							
							
							
								
							
							
								2b3387a6d9 
								
							 
						 
						
							
							
								
								Fix #includes of i*.h => Instructions.h as per PR403.  
							
							 
							
							... 
							
							
							
							llvm-svn: 15328 
							
						 
						
							2004-07-29 17:05:13 +00:00  
						
					 
				
					
						
							
							
								 
								Robert Bocchino
							
						 
						
							 
							
							
							
							
								
							
							
								7b5b86cd0f 
								
							 
						 
						
							
							
								
								This change fixed a bug in the function visitMul.  The prior version  
							
							 
							
							... 
							
							
							
							assumed that a constant on the RHS of a multiplication was either an
IntConstant or an FPConstant.  It checked for an IntConstant and then,
if it did not find one, did a hard cast to an FPConstant.  That code
would crash if the RHS were a ConstantExpr that was neither an
IntConstant nor an FPConstant.  This version replaces the hard cast
with a dyn_cast.  It performs the same way for IntConstants and
FPConstants but does nothing, instead of crashing, for constant
expressions.
The regression test for this change is 2004-07-27-ConstantExprMul.ll.
llvm-svn: 15291 
							
						 
						
							2004-07-27 21:02:21 +00:00  
						
					 
				
					
						
							
							
								 
								Brian Gaeke
							
						 
						
							 
							
							
							
							
								
							
							
								38b79e8fbc 
								
							 
						 
						
							
							
								
								Make the create...() functions for some of these passes return a FunctionPass *.  
							
							 
							
							... 
							
							
							
							llvm-svn: 15276 
							
						 
						
							2004-07-27 17:43:21 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								50eb771d37 
								
							 
						 
						
							
							
								
								Fix hoisting of void typed values, e.g. calls  
							
							 
							
							... 
							
							
							
							llvm-svn: 15263 
							
						 
						
							2004-07-27 07:38:32 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f29807169a 
								
							 
						 
						
							
							
								
								Implement DeadStoreElim/alloca.llx by observing that allocas are dead at the  
							
							 
							
							... 
							
							
							
							end of the function (either return or unwind)
llvm-svn: 15232 
							
						 
						
							2004-07-26 06:14:11 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								e5ad26dbb3 
								
							 
						 
						
							
							
								
								Throttle back indvar substitution from creating multiplies in loops.  This is bad bad bad.  
							
							 
							
							... 
							
							
							
							llvm-svn: 15227 
							
						 
						
							2004-07-26 02:47:12 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7b25bcdf52 
								
							 
						 
						
							
							
								
								* Substantially simplify how free instructions are handled (potentially fixing  
							
							 
							
							... 
							
							
							
							a bug in DSE).
* Delete dead operand uses iteratively instead of recursively, using a
  SetVector.
* Defer deletion of dead operand uses until the end of processing, which means
  we don't have to bother with updating the AliasSetTracker.  This speeds up
  DSE substantially.
llvm-svn: 15204 
							
						 
						
							2004-07-25 11:09:56 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4c1c1ac7e4 
								
							 
						 
						
							
							
								
								Free instructions kill values too.  This implements DeadStoreElim/free.llx  
							
							 
							
							... 
							
							
							
							llvm-svn: 15199 
							
						 
						
							2004-07-25 07:58:38 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								bad6478b00 
								
							 
						 
						
							
							
								
								obvious fix  
							
							 
							
							... 
							
							
							
							llvm-svn: 15162 
							
						 
						
							2004-07-24 07:51:27 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3844c300de 
								
							 
						 
						
							
							
								
								This is a trivial dead store elimination pass.  It very very simple and  
							
							 
							
							... 
							
							
							
							can be improved in many ways.  But: stop laughing, even with -basicaa it
deletes 15% of the stores in 252.eon :)
llvm-svn: 15101 
							
						 
						
							2004-07-22 08:00:28 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								51f7c9e56d 
								
							 
						 
						
							
							
								
								Update GC intrinsics to take a pointer to the object as well as a pointer  
							
							 
							
							... 
							
							
							
							to the field being updated.  Patch contributed by Tobias Nurmiranta
llvm-svn: 15097 
							
						 
						
							2004-07-22 05:51:13 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d8f5e2ccac 
								
							 
						 
						
							
							
								
								* Further cleanup.  
							
							 
							
							... 
							
							
							
							* Test for whether bits are shifted out during the optzn.
If so, the fold is illegal, though it can be handled explicitly for setne/seteq
This fixes the miscompilation of 254.gap last night, which was a latent bug
exposed by other optimizer improvements.
llvm-svn: 15085 
							
						 
						
							2004-07-21 20:14:10 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1638de4499 
								
							 
						 
						
							
							
								
								Make cast-cast code a bit more defensive  
							
							 
							
							... 
							
							
							
							"simplify" a bit of code for comparison/and folding
llvm-svn: 15082 
							
						 
						
							2004-07-21 19:50:44 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4fbad968f8 
								
							 
						 
						
							
							
								
								Remove special casing of pointers and treat them generically as integers of  
							
							 
							
							... 
							
							
							
							the appopriate size.  This gives us the ability to eliminate int -> ptr -> int
llvm-svn: 15063 
							
						 
						
							2004-07-21 04:27:24 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								11ffd59e37 
								
							 
						 
						
							
							
								
								Implement Transforms/InstCombine/IntPtrCast.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 15029 
							
						 
						
							2004-07-20 05:21:00 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								44d0b9502a 
								
							 
						 
						
							
							
								
								Implement InstCombine/GEPIdxCanon.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 15024 
							
						 
						
							2004-07-20 01:48:15 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4e2dbc6b4a 
								
							 
						 
						
							
							
								
								Rewrite cast->cast elimination code completely based on the information we  
							
							 
							
							... 
							
							
							
							actually care about.  Someday when the cast instruction is gone, we can do
better here, but this will do for now.  This implements
instcombine/cast.ll:test17/18 as well.
llvm-svn: 15018 
							
						 
						
							2004-07-20 00:59:32 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f3edc49ae2 
								
							 
						 
						
							
							
								
								Minor cleanup, no functionality change  
							
							 
							
							... 
							
							
							
							llvm-svn: 14972 
							
						 
						
							2004-07-18 18:59:44 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								f0a5bcaae4 
								
							 
						 
						
							
							
								
								Delete a redundant if branch.  
							
							 
							
							... 
							
							
							
							llvm-svn: 14967 
							
						 
						
							2004-07-18 08:34:52 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								c44cb6bd9f 
								
							 
						 
						
							
							
								
								Expand the coercion of constants to include the newly constant Globals.  
							
							 
							
							... 
							
							
							
							llvm-svn: 14966 
							
						 
						
							2004-07-18 08:34:19 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								539429d9b5 
								
							 
						 
						
							
							
								
								Delete a no-op loop.  
							
							 
							
							... 
							
							
							
							llvm-svn: 14965 
							
						 
						
							2004-07-18 08:32:43 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								6c2b627e23 
								
							 
						 
						
							
							
								
								Expand the scope to include global values because they are now constants  
							
							 
							
							... 
							
							
							
							too.
llvm-svn: 14964 
							
						 
						
							2004-07-18 08:32:10 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								cb3fb5d4f5 
								
							 
						 
						
							
							
								
								bug 122:  
							
							 
							
							... 
							
							
							
							- Replace ConstantPointerRef usage with GlobalValue usage
llvm-svn: 14953 
							
						 
						
							2004-07-18 00:44:37 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								874368790f 
								
							 
						 
						
							
							
								
								bug 122:  
							
							 
							
							... 
							
							
							
							- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass
llvm-svn: 14950 
							
						 
						
							2004-07-18 00:38:32 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								ef784f01dd 
								
							 
						 
						
							
							
								
								bug 122:  
							
							 
							
							... 
							
							
							
							- Minimize redundant isa<GlobalValue> usage
llvm-svn: 14948 
							
						 
						
							2004-07-18 00:32:14 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								c5afc9512b 
								
							 
						 
						
							
							
								
								bug 122:  
							
							 
							
							... 
							
							
							
							- Replace ConstantPointerRef usage with GlobalValue usage
- Correct isa<Constant> for GlobalValue subclass
llvm-svn: 14947 
							
						 
						
							2004-07-18 00:31:05 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								9e855c6832 
								
							 
						 
						
							
							
								
								bug 122:  
							
							 
							
							... 
							
							
							
							- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass
llvm-svn: 14946 
							
						 
						
							2004-07-18 00:29:57 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d79334df33 
								
							 
						 
						
							
							
								
								This patch was contributed by Daniel Berlin!  
							
							 
							
							... 
							
							
							
							Speed up SCCP substantially by processing overdefined values quickly.  This
patch speeds up SCCP by about 30-40% on large testcases.
llvm-svn: 14861 
							
						 
						
							2004-07-15 23:36:43 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f2c018c0c1 
								
							 
						 
						
							
							
								
								Fix PR404 try  #2  
							
							 
							
							... 
							
							
							
							This version takes about 1s longer than the previous one (down to 2.35s),
but on the positive side, it actually works :)
llvm-svn: 14856 
							
						 
						
							2004-07-15 08:20:22 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								daa12135da 
								
							 
						 
						
							
							
								
								Revert previous patch until I get a bug fixed  
							
							 
							
							... 
							
							
							
							llvm-svn: 14853 
							
						 
						
							2004-07-15 05:36:31 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								70177e402d 
								
							 
						 
						
							
							
								
								Fix PR404: Loop simplify is really slow on 252.eon  
							
							 
							
							... 
							
							
							
							This eliminates an N*N*logN algorithm from the loop simplify pass, replacing
it with a much simpler and faster alternative.  In a debug build, this reduces
gccas time on eon from 85s to 42s.
llvm-svn: 14851 
							
						 
						
							2004-07-15 04:27:04 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9a63520b1a 
								
							 
						 
						
							
							
								
								Fixes working towards PR341  
							
							 
							
							... 
							
							
							
							llvm-svn: 14839 
							
						 
						
							2004-07-15 01:50:47 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ba7aef39fd 
								
							 
						 
						
							
							
								
								Now that we codegen the portable "sizeof" efficiently, we can use it for  
							
							 
							
							... 
							
							
							
							malloc lowering.  This means that lowerallocations doesn't need targetdata
anymore.  yaay.
llvm-svn: 14835 
							
						 
						
							2004-07-15 01:08:08 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								35e24774eb 
								
							 
						 
						
							
							
								
								Factor some code to handle "load (constantexpr cast foo)" just like  
							
							 
							
							... 
							
							
							
							"load (cast foo)".  This allows us to compile C++ code like this:
class Bclass {
  public: virtual int operator()() { return 666; }
};
class Dclass: public Bclass {
  public: virtual int operator()() { return 667; }
} ;
int main(int argc, char** argv) {
  Dclass x;
  return x();
}
Into this:
int %main(int %argc, sbyte** %argv) {
entry:
        call void %__main( )
        ret int 667
}
Instead of this:
int %main(int %argc, sbyte** %argv) {
entry:
        %x = alloca "struct.std::bad_typeid"            ; <"struct.std::bad_typeid"*> [#uses=3]
        call void %__main( )
        %tmp.1.i.i = getelementptr "struct.std::bad_typeid"* %x, uint 0, uint 0, uint 0         ; <int (...)***> [#uses=1]
        store int (...)** getelementptr ([3 x int (...)*]*  %vtable for Bclass, int 0, long 2), int (...)*** %tmp.1.i.i
        %tmp.3.i = getelementptr "struct.std::bad_typeid"* %x, int 0, uint 0, uint 0            ; <int (...)***> [#uses=1]
        store int (...)** getelementptr ([3 x int (...)*]*  %vtable for Dclass, int 0, long 2), int (...)*** %tmp.3.i
        %tmp.5 = load int ("struct.std::bad_typeid"*)** cast (int (...)** getelementptr ([3 x int (...)*]*  %vtable for Dclass, int 0, long 2) to int
("struct.std::bad_typeid"*)**)          ; <int ("struct.std::bad_typeid"*)*> [#uses=1]
        %tmp.6 = call int %tmp.5( "struct.std::bad_typeid"* %x )                ; <int> [#uses=1]
	ret int %tmp.6
        ret int 0
}
In order words, we now resolve the virtual function call.
llvm-svn: 14783 
							
						 
						
							2004-07-13 01:49:43 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9eb9ccd9f6 
								
							 
						 
						
							
							
								
								Check to make sure types are sized before calling getTypeSize on them.  
							
							 
							
							... 
							
							
							
							llvm-svn: 14649 
							
						 
						
							2004-07-06 19:28:42 +00:00  
						
					 
				
					
						
							
							
								 
								Brian Gaeke
							
						 
						
							 
							
							
							
							
								
							
							
								a501be556f 
								
							 
						 
						
							
							
								
								It doesn't matter what the 2nd operand is; if the GEP has 2 operands and  
							
							 
							
							... 
							
							
							
							the first is a zero, we should leave it alone.
llvm-svn: 14648 
							
						 
						
							2004-07-06 19:24:47 +00:00  
						
					 
				
					
						
							
							
								 
								Brian Gaeke
							
						 
						
							 
							
							
							
							
								
							
							
								0e0fe8a2e9 
								
							 
						 
						
							
							
								
								Add helper function.  
							
							 
							
							... 
							
							
							
							Don't touch GEPs for which DecomposeArrayRef is not going to do anything
special (e.g., < 2 indices, or 2 indices and the last one is a constant.)
llvm-svn: 14647 
							
						 
						
							2004-07-06 18:15:39 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								23b47b6af9 
								
							 
						 
						
							
							
								
								Implement rem.ll:test3  
							
							 
							
							... 
							
							
							
							llvm-svn: 14640 
							
						 
						
							2004-07-06 07:38:18 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								98c6bdf251 
								
							 
						 
						
							
							
								
								Fix a minor bug where we would go into infinite loops on some constants  
							
							 
							
							... 
							
							
							
							llvm-svn: 14638 
							
						 
						
							2004-07-06 07:11:42 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7fd5f0745a 
								
							 
						 
						
							
							
								
								Implement InstCombine/sub.ll:test15:  X % -Y === X % Y  
							
							 
							
							... 
							
							
							
							Also, remove X % -1 = 0, because it's not true for unsigneds, and the
signed case is superceeded by this new handling.
llvm-svn: 14637 
							
						 
						
							2004-07-06 07:01:22 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								eb04d9bcb4 
								
							 
						 
						
							
							
								
								Add #include <iostream> since Value.h does not #include it any more.  
							
							 
							
							... 
							
							
							
							llvm-svn: 14622 
							
						 
						
							2004-07-04 12:19:56 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4c9c20af28 
								
							 
						 
						
							
							
								
								Implement add.ll:test22, a common case in MSIL files  
							
							 
							
							... 
							
							
							
							llvm-svn: 14587 
							
						 
						
							2004-07-03 00:26:11 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								49df6cefa5 
								
							 
						 
						
							
							
								
								Do not call getTypeSize on a type that has no size  
							
							 
							
							... 
							
							
							
							llvm-svn: 14584 
							
						 
						
							2004-07-02 22:55:47 +00:00  
						
					 
				
					
						
							
							
								 
								Brian Gaeke
							
						 
						
							 
							
							
							
							
								
							
							
								e1a136fb4b 
								
							 
						 
						
							
							
								
								Get rid of a dead variable, and fix a typo in a comment.  
							
							 
							
							... 
							
							
							
							llvm-svn: 14560 
							
						 
						
							2004-07-02 05:30:01 +00:00  
						
					 
				
					
						
							
							
								 
								Brian Gaeke
							
						 
						
							 
							
							
							
							
								
							
							
								163c87fc32 
								
							 
						 
						
							
							
								
								Make this pass use a more specific debug message than "Processing:".  
							
							 
							
							... 
							
							
							
							llvm-svn: 14541 
							
						 
						
							2004-07-01 19:27:10 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6e07936ed2 
								
							 
						 
						
							
							
								
								Implement InstCombine/add.ll:test21  
							
							 
							
							... 
							
							
							
							llvm-svn: 14443 
							
						 
						
							2004-06-27 22:51:36 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7f4222237d 
								
							 
						 
						
							
							
								
								New constant expression lowering pass to simplify your instruction selection needs.  
							
							 
							
							... 
							
							
							
							Contributed by Vladimir Prus!
llvm-svn: 14399 
							
						 
						
							2004-06-25 07:48:09 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7a002d6010 
								
							 
						 
						
							
							
								
								Two fixes.  First, stop using the ugly shouldSubstituteIndVar method.  
							
							 
							
							... 
							
							
							
							Second, disable substitution of quadratic addrec expressions to avoid putting
multiplies in loops!
llvm-svn: 14358 
							
						 
						
							2004-06-24 06:49:18 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c9e06336ab 
								
							 
						 
						
							
							
								
								Make use of BinaryOperator::create* methods to shrinkify code.  
							
							 
							
							... 
							
							
							
							llvm-svn: 14262 
							
						 
						
							2004-06-20 05:04:01 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								42ad646104 
								
							 
						 
						
							
							
								
								Now that dominator tree children are built in determinstic order, this horrible code  
							
							 
							
							... 
							
							
							
							can go away
llvm-svn: 14254 
							
						 
						
							2004-06-19 20:23:35 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4027500e1c 
								
							 
						 
						
							
							
								
								Fix a nasty bug, noticed by Reid  
							
							 
							
							... 
							
							
							
							llvm-svn: 14249 
							
						 
						
							2004-06-19 18:15:50 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ec2d34cc19 
								
							 
						 
						
							
							
								
								Fix one source of nondeterminism in the -licm pass: the hoist pass  
							
							 
							
							... 
							
							
							
							was processing blocks in whatever order they happened to end up in the
dominator tree data structure.  Force an ordering.
llvm-svn: 14248 
							
						 
						
							2004-06-19 08:56:43 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b5f8eb8315 
								
							 
						 
						
							
							
								
								Do not loop over uses as we delete them.  This causes iterators to be  
							
							 
							
							... 
							
							
							
							invalidated out from under us.  This bug goes back to revision 1.1: scary.
llvm-svn: 14242 
							
						 
						
							2004-06-19 02:02:22 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								023a483c76 
								
							 
						 
						
							
							
								
								Implement Transforms/InstCombine/and.ll:test17, a common case that  
							
							 
							
							... 
							
							
							
							occurs due to unordered comparison macros in math.h
llvm-svn: 14221 
							
						 
						
							2004-06-18 06:07:51 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								97bfcea262 
								
							 
						 
						
							
							
								
								Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()  
							
							 
							
							... 
							
							
							
							Delete two functions that are now methods on the Type class
llvm-svn: 14200 
							
						 
						
							2004-06-17 18:16:02 +00:00  
						
					 
				
					
						
							
							
								 
								Brian Gaeke
							
						 
						
							 
							
							
							
							
								
							
							
								661963c63f 
								
							 
						 
						
							
							
								
								Fix typo in DEBUG printout.  
							
							 
							
							... 
							
							
							
							llvm-svn: 14196 
							
						 
						
							2004-06-17 07:26:52 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ee59d4bf04 
								
							 
						 
						
							
							
								
								Fix a bug in my checkin from last night that caused miscompilations of  
							
							 
							
							... 
							
							
							
							186.crafty, fhourstones and 132.ijpeg.
Bugpoint makes really nasty miscompilations embarassingly easy to find.  It
narrowed it down to the instcombiner and this testcase (from fhourstones):
bool %l7153_l4706_htstat_loopentry_2E_4_no_exit_2E_4(int* %i, [32 x int]* %works, int* %tmp.98.out) {
newFuncRoot:
        %tmp.96 = load int* %i          ; <int> [#uses=1]
        %tmp.97 = getelementptr [32 x int]* %works, long 0, int %tmp.96         ; <int*> [#uses=1]
        %tmp.98 = load int* %tmp.97             ; <int> [#uses=2]
        %tmp.99 = load int* %i          ; <int> [#uses=1]
        %tmp.100 = and int %tmp.99, 7           ; <int> [#uses=1]
        %tmp.101 = seteq int %tmp.100, 7                ; <bool> [#uses=2]
        %tmp.102 = cast bool %tmp.101 to int            ; <int> [#uses=0]
        br bool %tmp.101, label %codeRepl4.exitStub, label %codeRepl3.exitStub
codeRepl4.exitStub:             ; preds = %newFuncRoot
        store int %tmp.98, int* %tmp.98.out
        ret bool true
codeRepl3.exitStub:             ; preds = %newFuncRoot
        store int %tmp.98, int* %tmp.98.out
        ret bool false
}
... which only has one combination performed on it:
$ llvm-as < t.ll | opt -instcombine -debug | llvm-dis
IC: Old =       %tmp.101 = seteq int %tmp.100, 7                ; <bool> [#uses=1]
    New =       setne int %tmp.100, 0           ; <bool>:<badref> [#uses=0]
IC: MOD =       br bool %tmp.101, label %codeRepl3.exitStub, label %codeRepl4.exitStub
IC: MOD =       %tmp.97 = getelementptr [32 x int]* %works, uint 0, int %tmp.96         ; <int*> [#uses=1]
It doesn't get much better than this.  :)
llvm-svn: 14109 
							
						 
						
							2004-06-10 02:33:20 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c8e7e298c1 
								
							 
						 
						
							
							
								
								More minor cleanups  
							
							 
							
							... 
							
							
							
							llvm-svn: 14108 
							
						 
						
							2004-06-10 02:12:35 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								df20a4d589 
								
							 
						 
						
							
							
								
								Eliminate many occurrances of Instruction::  
							
							 
							
							... 
							
							
							
							llvm-svn: 14107 
							
						 
						
							2004-06-10 02:07:29 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								35167c3087 
								
							 
						 
						
							
							
								
								Implement InstCombine/select.ll:test15*  
							
							 
							
							... 
							
							
							
							llvm-svn: 14095 
							
						 
						
							2004-06-09 07:59:58 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								396dbfe327 
								
							 
						 
						
							
							
								
								Be more careful about the order we put stuff onto the worklist.  This allow us to  
							
							 
							
							... 
							
							
							
							collapse this:
bool %le(int %A, int %B) {
        %c1 = setgt int %A, %B
        %tmp = select bool %c1, int 1, int 0
        %c2 = setlt int %A, %B
        %result = select bool %c2, int -1, int %tmp
        %c3 = setle int %result, 0
        ret bool %c3
}
into:
bool %le(int %A, int %B) {
        %c3 = setle int %A, %B          ; <bool> [#uses=1]
        ret bool %c3
}
which is handy, because the Java FE makes these sequences all over the place.
This is tested as: test/Regression/Transforms/InstCombine/JavaCompare.ll
llvm-svn: 14086 
							
						 
						
							2004-06-09 05:08:07 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2dd017402b 
								
							 
						 
						
							
							
								
								Implement select.ll:test14*  
							
							 
							
							... 
							
							
							
							llvm-svn: 14083 
							
						 
						
							2004-06-09 04:24:29 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								523d3e6674 
								
							 
						 
						
							
							
								
								Fix one of the major things that is causing the C Backend to infinite loop  
							
							 
							
							... 
							
							
							
							llvm-svn: 13872 
							
						 
						
							2004-05-28 05:02:13 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ed79d8af53 
								
							 
						 
						
							
							
								
								Fix InstCombine/load.ll & PR347.  
							
							 
							
							... 
							
							
							
							This code hadn't been updated after the "structs with more than 256 elements"
related changes to the GEP instruction.  Also it was not handling the
ConstantAggregateZero class.
Now it does!
llvm-svn: 13834 
							
						 
						
							2004-05-27 17:30:27 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								297d7fe7e6 
								
							 
						 
						
							
							
								
								Remove unused header file.  
							
							 
							
							... 
							
							
							
							llvm-svn: 13750 
							
						 
						
							2004-05-25 08:51:36 +00:00  
						
					 
				
					
						
							
							
								 
								Reid Spencer
							
						 
						
							 
							
							
							
							
								
							
							
								1cc31f264f 
								
							 
						 
						
							
							
								
								Make this pass simply invoke SymbolTable::strip().  
							
							 
							
							... 
							
							
							
							llvm-svn: 13749 
							
						 
						
							2004-05-25 08:51:25 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								e1e10e1883 
								
							 
						 
						
							
							
								
								Implement InstCombine:shift.ll:test16, which turns (X >> C1) & C2 != C3  
							
							 
							
							... 
							
							
							
							into (X & (C2 << C1)) != (C3 << C1), where the shift may be either left or
right and the compare may be any one.
This triggers 1546 times in 176.gcc alone, as it is a common pattern that
occurs for bitfield accesses.
llvm-svn: 13740 
							
						 
						
							2004-05-25 06:32:08 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								03841659a4 
								
							 
						 
						
							
							
								
								Implement instcombine/cast.ll:test16:  
							
							 
							
							... 
							
							
							
							Canonicalize cast X to bool into a setne instruction
llvm-svn: 13736 
							
						 
						
							2004-05-25 04:29:21 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								99173879ad 
								
							 
						 
						
							
							
								
								Spelling people's names right is kinda important  
							
							 
							
							... 
							
							
							
							llvm-svn: 13702 
							
						 
						
							2004-05-23 21:27:29 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								289ba2ac4d 
								
							 
						 
						
							
							
								
								Adjust to the changes in the AliasSetTracker interface  
							
							 
							
							... 
							
							
							
							llvm-svn: 13690 
							
						 
						
							2004-05-23 21:20:19 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								e67dbc2ae2 
								
							 
						 
						
							
							
								
								Add support for replacement of formal arguments with simpler expressions.  
							
							 
							
							... 
							
							
							
							llvm-svn: 13689 
							
						 
						
							2004-05-23 21:19:55 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								099c8cfe90 
								
							 
						 
						
							
							
								
								Implement the -lowergc pass which is used by code generators (like the CBE)  
							
							 
							
							... 
							
							
							
							that do not have builtin support for garbage collection.
llvm-svn: 13688 
							
						 
						
							2004-05-23 21:19:22 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								0026512bac 
								
							 
						 
						
							
							
								
								This was not meant to be committed  
							
							 
							
							... 
							
							
							
							llvm-svn: 13565 
							
						 
						
							2004-05-13 20:56:34 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c12c945cc4 
								
							 
						 
						
							
							
								
								Fix a nasty bug that caused us to unroll EXTREMELY large loops due to overflow  
							
							 
							
							... 
							
							
							
							in the size calculation.
This is not something you want to see:
Loop Unroll: F[main] Loop %no_exit Loop Size = 2 Trip Count = 2147483648 - UNROLLING!
The problem was that 2*2147483648 == 0.
Now we get:
Loop Unroll: F[main] Loop %no_exit Loop Size = 2 Trip Count = 2147483648 - TOO LARGE: 4294967296>100
Thanks to some anonymous person playing with the demo page that repeatedly
caused zion to go into swapping land.  That's one way to ensure you'll get
a quick bugfix.  :)
Testcase here: Transforms/LoopUnroll/2004-05-13-DontUnrollTooMuch.ll
llvm-svn: 13564 
							
						 
						
							2004-05-13 20:43:31 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8ec5f88c79 
								
							 
						 
						
							
							
								
								Fix stupid bug in my checkin yesterday  
							
							 
							
							... 
							
							
							
							llvm-svn: 13429 
							
						 
						
							2004-05-08 22:41:42 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								5f667a6f58 
								
							 
						 
						
							
							
								
								Implement folding of GEP's like:  
							
							 
							
							... 
							
							
							
							%tmp.0 = getelementptr [50 x sbyte]* %ar, uint 0, int 5         ; <sbyte*> [#uses=2]
        %tmp.7 = getelementptr sbyte* %tmp.0, int 8             ; <sbyte*> [#uses=1]
together.  This patch actually allows us to simplify and generalize the code.
llvm-svn: 13415 
							
						 
						
							2004-05-07 22:09:22 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d9e5813821 
								
							 
						 
						
							
							
								
								Fix PR336: The instcombine pass asserts when visiting load instruction  
							
							 
							
							... 
							
							
							
							llvm-svn: 13400 
							
						 
						
							2004-05-07 15:35:56 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9490849028 
								
							 
						 
						
							
							
								
								Do not mark instructions in unreachable sections of the function as live.  
							
							 
							
							... 
							
							
							
							This fixes PR332 and ADCE/2004-05-04-UnreachableBlock.llx
llvm-svn: 13349 
							
						 
						
							2004-05-04 17:00:46 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								dd1a86d858 
								
							 
						 
						
							
							
								
								Minor efficiency tweak, suggested by Patrick Meredith  
							
							 
							
							... 
							
							
							
							llvm-svn: 13341 
							
						 
						
							2004-05-04 15:19:33 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								63d75af920 
								
							 
						 
						
							
							
								
								Make sure to reprocess instructions used by deleted instructions to avoid  
							
							 
							
							... 
							
							
							
							missing opportunities for combination.
llvm-svn: 13309 
							
						 
						
							2004-05-01 23:27:23 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b643a9e675 
								
							 
						 
						
							
							
								
								Make sure the instruction combiner doesn't lose track of instructions  
							
							 
							
							... 
							
							
							
							when replacing them, missing the opportunity to do simplifications
llvm-svn: 13308 
							
						 
						
							2004-05-01 23:19:52 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								652064e3b8 
								
							 
						 
						
							
							
								
								Fix a major pessimization in the instcombiner.  If an allocation instruction  
							
							 
							
							... 
							
							
							
							is only used by a cast, and the casted type is the same size as the original
allocation, it would eliminate the cast by folding it into the allocation.
Unfortunately, it was placing the new allocation instruction right before
the cast, which could pull (for example) alloca instructions into the body
of a function.  This turns statically allocatable allocas into expensive
dynamically allocated allocas, which is bad bad bad.
This fixes the problem by placing the new allocation instruction at the same
place the old one was, duh. :)
llvm-svn: 13289 
							
						 
						
							2004-04-30 04:37:52 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2d3a7a6ff0 
								
							 
						 
						
							
							
								
								Changes to fix up the inst_iterator to pass to boost iterator checks.  This  
							
							 
							
							... 
							
							
							
							patch was graciously contributed by Vladimir Prus.
llvm-svn: 13185 
							
						 
						
							2004-04-27 15:13:33 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								e20c334e65 
								
							 
						 
						
							
							
								
								Instcombine X/-1 --> 0-X  
							
							 
							
							... 
							
							
							
							llvm-svn: 13172 
							
						 
						
							2004-04-26 14:01:59 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								83cd87efcd 
								
							 
						 
						
							
							
								
								Move the scev expansion code into this pass, where it belongs.  There is  
							
							 
							
							... 
							
							
							
							still room for cleanup, but at least the code modification is out of the
analysis now.
llvm-svn: 13135 
							
						 
						
							2004-04-23 21:29:48 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c27302c79f 
								
							 
						 
						
							
							
								
								Disable a previous patch that was causing indvars to loop infinitely :(  
							
							 
							
							... 
							
							
							
							llvm-svn: 13108 
							
						 
						
							2004-04-22 15:12:36 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c1a682dda0 
								
							 
						 
						
							
							
								
								Fix an extremely serious thinko I made in revision 1.60 of this file.  
							
							 
							
							... 
							
							
							
							llvm-svn: 13106 
							
						 
						
							2004-04-22 14:59:40 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								af532f27e7 
								
							 
						 
						
							
							
								
								Implement a todo, rewriting all possible scev expressions inside of the  
							
							 
							
							... 
							
							
							
							loop.  This eliminates the extra add from the previous case, but it's
not clear that this will be a performance win overall.  Tommorows test
results will tell. :)
llvm-svn: 13103 
							
						 
						
							2004-04-21 23:36:08 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								fb9a299f68 
								
							 
						 
						
							
							
								
								This code really wants to iterate over the OPERANDS of an instruction, not  
							
							 
							
							... 
							
							
							
							over its USES.  If it's dead it doesn't have any uses!  :)
Thanks to the fabulous and mysterious Bill Wendling for pointing this out.  :)
llvm-svn: 13102 
							
						 
						
							2004-04-21 22:29:37 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								dc7cc35088 
								
							 
						 
						
							
							
								
								Implement a fixme.  The helps loops that have induction variables of different  
							
							 
							
							... 
							
							
							
							types in them.  Instead of creating an induction variable for all types, it
creates a single induction variable and casts to the other sizes.  This generates
this code:
no_exit:                ; preds = %entry, %no_exit
        %indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ]            ; <uint> [#uses=4]
***     %j.0.0 = cast uint %indvar to short             ; <short> [#uses=1]
        %indvar = cast uint %indvar to int              ; <int> [#uses=1]
        %tmp.7 = getelementptr short* %P, uint %indvar          ; <short*> [#uses=1]
        store short %j.0.0, short* %tmp.7
        %inc.0 = add int %indvar, 1             ; <int> [#uses=2]
        %tmp.2 = setlt int %inc.0, %N           ; <bool> [#uses=1]
        %indvar.next = add uint %indvar, 1              ; <uint> [#uses=1]
        br bool %tmp.2, label %no_exit, label %loopexit
instead of:
no_exit:                ; preds = %entry, %no_exit
        %indvar = phi ushort [ %indvar.next, %no_exit ], [ 0, %entry ]          ; <ushort> [#uses=2]
***     %indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ]            ; <uint> [#uses=3]
        %indvar = cast uint %indvar to int              ; <int> [#uses=1]
        %indvar = cast ushort %indvar to short          ; <short> [#uses=1]
        %tmp.7 = getelementptr short* %P, uint %indvar          ; <short*> [#uses=1]
        store short %indvar, short* %tmp.7
        %inc.0 = add int %indvar, 1             ; <int> [#uses=2]
        %tmp.2 = setlt int %inc.0, %N           ; <bool> [#uses=1]
        %indvar.next = add uint %indvar, 1
***     %indvar.next = add ushort %indvar, 1
        br bool %tmp.2, label %no_exit, label %loopexit
This is an improvement in register pressure, but probably doesn't happen that
often.
The more important fix will be to get rid of the redundant add.
llvm-svn: 13101 
							
						 
						
							2004-04-21 22:22:01 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c1aa21f5a7 
								
							 
						 
						
							
							
								
								Fix PR325  
							
							 
							
							... 
							
							
							
							llvm-svn: 13081 
							
						 
						
							2004-04-20 20:26:03 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f48f777d4c 
								
							 
						 
						
							
							
								
								Initial checkin of a simple loop unswitching pass.  It still needs work,  
							
							 
							
							... 
							
							
							
							but it's a start, and seems to do it's basic job.
llvm-svn: 13068 
							
						 
						
							2004-04-19 18:07:02 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								bc02177fdc 
								
							 
						 
						
							
							
								
								Add #include  
							
							 
							
							... 
							
							
							
							llvm-svn: 13057 
							
						 
						
							2004-04-19 03:01:23 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								fc44a25bcb 
								
							 
						 
						
							
							
								
								Move isLoopInvariant to the Loop class  
							
							 
							
							... 
							
							
							
							llvm-svn: 13051 
							
						 
						
							2004-04-18 22:46:08 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								827826320d 
								
							 
						 
						
							
							
								
								Correct rewriting of exit blocks after my last patch  
							
							 
							
							... 
							
							
							
							llvm-svn: 13048 
							
						 
						
							2004-04-18 22:27:10 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								35eaa55cfc 
								
							 
						 
						
							
							
								
								Loop exit sets are no longer explicitly held, they are dynamically computed on demand.  
							
							 
							
							... 
							
							
							
							llvm-svn: 13046 
							
						 
						
							2004-04-18 22:15:13 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d72c3eb54e 
								
							 
						 
						
							
							
								
								Change the ExitBlocks list from being explicitly contained in the Loop  
							
							 
							
							... 
							
							
							
							structure to being dynamically computed on demand.  This makes updating
loop information MUCH easier.
llvm-svn: 13045 
							
						 
						
							2004-04-18 22:14:10 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d15250240c 
								
							 
						 
						
							
							
								
								Reduce the unrolling limit  
							
							 
							
							... 
							
							
							
							llvm-svn: 13040 
							
						 
						
							2004-04-18 18:06:14 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								30ae18155d 
								
							 
						 
						
							
							
								
								If the preheader of the loop was the entry block of the function, make sure  
							
							 
							
							... 
							
							
							
							that the exit block of the loop becomes the new entry block of the function.
This was causing a verifier assertion on 252.eon.
llvm-svn: 13039 
							
						 
						
							2004-04-18 17:38:42 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								230bcb6b35 
								
							 
						 
						
							
							
								
								Be much more careful about how we update instructions outside of the loop  
							
							 
							
							... 
							
							
							
							using instructions inside of the loop.  This should fix the MishaTest failure
from last night.
llvm-svn: 13038 
							
						 
						
							2004-04-18 17:32:39 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4d52e1e401 
								
							 
						 
						
							
							
								
								After unrolling our single basic block loop, fold it into the preheader and exit  
							
							 
							
							... 
							
							
							
							block.  The primary motivation for doing this is that we can now unroll nested loops.
This makes a pretty big difference in some cases.  For example, in 183.equake,
we are now beating the native compiler with the CBE, and we are a lot closer
with LLC.
I'm now going to play around a bit with the unroll factor and see what effect
it really has.
llvm-svn: 13034 
							
						 
						
							2004-04-18 06:27:43 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f2cc841619 
								
							 
						 
						
							
							
								
								Fix a bug: this does not preserve the CFG!  
							
							 
							
							... 
							
							
							
							While we're at it, add support for updating loop information correctly.
llvm-svn: 13033 
							
						 
						
							2004-04-18 05:38:37 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								946b255977 
								
							 
						 
						
							
							
								
								Initial checkin of a simple loop unroller.  This pass is extremely basic and  
							
							 
							
							... 
							
							
							
							limited.  Even in it's extremely simple state (it can only *fully* unroll single
basic block loops that execute a constant number of times), it already helps improve
performance a LOT on some benchmarks, particularly with the native code generators.
llvm-svn: 13028 
							
						 
						
							2004-04-18 05:20:17 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c14da9600b 
								
							 
						 
						
							
							
								
								Make the tail duplication threshold accessible from the command line instead of hardcoded  
							
							 
							
							... 
							
							
							
							llvm-svn: 13025 
							
						 
						
							2004-04-18 00:52:43 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a814080025 
								
							 
						 
						
							
							
								
								If the loop executes a constant number of times, try a bit harder to replace  
							
							 
							
							... 
							
							
							
							exit values.
llvm-svn: 13018 
							
						 
						
							2004-04-17 18:44:09 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1e9ac1a45e 
								
							 
						 
						
							
							
								
								Fix a HUGE pessimization on X86.  The indvars pass was taking this  
							
							 
							
							... 
							
							
							
							(familiar) function:
int _strlen(const char *str) {
    int len = 0;
    while (*str++) len++;
    return len;
}
And transforming it to use a ulong induction variable, because the type of
the pointer index was left as a constant long.  This is obviously very bad.
The fix is to shrink long constants in getelementptr instructions to intptr_t,
making the indvars pass insert a uint induction variable, which is much more
efficient.
Here's the before code for this function:
int %_strlen(sbyte* %str) {
entry:
        %tmp.13 = load sbyte* %str              ; <sbyte> [#uses=1]
        %tmp.24 = seteq sbyte %tmp.13, 0                ; <bool> [#uses=1]
        br bool %tmp.24, label %loopexit, label %no_exit
no_exit:                ; preds = %entry, %no_exit
***     %indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ]            ; <uint> [#uses=2]
***     %indvar = phi ulong [ %indvar.next, %no_exit ], [ 0, %entry ]           ; <ulong> [#uses=2]
        %indvar1 = cast ulong %indvar to uint           ; <uint> [#uses=1]
        %inc.02.sum = add uint %indvar1, 1              ; <uint> [#uses=1]
        %inc.0.0 = getelementptr sbyte* %str, uint %inc.02.sum          ; <sbyte*> [#uses=1]
        %tmp.1 = load sbyte* %inc.0.0           ; <sbyte> [#uses=1]
        %tmp.2 = seteq sbyte %tmp.1, 0          ; <bool> [#uses=1]
        %indvar.next = add ulong %indvar, 1             ; <ulong> [#uses=1]
        %indvar.next = add uint %indvar, 1              ; <uint> [#uses=1]
        br bool %tmp.2, label %loopexit.loopexit, label %no_exit
loopexit.loopexit:              ; preds = %no_exit
        %indvar = cast uint %indvar to int              ; <int> [#uses=1]
        %inc.1 = add int %indvar, 1             ; <int> [#uses=1]
        ret int %inc.1
loopexit:               ; preds = %entry
        ret int 0
}
Here's the after code:
int %_strlen(sbyte* %str) {
entry:
        %inc.02 = getelementptr sbyte* %str, uint 1             ; <sbyte*> [#uses=1]
        %tmp.13 = load sbyte* %str              ; <sbyte> [#uses=1]
        %tmp.24 = seteq sbyte %tmp.13, 0                ; <bool> [#uses=1]
        br bool %tmp.24, label %loopexit, label %no_exit
no_exit:                ; preds = %entry, %no_exit
***     %indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ]            ; <uint> [#uses=3]
        %indvar = cast uint %indvar to int              ; <int> [#uses=1]
        %inc.0.0 = getelementptr sbyte* %inc.02, uint %indvar           ; <sbyte*> [#uses=1]
        %inc.1 = add int %indvar, 1             ; <int> [#uses=1]
        %tmp.1 = load sbyte* %inc.0.0           ; <sbyte> [#uses=1]
        %tmp.2 = seteq sbyte %tmp.1, 0          ; <bool> [#uses=1]
        %indvar.next = add uint %indvar, 1              ; <uint> [#uses=1]
        br bool %tmp.2, label %loopexit, label %no_exit
loopexit:               ; preds = %entry, %no_exit
        %len.0.1 = phi int [ 0, %entry ], [ %inc.1, %no_exit ]          ; <int> [#uses=1]
        ret int %len.0.1
}
llvm-svn: 13016 
							
						 
						
							2004-04-17 18:16:10 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								885a6eb74d 
								
							 
						 
						
							
							
								
								Even if there are not any induction variables in the loop, if we can compute  
							
							 
							
							... 
							
							
							
							the trip count for the loop, insert one so that we can canonicalize the exit
condition.
llvm-svn: 13015 
							
						 
						
							2004-04-17 18:08:33 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								284d3b0311 
								
							 
						 
						
							
							
								
								Fix some really nasty dominance bugs that were exposed by my patch to  
							
							 
							
							... 
							
							
							
							make the verifier more strict.  This fixes building zlib
llvm-svn: 13002 
							
						 
						
							2004-04-16 18:08:07 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9e9b2b7474 
								
							 
						 
						
							
							
								
								Fix some of the strange CBE-only failures that happened last night.  
							
							 
							
							... 
							
							
							
							llvm-svn: 12980 
							
						 
						
							2004-04-16 06:03:17 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d7a559e353 
								
							 
						 
						
							
							
								
								Fix a bug in the previous checkin: if the exit block is not the same as  
							
							 
							
							... 
							
							
							
							the back-edge block, we must check the preincremented value.
llvm-svn: 12968 
							
						 
						
							2004-04-15 20:26:22 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								0cec5cb92c 
								
							 
						 
						
							
							
								
								Change the canonical induction variable that we insert.  
							
							 
							
							... 
							
							
							
							Instead of producing code like this:
Loop:
  X = phi 0, X2
  ...
  X2 = X + 1
  if (X != N-1) goto Loop
We now generate code that looks like this:
Loop:
  X = phi 0, X2
  ...
  X2 = X + 1
  if (X2 != N) goto Loop
This has two big advantages:
  1. The trip count of the loop is now explicit in the code, allowing
     the direct implementation of Loop::getTripCount()
  2. This reduces register pressure in the loop, and allows X and X2 to be
     put into the same register.
As a consequence of the second point, the code we generate for loops went
from:
.LBB2:  # no_exit.1
	...
        mov %EDI, %ESI
        inc %EDI
        cmp %ESI, 2
        mov %ESI, %EDI
        jne .LBB2 # PC rel: no_exit.1
To:
.LBB2:  # no_exit.1
	...
        inc %ESI
        cmp %ESI, 3
        jne .LBB2 # PC rel: no_exit.1
... which has two fewer moves, and uses one less register.
llvm-svn: 12961 
							
						 
						
							2004-04-15 15:21:43 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6679e46b59 
								
							 
						 
						
							
							
								
								ADd a trivial instcombine: load null -> null  
							
							 
							
							... 
							
							
							
							llvm-svn: 12940 
							
						 
						
							2004-04-14 03:28:36 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ff9362a8da 
								
							 
						 
						
							
							
								
								Add SCCP support for constant folding calls, implementing:  
							
							 
							
							... 
							
							
							
							test/Regression/Transforms/SCCP/calltest.ll
llvm-svn: 12921 
							
						 
						
							2004-04-13 19:43:54 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d0dc6d5295 
								
							 
						 
						
							
							
								
								Constant propagation should remove the dead instructions  
							
							 
							
							... 
							
							
							
							llvm-svn: 12917 
							
						 
						
							2004-04-13 19:28:20 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								89e959bb1f 
								
							 
						 
						
							
							
								
								Fix LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.ll  
							
							 
							
							... 
							
							
							
							LoopSimplify was not updating dominator frontiers correctly in some cases.
llvm-svn: 12890 
							
						 
						
							2004-04-13 16:23:25 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a6e22814ab 
								
							 
						 
						
							
							
								
								Refactor code a bit to make it simpler and eliminate the goto  
							
							 
							
							... 
							
							
							
							llvm-svn: 12888 
							
						 
						
							2004-04-13 15:21:18 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8417052938 
								
							 
						 
						
							
							
								
								This patch addresses PR35: Loop simplify should reconstruct nested loops.  
							
							 
							
							... 
							
							
							
							This is fairly straight-forward, but was a real nightmare to get just
perfect.  aarg.  :)
llvm-svn: 12884 
							
						 
						
							2004-04-13 05:05:33 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								494a685449 
								
							 
						 
						
							
							
								
								Add support for removing invoke instructions  
							
							 
							
							... 
							
							
							
							llvm-svn: 12858 
							
						 
						
							2004-04-12 05:15:13 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								24cf0200c7 
								
							 
						 
						
							
							
								
								Fix a bug in my select transformation  
							
							 
							
							... 
							
							
							
							llvm-svn: 12826 
							
						 
						
							2004-04-11 01:39:19 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f16fe7206c 
								
							 
						 
						
							
							
								
								Update the value numbering interface.  
							
							 
							
							... 
							
							
							
							llvm-svn: 12824 
							
						 
						
							2004-04-10 22:33:34 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								623fba1107 
								
							 
						 
						
							
							
								
								Implement InstCombine/select.ll:test13*  
							
							 
							
							... 
							
							
							
							llvm-svn: 12821 
							
						 
						
							2004-04-10 22:21:27 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								cf4a996cba 
								
							 
						 
						
							
							
								
								Implement InstCombine/add.ll:test20  
							
							 
							
							... 
							
							
							
							Canonicalize add of sign bit constant into a xor
llvm-svn: 12819 
							
						 
						
							2004-04-10 22:01:55 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								69c4900512 
								
							 
						 
						
							
							
								
								Rewrite the GCSE pass to be *substantially* simpler, a bit more efficient,  
							
							 
							
							... 
							
							
							
							and a bit more powerful
llvm-svn: 12817 
							
						 
						
							2004-04-10 21:11:11 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f9d9665138 
								
							 
						 
						
							
							
								
								Fix spurious warning in release mode  
							
							 
							
							... 
							
							
							
							llvm-svn: 12816 
							
						 
						
							2004-04-10 19:15:56 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d95ef7eff0 
								
							 
						 
						
							
							
								
								Simplify code a bit, and fix a bug that was breaking perlbmk  
							
							 
							
							... 
							
							
							
							llvm-svn: 12814 
							
						 
						
							2004-04-10 18:06:21 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7ebfe61dc1 
								
							 
						 
						
							
							
								
								Fix a bug in my checkin last night that was breaking programs using invoke.  
							
							 
							
							... 
							
							
							
							llvm-svn: 12813 
							
						 
						
							2004-04-10 16:53:29 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								5093213c40 
								
							 
						 
						
							
							
								
								Fix previous patch  
							
							 
							
							... 
							
							
							
							llvm-svn: 12811 
							
						 
						
							2004-04-10 07:27:48 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6149ac8991 
								
							 
						 
						
							
							
								
								Correctly update counters  
							
							 
							
							... 
							
							
							
							llvm-svn: 12810 
							
						 
						
							2004-04-10 07:02:02 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								cfa1adcdb8 
								
							 
						 
						
							
							
								
								Simplify code a bit, and use alias analysis to allow us to delete unused  
							
							 
							
							... 
							
							
							
							call and invoke instructions that are known to not write to memory.
llvm-svn: 12807 
							
						 
						
							2004-04-10 06:53:09 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								56e4d3d8ad 
								
							 
						 
						
							
							
								
								Implement select.ll:test12*  
							
							 
							
							... 
							
							
							
							This transforms code like this:
   %C = or %A, %B
   %D = select %cond, %C, %A
into:
   %C = select %cond, %B, 0
   %D = or %A, %C
Since B is often a constant, the select can often be eliminated.  In any case,
this reduces the usage count of A, allowing subsequent optimizations to happen.
This xform applies when the operator is any of:
  add, sub, mul, or, xor, and, shl, shr
llvm-svn: 12800 
							
						 
						
							2004-04-09 23:46:01 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								183b336a54 
								
							 
						 
						
							
							
								
								Fold binary operators with a constant operand into select instructions  
							
							 
							
							... 
							
							
							
							that have a constant operand.  This implements
add.ll:test19, shift.ll:test15*, and others that are not tested
llvm-svn: 12794 
							
						 
						
							2004-04-09 19:05:30 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								cf7baf3519 
								
							 
						 
						
							
							
								
								Implement select.ll:test11  
							
							 
							
							... 
							
							
							
							llvm-svn: 12793 
							
						 
						
							2004-04-09 18:19:44 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								e228ee5870 
								
							 
						 
						
							
							
								
								Implement InstCombine/cast-propagate.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 12784 
							
						 
						
							2004-04-08 20:39:49 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1c631e813d 
								
							 
						 
						
							
							
								
								Implement InstCombine/select.ll:test[7-10]  
							
							 
							
							... 
							
							
							
							llvm-svn: 12769 
							
						 
						
							2004-04-08 04:43:23 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2b2412d0c8 
								
							 
						 
						
							
							
								
								Implement test/Regression/Transforms/InstCombine/getelementptr_index.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 12762 
							
						 
						
							2004-04-07 18:38:20 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4d1fcf1dcd 
								
							 
						 
						
							
							
								
								Fix a bug in yesterdays checkins which broke siod.  siod is a great testcase!  :)  
							
							 
							
							... 
							
							
							
							llvm-svn: 12659 
							
						 
						
							2004-04-05 16:02:41 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8953b90aaa 
								
							 
						 
						
							
							
								
								Fix InstCombine/2004-04-04-InstCombineReplaceAllUsesWith.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 12658 
							
						 
						
							2004-04-05 02:10:19 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								69193f93b6 
								
							 
						 
						
							
							
								
								Support getelementptr instructions which use uint's to index into structure  
							
							 
							
							... 
							
							
							
							types and can have arbitrary 32- and 64-bit integer types indexing into
sequential types.
llvm-svn: 12653 
							
						 
						
							2004-04-05 01:30:19 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								e61b67d7d5 
								
							 
						 
						
							
							
								
								Rewrite the indvars pass to use the ScalarEvolution analysis.  
							
							 
							
							... 
							
							
							
							This also implements some new features for the indvars pass, including
linear function test replacement, exit value substitution, and it works with
a much more general class of induction variables and loops.
llvm-svn: 12620 
							
						 
						
							2004-04-02 20:24:31 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								59fdf74968 
								
							 
						 
						
							
							
								
								Remove some assertions that are now bogus with the last patch I put in  
							
							 
							
							... 
							
							
							
							llvm-svn: 12595 
							
						 
						
							2004-04-01 19:21:46 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								146d0df5e4 
								
							 
						 
						
							
							
								
								Fix PR306: Loop simplify incorrectly updates dominator information  
							
							 
							
							... 
							
							
							
							Testcase: LoopSimplify/2004-04-01-IncorrectDomUpdate.ll
llvm-svn: 12592 
							
						 
						
							2004-04-01 19:06:07 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								61fab1409d 
								
							 
						 
						
							
							
								
								Add warning  
							
							 
							
							... 
							
							
							
							llvm-svn: 12573 
							
						 
						
							2004-03-31 22:00:30 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								533bc49775 
								
							 
						 
						
							
							
								
								Implement select.ll:test[3-6]  
							
							 
							
							... 
							
							
							
							llvm-svn: 12544 
							
						 
						
							2004-03-30 19:37:13 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								059f390257 
								
							 
						 
						
							
							
								
								Add a simple select instruction lowering pass  
							
							 
							
							... 
							
							
							
							llvm-svn: 12540 
							
						 
						
							2004-03-30 18:41:10 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								56b5051428 
								
							 
						 
						
							
							
								
								X % -1 == X % 1 == 0  
							
							 
							
							... 
							
							
							
							llvm-svn: 12520 
							
						 
						
							2004-03-26 16:11:24 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								57c67b06e9 
								
							 
						 
						
							
							
								
								Two changes:  
							
							 
							
							... 
							
							
							
							#1  is to unconditionally strip constantpointerrefs out of
instruction operands where they are absolutely pointless and inhibit
optimization.  GRRR!
#2  is to implement InstCombine/getelementptr_const.ll
llvm-svn: 12519 
							
						 
						
							2004-03-25 22:59:29 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								abb77c9959 
								
							 
						 
						
							
							
								
								Teach the optimizer to delete zero sized alloca's (but not mallocs!)  
							
							 
							
							... 
							
							
							
							llvm-svn: 12507 
							
						 
						
							2004-03-19 06:08:10 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								684fa5ac64 
								
							 
						 
						
							
							
								
								Be more accurate  
							
							 
							
							... 
							
							
							
							llvm-svn: 12464 
							
						 
						
							2004-03-17 01:59:27 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a3783a577e 
								
							 
						 
						
							
							
								
								Fix bug in previous checkin  
							
							 
							
							... 
							
							
							
							llvm-svn: 12458 
							
						 
						
							2004-03-16 23:36:49 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								95057f6ad1 
								
							 
						 
						
							
							
								
								Okay, so there is no reasonable way for tail duplication to update SSA form,  
							
							 
							
							... 
							
							
							
							as it is making effectively arbitrary modifications to the CFG and we don't
have a domset/domfrontier implementations that can handle the dynamic updates.
Instead of having a bunch of code that doesn't actually work in practice,
just demote any potentially tricky values to the stack (causing the problem
to go away entirely).  Later invocations of mem2reg will rebuild SSA for us.
This fixes all of the major performance regressions with tail duplication
from LLVM 1.1.  For example, this loop:
---
int popcount(int x) {
  int result = 0;
  while (x != 0) {
    result = result + (x & 0x1);
    x = x >> 1;
  }
  return result;
}
---
Used to be compiled into:
int %popcount(int %X) {
entry:
	br label %loopentry
loopentry:		; preds = %entry, %no_exit
	%x.0 = phi int [ %X, %entry ], [ %tmp.9, %no_exit ]		; <int> [#uses=3]
	%result.1.0 = phi int [ 0, %entry ], [ %tmp.6, %no_exit ]		; <int> [#uses=2]
	%tmp.1 = seteq int %x.0, 0		; <bool> [#uses=1]
	br bool %tmp.1, label %loopexit, label %no_exit
no_exit:		; preds = %loopentry
	%tmp.4 = and int %x.0, 1		; <int> [#uses=1]
	%tmp.6 = add int %tmp.4, %result.1.0		; <int> [#uses=1]
	%tmp.9 = shr int %x.0, ubyte 1		; <int> [#uses=1]
	br label %loopentry
loopexit:		; preds = %loopentry
	ret int %result.1.0
}
And is now compiled into:
int %popcount(int %X) {
entry:
        br label %no_exit
no_exit:                ; preds = %entry, %no_exit
        %x.0.0 = phi int [ %X, %entry ], [ %tmp.9, %no_exit ]          ; <int> [#uses=2]
        %result.1.0.0 = phi int [ 0, %entry ], [ %tmp.6, %no_exit ]             ; <int> [#uses=1]
        %tmp.4 = and int %x.0.0, 1              ; <int> [#uses=1]
        %tmp.6 = add int %tmp.4, %result.1.0.0          ; <int> [#uses=2]
        %tmp.9 = shr int %x.0.0, ubyte 1                ; <int> [#uses=2]
        %tmp.1 = seteq int %tmp.9, 0            ; <bool> [#uses=1]
        br bool %tmp.1, label %loopexit, label %no_exit
loopexit:               ; preds = %no_exit
        ret int %tmp.6
}
llvm-svn: 12457 
							
						 
						
							2004-03-16 23:29:09 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7a7b114871 
								
							 
						 
						
							
							
								
								Do not try to optimize PHI nodes with incredibly high degree.  This reduces SCCP  
							
							 
							
							... 
							
							
							
							time from 615s to 1.49s on a large testcase that has a gigantic switch statement
that all of the blocks in the function go to (an intepreter).
llvm-svn: 12442 
							
						 
						
							2004-03-16 19:49:59 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a64923ad26 
								
							 
						 
						
							
							
								
								Do not copy gigantic switch instructions  
							
							 
							
							... 
							
							
							
							llvm-svn: 12441 
							
						 
						
							2004-03-16 19:45:22 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								db5b8f4d6b 
								
							 
						 
						
							
							
								
								Fix a regression from this patch:  
							
							 
							
							... 
							
							
							
							http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040308/013095.html 
Basically, this patch only updated the immediate dominatees of the header node
to tell them that the preheader also dominated them.  In practice, ALL
dominatees of the header node are also dominated by the preheader.
This fixes: LoopSimplify/2004-03-15-IncorrectDomUpdate.
and PR293
llvm-svn: 12434 
							
						 
						
							2004-03-16 06:00:15 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								cd83282df1 
								
							 
						 
						
							
							
								
								Add counters for the number of calls elimianted  
							
							 
							
							... 
							
							
							
							llvm-svn: 12420 
							
						 
						
							2004-03-15 05:46:59 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								20cda2645e 
								
							 
						 
						
							
							
								
								Implement LICM of calls in simple cases.  This is sufficient to move around  
							
							 
							
							... 
							
							
							
							sin/cos/strlen calls and stuff.  This implements:
  LICM/call_sink_pure_function.ll
  LICM/call_sink_const_function.ll
llvm-svn: 12415 
							
						 
						
							2004-03-15 04:11:30 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b68659552a 
								
							 
						 
						
							
							
								
								Do not create empty basic blocks when the lowerswitch pass expects blocks to  
							
							 
							
							... 
							
							
							
							be non-empty!  This fixes LowerSwitch/2004-03-13-SwitchIsDefaultCrash.ll
llvm-svn: 12384 
							
						 
						
							2004-03-14 04:14:31 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d078812f96 
								
							 
						 
						
							
							
								
								If a block is dead, dominators will not be calculated for it.  Because of this  
							
							 
							
							... 
							
							
							
							loop information won't see it, and we could have unreachable blocks pointing to
the non-header node of blocks in a natural loop.  This isn't tidy, so have the
loopsimplify pass clean it up.
llvm-svn: 12380 
							
						 
						
							2004-03-14 03:59:22 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7d2a539735 
								
							 
						 
						
							
							
								
								Add some debugging output  
							
							 
							
							... 
							
							
							
							Fix InstCombine/2004-03-13-InstCombineInfLoop.ll which caused an infinite
loop compiling (I think) povray.
llvm-svn: 12365 
							
						 
						
							2004-03-13 23:54:27 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								797cb2f6c1 
								
							 
						 
						
							
							
								
								This little patch speeds up the loop used to update the dominator set analysis.  
							
							 
							
							... 
							
							
							
							On the testcase from GCC PR12440, which has a LOT of loops (1392 of which require
preheaders to be inserted), this speeds up the loopsimplify pass from 1.931s to
0.1875s.  The loop in question goes from 1.65s -> 0.0097s, which isn't bad. All of
these times are a debug build.
This adds a dependency on DominatorTree analysis that was not there before, but
we always had dominatortree available anyway, because LICM requires both loop
simplify and DT, so this doesn't add any extra analysis in practice.
llvm-svn: 12362 
							
						 
						
							2004-03-13 22:01:26 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								022167f13b 
								
							 
						 
						
							
							
								
								Implement sub.ll:test14  
							
							 
							
							... 
							
							
							
							llvm-svn: 12355 
							
						 
						
							2004-03-13 00:11:49 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								92295c5031 
								
							 
						 
						
							
							
								
								Implement InstCombine/sub.ll:test12 & test13  
							
							 
							
							... 
							
							
							
							llvm-svn: 12353 
							
						 
						
							2004-03-12 23:53:13 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								59db22dcd4 
								
							 
						 
						
							
							
								
								Add sccp support for select instructions  
							
							 
							
							... 
							
							
							
							llvm-svn: 12318 
							
						 
						
							2004-03-12 05:52:44 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b909e8b0d4 
								
							 
						 
						
							
							
								
								Add trivial optimizations for select instructions  
							
							 
							
							... 
							
							
							
							llvm-svn: 12317 
							
						 
						
							2004-03-12 05:52:32 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								538fee7aa2 
								
							 
						 
						
							
							
								
								Since 'load null' is undefined, we can make it do whatever we want.  Returning  
							
							 
							
							... 
							
							
							
							a zero value is the most likely way to cause further simplification, so we do it.
llvm-svn: 12197 
							
						 
						
							2004-03-07 22:16:24 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7abcc387de 
								
							 
						 
						
							
							
								
								Don't emit things like malloc(16*1).  Allocation instructions are fixed arity now.  
							
							 
							
							... 
							
							
							
							llvm-svn: 12086 
							
						 
						
							2004-03-03 01:40:53 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								5cf39339d1 
								
							 
						 
						
							
							
								
								Disable tail duplication in a case that breaks on Olden/tsp  
							
							 
							
							... 
							
							
							
							llvm-svn: 12021 
							
						 
						
							2004-03-01 01:12:13 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								bf2963ef91 
								
							 
						 
						
							
							
								
								Fix PR255: [tailduplication] Single basic block loops are very rare  
							
							 
							
							... 
							
							
							
							Note that this is a band-aid put over a band-aid.  This just undisables
tail duplication in on very specific case that it seems to work in.
llvm-svn: 11989 
							
						 
						
							2004-02-29 06:41:20 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								772eafa332 
								
							 
						 
						
							
							
								
								if there is already a prototype for malloc/free, use it, even if it's incorrect.  
							
							 
							
							... 
							
							
							
							Do not just inject a new prototype.
llvm-svn: 11951 
							
						 
						
							2004-02-28 18:51:45 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								51ea127bf3 
								
							 
						 
						
							
							
								
								Rename AddUsesToWorkList -> AddUsersToWorkList, as that is what it does.  
							
							 
							
							... 
							
							
							
							Create a new AddUsesToWorkList method
optimize memmove/set/cpy of zero bytes to a noop.
llvm-svn: 11941 
							
						 
						
							2004-02-28 05:22:00 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f3a366062c 
								
							 
						 
						
							
							
								
								Turn 'free null' into nothing  
							
							 
							
							... 
							
							
							
							llvm-svn: 11940 
							
						 
						
							2004-02-28 04:57:37 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4f7accab96 
								
							 
						 
						
							
							
								
								Implement test/Regression/Transforms/InstCombine/canonicalize_branch.ll  
							
							 
							
							... 
							
							
							
							This is a really minor thing, but might help out the 'switch statement induction'
code in simplifycfg.
llvm-svn: 11900 
							
						 
						
							2004-02-27 06:27:46 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9c6833c5ca 
								
							 
						 
						
							
							
								
								Fix incorrect debug code  
							
							 
							
							... 
							
							
							
							llvm-svn: 11821 
							
						 
						
							2004-02-25 15:15:04 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8ee0593f0d 
								
							 
						 
						
							
							
								
								Fix a faulty optimization on FP values  
							
							 
							
							... 
							
							
							
							llvm-svn: 11801 
							
						 
						
							2004-02-24 18:10:14 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ae739aefd7 
								
							 
						 
						
							
							
								
								Generate much more efficient code in programs like pifft  
							
							 
							
							... 
							
							
							
							llvm-svn: 11775 
							
						 
						
							2004-02-23 21:46:58 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c40b9d7d51 
								
							 
						 
						
							
							
								
								Fix a small typeo in my checkin last night that broke vortex and other programs :(  
							
							 
							
							... 
							
							
							
							llvm-svn: 11774 
							
						 
						
							2004-02-23 21:46:42 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f5ce254692 
								
							 
						 
						
							
							
								
								Fix InstCombine/2004-02-23-ShiftShiftOverflow.ll  
							
							 
							
							... 
							
							
							
							Also, turn 'shr int %X, 1234' into 'shr int %X, 31'
llvm-svn: 11768 
							
						 
						
							2004-02-23 20:30:06 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2b55ea38bc 
								
							 
						 
						
							
							
								
								Implement cast.ll::test14/15  
							
							 
							
							... 
							
							
							
							llvm-svn: 11742 
							
						 
						
							2004-02-23 07:16:20 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								e79e854c5c 
								
							 
						 
						
							
							
								
								Refactor some code.  In the mul - setcc folding case, we really care about  
							
							 
							
							... 
							
							
							
							whether this is the sign bit or not, so check unsigned comparisons as well.
llvm-svn: 11740 
							
						 
						
							2004-02-23 06:38:22 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c8a10c4b6a 
								
							 
						 
						
							
							
								
								Implement mul.ll:test11  
							
							 
							
							... 
							
							
							
							llvm-svn: 11737 
							
						 
						
							2004-02-23 06:00:11 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								59611149ee 
								
							 
						 
						
							
							
								
								Implement "strength reduction" of   X <= C and X >= C  
							
							 
							
							... 
							
							
							
							llvm-svn: 11735 
							
						 
						
							2004-02-23 05:47:48 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2635b52d4e 
								
							 
						 
						
							
							
								
								Implement InstCombine/mul.ll:test10, which is a case that occurs when dealing  
							
							 
							
							... 
							
							
							
							with "predication"
llvm-svn: 11734 
							
						 
						
							2004-02-23 05:39:21 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8d0bacbb9e 
								
							 
						 
						
							
							
								
								Implement Transforms/InstCombine/cast.ll:test13, a case which occurs in a  
							
							 
							
							... 
							
							
							
							hot 164.gzip loop.
llvm-svn: 11702 
							
						 
						
							2004-02-22 05:25:17 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4db2d22bea 
								
							 
						 
						
							
							
								
								Fold PHI nodes of constants which are only used by a single cast.  This implements  
							
							 
							
							... 
							
							
							
							phi.ll:test4
llvm-svn: 11494 
							
						 
						
							2004-02-16 05:07:08 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b36d908f7b 
								
							 
						 
						
							
							
								
								Teach LLVM to unravel the "swap idiom".  This implements:  
							
							 
							
							... 
							
							
							
							Regression/Transforms/InstCombine/xor.ll:test20
llvm-svn: 11492 
							
						 
						
							2004-02-16 03:54:20 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c207635fd5 
								
							 
						 
						
							
							
								
								Implement Transforms/InstCombine/xor.ll:test19  
							
							 
							
							... 
							
							
							
							llvm-svn: 11490 
							
						 
						
							2004-02-16 01:20:27 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d85e061575 
								
							 
						 
						
							
							
								
								Instead of producing calls to setjmp/longjmp, produce uses of the  
							
							 
							
							... 
							
							
							
							llvm.setjmp/llvm.longjmp intrinsics.
llvm-svn: 11482 
							
						 
						
							2004-02-15 22:24:27 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								76b2ff4ded 
								
							 
						 
						
							
							
								
								Adjustments to support the new ConstantAggregateZero class  
							
							 
							
							... 
							
							
							
							llvm-svn: 11474 
							
						 
						
							2004-02-15 05:55:15 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7cbb22abe6 
								
							 
						 
						
							
							
								
								Expose a pass ID that can be 'required'  
							
							 
							
							... 
							
							
							
							llvm-svn: 11376 
							
						 
						
							2004-02-13 16:16:16 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d4b36cf9bc 
								
							 
						 
						
							
							
								
								Remove obsolete comment.  Unreachable blocks will automatically be left at the  
							
							 
							
							... 
							
							
							
							end of the function.
llvm-svn: 11313 
							
						 
						
							2004-02-11 05:20:50 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								5add05129e 
								
							 
						 
						
							
							
								
								Add an _embarassingly simple_ implementation of basic block layout.  This is  
							
							 
							
							... 
							
							
							
							more of a testcase for profiling information than anything that should reasonably
be used, but it's a starting point.  When I have more time I will whip this into
better shape.
llvm-svn: 11311 
							
						 
						
							2004-02-11 04:53:20 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								37d46f4815 
								
							 
						 
						
							
							
								
								Only add the global variable with the abort message if an unwind actually  
							
							 
							
							... 
							
							
							
							occurs in the program.
llvm-svn: 11249 
							
						 
						
							2004-02-09 22:48:47 +00:00  
						
					 
				
					
						
							
							
								 
								Misha Brukman
							
						 
						
							 
							
							
							
							
								
							
							
								3480e935d0 
								
							 
						 
						
							
							
								
								Fix grammar-o.  
							
							 
							
							... 
							
							
							
							llvm-svn: 11210 
							
						 
						
							2004-02-08 22:27:33 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3b7f6b2217 
								
							 
						 
						
							
							
								
								Improve compatibility with programs that already have a prototype for 'write',  
							
							 
							
							... 
							
							
							
							even if it is wierd in some way.
llvm-svn: 11207 
							
						 
						
							2004-02-08 22:14:44 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								fae8ab3088 
								
							 
						 
						
							
							
								
								rename the "exceptional" destination of an invoke instruction to the 'unwind' dest  
							
							 
							
							... 
							
							
							
							llvm-svn: 11202 
							
						 
						
							2004-02-08 21:44:31 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								108cadc274 
								
							 
						 
						
							
							
								
								Implement proper invoke/unwind lowering.  
							
							 
							
							... 
							
							
							
							This fixed PR16 "[lowerinvoke] The -lowerinvoke pass does not insert calls to setjmp/longjmp"
llvm-svn: 11195 
							
						 
						
							2004-02-08 19:53:56 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								476488e669 
								
							 
						 
						
							
							
								
								Add a call to 'write' right before the call to abort() in the unwind path.  
							
							 
							
							... 
							
							
							
							This causes the JIT, or LLC'd program to print out a nice message, explaining
WHY the program aborted.
llvm-svn: 11184 
							
						 
						
							2004-02-08 07:30:29 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2dd1c8d8ce 
								
							 
						 
						
							
							
								
								Fix another dominator update bug.  These bugs keep getting exposed because GCSE  
							
							 
							
							... 
							
							
							
							keeps finding more code motion opportunities now that the dominators are correct!
llvm-svn: 11142 
							
						 
						
							2004-02-05 23:20:59 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c0c953f0bc 
								
							 
						 
						
							
							
								
								Fix bug updating dominators  
							
							 
							
							... 
							
							
							
							llvm-svn: 11140 
							
						 
						
							2004-02-05 22:33:26 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f978c421e5 
								
							 
						 
						
							
							
								
								Add debug output  
							
							 
							
							... 
							
							
							
							llvm-svn: 11139 
							
						 
						
							2004-02-05 22:33:19 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								14ab84a483 
								
							 
						 
						
							
							
								
								Fix PR223: Loopsimplify incorrectly updates dominator information  
							
							 
							
							... 
							
							
							
							The problem is that the dominator update code didn't "realize" that it's
possible for the newly inserted basic block to dominate anything.  Because
it IS possible, stuff was getting updated wrong.
llvm-svn: 11137 
							
						 
						
							2004-02-05 21:12:24 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8d414ad035 
								
							 
						 
						
							
							
								
								Adjust to the new BasicBlock ctor, which requires a function parameter  
							
							 
							
							... 
							
							
							
							llvm-svn: 11114 
							
						 
						
							2004-02-04 03:58:28 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c2f0aa58df 
								
							 
						 
						
							
							
								
								Disable (x - (y - z)) => (x + (z - y)) optimization for floating point.  
							
							 
							
							... 
							
							
							
							llvm-svn: 11083 
							
						 
						
							2004-02-02 20:09:56 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								cacd30b957 
								
							 
						 
						
							
							
								
								Update comment  
							
							 
							
							... 
							
							
							
							llvm-svn: 11082 
							
						 
						
							2004-02-02 20:09:22 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ed9b12c31a 
								
							 
						 
						
							
							
								
								Disable tail duplication in any "hard" cases, where it might break SSA form.  
							
							 
							
							... 
							
							
							
							llvm-svn: 11052 
							
						 
						
							2004-02-01 06:32:28 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7c91a6176c 
								
							 
						 
						
							
							
								
								Fix the count of the number of instructions removed  
							
							 
							
							... 
							
							
							
							llvm-svn: 11049 
							
						 
						
							2004-02-01 05:15:07 +00:00  
						
					 
				
					
						
							
							
								 
								Misha Brukman
							
						 
						
							 
							
							
							
							
								
							
							
								bf43787f33 
								
							 
						 
						
							
							
								
								Hyphenate `target-dependent'  
							
							 
							
							... 
							
							
							
							llvm-svn: 11003 
							
						 
						
							2004-01-28 20:43:01 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1f7942fe7d 
								
							 
						 
						
							
							
								
								Fix InstCombine/2004-01-13-InstCombineInvokePHI.ll, which also fixes lots  
							
							 
							
							... 
							
							
							
							of C++ programs in Shootout-C++, including lists1 and moments, etc
llvm-svn: 10845 
							
						 
						
							2004-01-14 06:06:08 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								fcf21a75b0 
								
							 
						 
						
							
							
								
								Fix bug in previous checkin  
							
							 
							
							... 
							
							
							
							llvm-svn: 10798 
							
						 
						
							2004-01-12 19:47:05 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c1e7cc0fbe 
								
							 
						 
						
							
							
								
								Eliminate use of ConstantHandling and ConstantExpr::getShift interfaces  
							
							 
							
							... 
							
							
							
							llvm-svn: 10796 
							
						 
						
							2004-01-12 19:35:11 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d7ccc9e5a5 
								
							 
						 
						
							
							
								
								Add header file I accidentally removed in teh shuffle  
							
							 
							
							... 
							
							
							
							llvm-svn: 10795 
							
						 
						
							2004-01-12 19:15:20 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c9fb4a3b89 
								
							 
						 
						
							
							
								
								Remove use of the ConstantHandling interfaces  
							
							 
							
							... 
							
							
							
							llvm-svn: 10793 
							
						 
						
							2004-01-12 19:12:50 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1b7d4d7b63 
								
							 
						 
						
							
							
								
								Don't use ConstantExpr::getShift anymore  
							
							 
							
							... 
							
							
							
							llvm-svn: 10791 
							
						 
						
							2004-01-12 19:08:43 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								118a76cb2f 
								
							 
						 
						
							
							
								
								Remove unneeded #include  
							
							 
							
							... 
							
							
							
							llvm-svn: 10788 
							
						 
						
							2004-01-12 18:33:54 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								0fe5b32c01 
								
							 
						 
						
							
							
								
								Use constantexprs for casts.  Eliminate use of the ConstantHandling interfaces  
							
							 
							
							... 
							
							
							
							llvm-svn: 10779 
							
						 
						
							2004-01-12 17:43:40 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								fe992d4332 
								
							 
						 
						
							
							
								
								Fix fairly severe bug in my last checking where we treated all unfoldable  
							
							 
							
							... 
							
							
							
							constants as being "true" when evaluating branches.  This was introduced
because we now create constantexprs for the constants instead of failing the
fold.
llvm-svn: 10778 
							
						 
						
							2004-01-12 17:40:36 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								49f74522ec 
								
							 
						 
						
							
							
								
								* Implement minor performance optimization for the getelementptr case  
							
							 
							
							... 
							
							
							
							* Implement SCCP of load instructions, implementing Transforms/SCCP/loadtest.ll
  This allows us to fold expressions like "foo"[2], even if the pointer is only
  a conditional constant.
llvm-svn: 10767 
							
						 
						
							2004-01-12 04:29:41 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7e8af38637 
								
							 
						 
						
							
							
								
								Do not hack on volatile loads.  I'm not sure what the point of a volatile load  
							
							 
							
							... 
							
							
							
							from constant memory is, but lets not take chances.
llvm-svn: 10765 
							
						 
						
							2004-01-12 04:13:56 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								05fe6847a8 
								
							 
						 
						
							
							
								
								Implement SCCP/phitest.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 10763 
							
						 
						
							2004-01-12 03:57:30 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3bcecb92f3 
								
							 
						 
						
							
							
								
								Update obsolete comments  
							
							 
							
							... 
							
							
							
							Fix iterator invalidation problems which was causing -mstrip to miss some
entries, and read free'd memory.  This shrinks the symbol table of 254.gap
from 333 to 284 bytes!  :)
llvm-svn: 10751 
							
						 
						
							2004-01-10 21:36:49 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								49525f8cf4 
								
							 
						 
						
							
							
								
								Finegrainify namespacification  
							
							 
							
							... 
							
							
							
							llvm-svn: 10725 
							
						 
						
							2004-01-09 06:02:20 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								59d2d7fc33 
								
							 
						 
						
							
							
								
								Improve encapsulation in the Loop and LoopInfo classes by eliminating the  
							
							 
							
							... 
							
							
							
							getSubLoops/getTopLevelLoops methods, replacing them with iterator-based
accessors.
llvm-svn: 10714 
							
						 
						
							2004-01-08 00:09:44 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7e755e443f 
								
							 
						 
						
							
							
								
								More minor non-functional changes.  This now computes the exit condition, though  
							
							 
							
							... 
							
							
							
							it doesn't do anything with it.
llvm-svn: 10590 
							
						 
						
							2003-12-23 07:47:09 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a02d5aa6ce 
								
							 
						 
						
							
							
								
								Don't mind me, I'm just refactoring away.  This patch makes room for LFTR, but  
							
							 
							
							... 
							
							
							
							contains no functionality changes.
llvm-svn: 10583 
							
						 
						
							2003-12-22 09:53:29 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6449dcefbc 
								
							 
						 
						
							
							
								
								Implement IndVarsSimplify/pointer-indvars.ll, transforming pointer  
							
							 
							
							... 
							
							
							
							arithmetic into "array subscripts"
llvm-svn: 10580 
							
						 
						
							2003-12-22 05:02:01 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d3678bc7c5 
								
							 
						 
						
							
							
								
								Fix PR194  
							
							 
							
							... 
							
							
							
							llvm-svn: 10573 
							
						 
						
							2003-12-22 03:58:44 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								fc7bdac1b3 
								
							 
						 
						
							
							
								
								Fix ADCE/2003-12-19-MergeReturn.llx  
							
							 
							
							... 
							
							
							
							llvm-svn: 10539 
							
						 
						
							2003-12-19 09:08:34 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								918460190f 
								
							 
						 
						
							
							
								
								Remove the wierd "Operands" loop, by traversing basicblocks in reverse order  
							
							 
							
							... 
							
							
							
							llvm-svn: 10536 
							
						 
						
							2003-12-19 08:18:16 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								547192d688 
								
							 
						 
						
							
							
								
								Implement LICM/sink_multiple.ll, by sinking all possible instructions in the  
							
							 
							
							... 
							
							
							
							loop before hoisting any.
llvm-svn: 10534 
							
						 
						
							2003-12-19 07:22:45 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								031a3f8cc7 
								
							 
						 
						
							
							
								
								Generalize a special case to fix PR187  
							
							 
							
							... 
							
							
							
							llvm-svn: 10531 
							
						 
						
							2003-12-19 06:27:08 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								91daeb5431 
								
							 
						 
						
							
							
								
								Factor code out into the Utils library  
							
							 
							
							... 
							
							
							
							llvm-svn: 10530 
							
						 
						
							2003-12-19 05:58:40 +00:00  
						
					 
				
					
						
							
							
								 
								John Criswell
							
						 
						
							 
							
							
							
							
								
							
							
								b22e9b4b35 
								
							 
						 
						
							
							
								
								Reverted back to previous revision - this was previously merged  
							
							 
							
							... 
							
							
							
							according to the CVS log messages.
llvm-svn: 10517 
							
						 
						
							2003-12-18 17:19:19 +00:00  
						
					 
				
					
						
							
							
								 
								John Criswell
							
						 
						
							 
							
							
							
							
								
							
							
								86a3a48697 
								
							 
						 
						
							
							
								
								Merged in RELEASE_11.  
							
							 
							
							... 
							
							
							
							llvm-svn: 10516 
							
						 
						
							2003-12-18 16:43:17 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9e2b42a0c8 
								
							 
						 
						
							
							
								
								When we delete instructions from the loop, make sure to remove them from the  
							
							 
							
							... 
							
							
							
							AliasSetTracker as well.
llvm-svn: 10507 
							
						 
						
							2003-12-18 08:12:32 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6c08bb8b8e 
								
							 
						 
						
							
							
								
								Fix for PR185 & IndVarsSimplify/2003-12-15-Crash.llx  
							
							 
							
							... 
							
							
							
							llvm-svn: 10473 
							
						 
						
							2003-12-15 17:34:02 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								884e824534 
								
							 
						 
						
							
							
								
								Refactor code just a little bit, allowing us to implement TailCallElim/return_constant.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 10467 
							
						 
						
							2003-12-14 23:57:39 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d1c371c32c 
								
							 
						 
						
							
							
								
								Do not promote volatile alias sets into registers  
							
							 
							
							... 
							
							
							
							llvm-svn: 10458 
							
						 
						
							2003-12-14 04:52:31 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								34399dda2d 
								
							 
						 
						
							
							
								
								Fix LICM/2003-12-11-SinkingToPHI.ll, and quite possibly all of the other known problems in the universe.  
							
							 
							
							... 
							
							
							
							llvm-svn: 10409 
							
						 
						
							2003-12-11 22:23:32 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6281fd3ead 
								
							 
						 
						
							
							
								
								Fix bug: LICM/sink_multiple_exits.ll  
							
							 
							
							... 
							
							
							
							Thanks for pointing this out John  :)
llvm-svn: 10387 
							
						 
						
							2003-12-10 22:35:56 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								55c2113b7b 
								
							 
						 
						
							
							
								
								Don't allow dead instructions to stop sinking early.  
							
							 
							
							... 
							
							
							
							llvm-svn: 10386 
							
						 
						
							2003-12-10 20:43:29 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								713907e2b8 
								
							 
						 
						
							
							
								
								Fix bug: IndVarsSimplify/2003-12-10-RemoveInstrCrash.llx  
							
							 
							
							... 
							
							
							
							llvm-svn: 10385 
							
						 
						
							2003-12-10 20:43:04 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7e5bd59da2 
								
							 
						 
						
							
							
								
								Finegrainify namespacification  
							
							 
							
							... 
							
							
							
							Fix bug: LowerInvoke/2003-12-10-Crash.llx
llvm-svn: 10382 
							
						 
						
							2003-12-10 20:22:42 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ccd9f3c1f8 
								
							 
						 
						
							
							
								
								Finegrainify namespacification  
							
							 
							
							... 
							
							
							
							Reorder #includes
Implement: IndVarsSimplify/2003-12-10-IndVarDeadCode.ll
llvm-svn: 10376 
							
						 
						
							2003-12-10 18:06:47 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7710f2f49e 
								
							 
						 
						
							
							
								
								Finegrainify namespacification  
							
							 
							
							... 
							
							
							
							Fix bug: LoopSimplify/2003-12-10-ExitBlocksProblem.ll
llvm-svn: 10373 
							
						 
						
							2003-12-10 17:20:35 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6364314a6e 
								
							 
						 
						
							
							
								
								Simplify code  
							
							 
							
							... 
							
							
							
							llvm-svn: 10371 
							
						 
						
							2003-12-10 16:58:24 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								48b4b852b4 
								
							 
						 
						
							
							
								
								Avoid performing two identical lookups when one will suffice  
							
							 
							
							... 
							
							
							
							llvm-svn: 10370 
							
						 
						
							2003-12-10 16:57:24 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								edda1af35a 
								
							 
						 
						
							
							
								
								Make LICM itself a bit more efficient, and make the generated code more efficient too: don't insert a store in every exit block, because a particular block may be exited to more than once by a loop  
							
							 
							
							... 
							
							
							
							llvm-svn: 10369 
							
						 
						
							2003-12-10 15:56:24 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								aaaea51090 
								
							 
						 
						
							
							
								
								Implement instruction sinking out of loops.  This still can do a little bit  
							
							 
							
							... 
							
							
							
							better job, but this is the majority of the work.  This implements
LICM/sink*.ll
llvm-svn: 10358 
							
						 
						
							2003-12-10 06:41:05 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6c237bcdf2 
								
							 
						 
						
							
							
								
								Do not insert one entry PHI nodes in split exit blocks!  
							
							 
							
							... 
							
							
							
							llvm-svn: 10348 
							
						 
						
							2003-12-09 23:12:55 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								65c1193d55 
								
							 
						 
						
							
							
								
								Refactor code a little bit, eliminating the gratuitous InstVisitor, which  
							
							 
							
							... 
							
							
							
							should make subsequent changes simpler.  This also allows us to hoist vaarg
and vanext instructions
llvm-svn: 10342 
							
						 
						
							2003-12-09 19:32:44 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c05176843e 
								
							 
						 
						
							
							
								
								Fine grainify namespacification  
							
							 
							
							... 
							
							
							
							Code cleanups
Make LICM::SafeToHoist marginally more efficient
llvm-svn: 10341 
							
						 
						
							2003-12-09 17:18:00 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								50663a1a78 
								
							 
						 
						
							
							
								
								Implement: TailCallElim/accum_recursion_constant_arg.ll  
							
							 
							
							... 
							
							
							
							Also make sure to clean up any PHI nodes that are inserted which are pointless.
llvm-svn: 10333 
							
						 
						
							2003-12-08 23:37:35 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								198e620752 
								
							 
						 
						
							
							
								
								Implement: test/Regression/Transforms/TailCallElim/accum_recursion.ll  
							
							 
							
							... 
							
							
							
							We now insert accumulator variables as necessary to eliminate tail recursion
more aggressively.  This is still fairly limited, but allows us to transform
fib/factorial, and other functions into nice happy loops.  :)
llvm-svn: 10332 
							
						 
						
							2003-12-08 23:19:26 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a7b6f3ab9c 
								
							 
						 
						
							
							
								
								Cleanup and restructure the code to make it easier to read and maintain.  
							
							 
							
							... 
							
							
							
							The only functionality change is that we now implement:
  Regression/Transforms/TailCallElim/intervening-inst.ll
Which is really kinda pointless, because it means that trivially dead code
does not interfere with -tce, but trivially dead code probably wouldn't be
around anytime when this pass is run anyway.
The point of including this change it to support other more aggressive
transformations when we have the analysis capabilities to do so.
llvm-svn: 10312 
							
						 
						
							2003-12-08 05:34:54 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8427bffb9a 
								
							 
						 
						
							
							
								
								* Finegrainify namespacification  
							
							 
							
							... 
							
							
							
							* Transform: free <ty>* (cast <ty2>* X to <ty>*) into free <ty2>* X
llvm-svn: 10303 
							
						 
						
							2003-12-07 01:24:23 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								40d2aeb28f 
								
							 
						 
						
							
							
								
								Finegrainify namespacification  
							
							 
							
							... 
							
							
							
							Fix regressions ScalarRepl/basictest.ll & arraytest.ll
llvm-svn: 10287 
							
						 
						
							2003-12-02 17:43:55 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								52310702a1 
								
							 
						 
						
							
							
								
								Do not use index type to determine what it is indexing into!  
							
							 
							
							... 
							
							
							
							llvm-svn: 10226 
							
						 
						
							2003-11-25 21:09:18 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4cc2cc5c58 
								
							 
						 
						
							
							
								
								Do not crash when deleing a region with a dead invoke instruction  
							
							 
							
							... 
							
							
							
							llvm-svn: 10161 
							
						 
						
							2003-11-22 02:13:08 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1ad805977d 
								
							 
						 
						
							
							
								
								Finegrainify namespacification  
							
							 
							
							... 
							
							
							
							The module stripping pass should not strip symbols on external globals
llvm-svn: 10157 
							
						 
						
							2003-11-22 01:29:35 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a29600046d 
								
							 
						 
						
							
							
								
								Minor cleanups and simplifications  
							
							 
							
							... 
							
							
							
							llvm-svn: 10127 
							
						 
						
							2003-11-21 16:52:05 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2af517281d 
								
							 
						 
						
							
							
								
								Start using the nicer terminator auto-insertion API  
							
							 
							
							... 
							
							
							
							llvm-svn: 10111 
							
						 
						
							2003-11-20 18:25:24 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								841dd53555 
								
							 
						 
						
							
							
								
								Fix PR116  
							
							 
							
							... 
							
							
							
							llvm-svn: 10032 
							
						 
						
							2003-11-16 21:39:27 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d76fe4ea7d 
								
							 
						 
						
							
							
								
								Implement feature: InstCombine/2003-11-13-ConstExprCastCall.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 9981 
							
						 
						
							2003-11-13 19:17:02 +00:00  
						
					 
				
					
						
							
							
								 
								Brian Gaeke
							
						 
						
							 
							
							
							
							
								
							
							
								960707c335 
								
							 
						 
						
							
							
								
								Put all LLVM code into the llvm namespace, as per bug 109.  
							
							 
							
							... 
							
							
							
							llvm-svn: 9903 
							
						 
						
							2003-11-11 22:41:34 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4474336166 
								
							 
						 
						
							
							
								
								Adjust to new critical edge interface  
							
							 
							
							... 
							
							
							
							llvm-svn: 9853 
							
						 
						
							2003-11-10 04:10:50 +00:00  
						
					 
				
					
						
							
							
								 
								Misha Brukman
							
						 
						
							 
							
							
							
							
								
							
							
								ad03afcb34 
								
							 
						 
						
							
							
								
								Declare FunctionPasses as such so that they can be used in FunctionPassManager.  
							
							 
							
							... 
							
							
							
							llvm-svn: 9768 
							
						 
						
							2003-11-07 17:20:18 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7c94d1171a 
								
							 
						 
						
							
							
								
								Fix flawed logic that was breaking several SPEC benchmarks, including gzip and crafty.  
							
							 
							
							... 
							
							
							
							llvm-svn: 9731 
							
						 
						
							2003-11-05 17:31:36 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8f2f598024 
								
							 
						 
						
							
							
								
								Fix bug with previous implementation:  
							
							 
							
							... 
							
							
							
							-      // ~(c-X) == X-(c-1) == X+(-c+1)
+      // ~(c-X) == X-c-1 == X+(-c-1)
Implement: C - ~X == X + (1+C)
llvm-svn: 9715 
							
						 
						
							2003-11-05 01:06:05 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								e580666532 
								
							 
						 
						
							
							
								
								Minor cleanup, plus implement InstCombine/xor.ll:test17  
							
							 
							
							... 
							
							
							
							llvm-svn: 9711 
							
						 
						
							2003-11-04 23:50:51 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								0f68fa6569 
								
							 
						 
						
							
							
								
								Implement InstCombine/xor.ll:test(15|16)  
							
							 
							
							... 
							
							
							
							llvm-svn: 9708 
							
						 
						
							2003-11-04 23:37:10 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6444c37488 
								
							 
						 
						
							
							
								
								Implement InstCombine/cast-set.ll:test6[a].  This improves code generated for  
							
							 
							
							... 
							
							
							
							a hot function in em3d
llvm-svn: 9673 
							
						 
						
							2003-11-03 05:17:03 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1693079e92 
								
							 
						 
						
							
							
								
								Implement InstCombine/cast-set.ll: test1, test2, test7  
							
							 
							
							... 
							
							
							
							llvm-svn: 9670 
							
						 
						
							2003-11-03 04:25:02 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								af7893203b 
								
							 
						 
						
							
							
								
								Fix bug with zero sized casts  
							
							 
							
							... 
							
							
							
							llvm-svn: 9667 
							
						 
						
							2003-11-03 01:29:41 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d4d987dd4a 
								
							 
						 
						
							
							
								
								Fix bug in previous checkin  
							
							 
							
							... 
							
							
							
							llvm-svn: 9656 
							
						 
						
							2003-11-02 06:54:48 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f4ad165e8b 
								
							 
						 
						
							
							
								
								Implement transmogriphication of allocation instructions  
							
							 
							
							... 
							
							
							
							llvm-svn: 9654 
							
						 
						
							2003-11-02 05:57:39 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								686767f3f6 
								
							 
						 
						
							
							
								
								Fix bug: 2003-10-29-CallSiteResolve.ll & PR70  
							
							 
							
							... 
							
							
							
							llvm-svn: 9600 
							
						 
						
							2003-10-30 00:46:41 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								bcb0f4bf2e 
								
							 
						 
						
							
							
								
								Fix PR66 & ScalarRepl/2003-10-29-ArrayProblem.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 9585 
							
						 
						
							2003-10-29 17:55:44 +00:00  
						
					 
				
					
						
							
							
								 
								John Criswell
							
						 
						
							 
							
							
							
							
								
							
							
								4436c49787 
								
							 
						 
						
							
							
								
								Added LLVM copyright notice to Makefiles.  
							
							 
							
							... 
							
							
							
							llvm-svn: 9312 
							
						 
						
							2003-10-20 22:26:57 +00:00  
						
					 
				
					
						
							
							
								 
								John Criswell
							
						 
						
							 
							
							
							
							
								
							
							
								482202a601 
								
							 
						 
						
							
							
								
								Added LLVM project notice to the top of every C++ source file.  
							
							 
							
							... 
							
							
							
							Header files will be on the way.
llvm-svn: 9298 
							
						 
						
							2003-10-20 19:43:21 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b94550e537 
								
							 
						 
						
							
							
								
								Change the Opcode enum for PHI nodes from "Instruction::PHINode" to "Instruction::PHI" to be more consistent with the other instructions.  
							
							 
							
							... 
							
							
							
							llvm-svn: 9269 
							
						 
						
							2003-10-19 21:34:28 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f0fc9be634 
								
							 
						 
						
							
							
								
								ADd support for the new varargs instructions  
							
							 
							
							... 
							
							
							
							llvm-svn: 9225 
							
						 
						
							2003-10-18 05:56:52 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								50b6858e2e 
								
							 
						 
						
							
							
								
								This code does not require random access use_lists  
							
							 
							
							... 
							
							
							
							llvm-svn: 9156 
							
						 
						
							2003-10-16 16:49:12 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f95d9b99b3 
								
							 
						 
						
							
							
								
								Decrease usage of use_size()  
							
							 
							
							... 
							
							
							
							llvm-svn: 9135 
							
						 
						
							2003-10-15 16:48:29 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								178957028b 
								
							 
						 
						
							
							
								
								Wrap code at 80 columns  
							
							 
							
							... 
							
							
							
							llvm-svn: 9073 
							
						 
						
							2003-10-13 05:04:27 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c4622a6955 
								
							 
						 
						
							
							
								
								Add support to the loop canonicalization pass to make it transform loops to  
							
							 
							
							... 
							
							
							
							have a SINGLE backedge.  This is useful to, for example, the -indvars pass.
This implements testcase LoopSimplify/single-backedge.ll and closes PR#34
llvm-svn: 9065 
							
						 
						
							2003-10-13 00:37:13 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								72272a70b8 
								
							 
						 
						
							
							
								
								Rename loop preheaders pass to loop simplify  
							
							 
							
							... 
							
							
							
							llvm-svn: 9061 
							
						 
						
							2003-10-12 21:52:28 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								55d4788397 
								
							 
						 
						
							
							
								
								File is renamed to LoopSimplify.cpp  
							
							 
							
							... 
							
							
							
							llvm-svn: 9059 
							
						 
						
							2003-10-12 21:44:18 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								154e4d5dea 
								
							 
						 
						
							
							
								
								First step in renaming the preheaders pass to loopsimplify  
							
							 
							
							... 
							
							
							
							llvm-svn: 9058 
							
						 
						
							2003-10-12 21:43:28 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9703c02ce4 
								
							 
						 
						
							
							
								
								The preheader insertion pass only depends on the CFG.  Mark it as such, which  
							
							 
							
							... 
							
							
							
							allows GCCAS to only run it once.
llvm-svn: 9056 
							
						 
						
							2003-10-12 19:33:10 +00:00  
						
					 
				
					
						
							
							
								 
								Misha Brukman
							
						 
						
							 
							
							
							
							
								
							
							
								8b2bd4ed47 
								
							 
						 
						
							
							
								
								Fix spelling.  
							
							 
							
							... 
							
							
							
							llvm-svn: 9027 
							
						 
						
							2003-10-10 17:57:28 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								35e56e7372 
								
							 
						 
						
							
							
								
								Update comment  
							
							 
							
							... 
							
							
							
							llvm-svn: 8965 
							
						 
						
							2003-10-08 16:56:11 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								0bbbe5d4c8 
								
							 
						 
						
							
							
								
								Use a set to keep track of which edges have been noticed as executable already  
							
							 
							
							... 
							
							
							
							to avoid reprocessing PHI nodes needlessly.  This speeds up the big bad PHI
testcase 43%: from 104.9826 to 73.5157s
llvm-svn: 8964 
							
						 
						
							2003-10-08 16:55:34 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7324f7cd03 
								
							 
						 
						
							
							
								
								Minor fixes here and there  
							
							 
							
							... 
							
							
							
							llvm-svn: 8963 
							
						 
						
							2003-10-08 16:21:03 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								71ac22ffb5 
								
							 
						 
						
							
							
								
								Avoid building data structures we don't really need.  This improves the runtime  
							
							 
							
							... 
							
							
							
							of a test that Bill Wendling sent me from 228.5s to 105s.  Obviously there is
more improvement to be had, but this is a nice speedup which should be "felt"
by many programs.
llvm-svn: 8962 
							
						 
						
							2003-10-08 15:47:41 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								950fc785ae 
								
							 
						 
						
							
							
								
								whoops, don't accidentally lose variable names  
							
							 
							
							... 
							
							
							
							llvm-svn: 8955 
							
						 
						
							2003-10-07 22:58:41 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								75b4d1deec 
								
							 
						 
						
							
							
								
								Fix bug: InstCombine/cast.ll:test11 / PR#7  
							
							 
							
							... 
							
							
							
							llvm-svn: 8954 
							
						 
						
							2003-10-07 22:54:13 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								aec3d948cf 
								
							 
						 
						
							
							
								
								Refactor code a bit  
							
							 
							
							... 
							
							
							
							llvm-svn: 8952 
							
						 
						
							2003-10-07 22:32:43 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ed922162e1 
								
							 
						 
						
							
							
								
								Bill contributed this major rewrite of the -lowerswitch pass to make it generate  
							
							 
							
							... 
							
							
							
							logarithmic conditional branch sequences instead of linear sequences.  Thanks Bill!
llvm-svn: 8928 
							
						 
						
							2003-10-07 18:46:23 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								800aaaf207 
								
							 
						 
						
							
							
								
								Fix bug in previous checkin  
							
							 
							
							... 
							
							
							
							llvm-svn: 8922 
							
						 
						
							2003-10-07 15:17:02 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								e8ed4ef039 
								
							 
						 
						
							
							
								
								Minor speedups for the instcombine pass  
							
							 
							
							... 
							
							
							
							llvm-svn: 8894 
							
						 
						
							2003-10-06 17:11:01 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a906bacfdd 
								
							 
						 
						
							
							
								
								Change the interface to PromoteMemToReg to also take a DominatorTree  
							
							 
							
							... 
							
							
							
							llvm-svn: 8883 
							
						 
						
							2003-10-05 21:20:13 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a43b8f4b2f 
								
							 
						 
						
							
							
								
								Initial checkin of the LLVM->LLVM transform to support code generators which  
							
							 
							
							... 
							
							
							
							do not support stack unwinding yet
llvm-svn: 8869 
							
						 
						
							2003-10-05 19:14:42 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								5ed281d7d7 
								
							 
						 
						
							
							
								
								simplify-cfg is really a function pass  
							
							 
							
							... 
							
							
							
							llvm-svn: 8868 
							
						 
						
							2003-10-05 19:14:16 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b9cde76e60 
								
							 
						 
						
							
							
								
								Implement InstCombine/add.ll:test17 & 18  
							
							 
							
							... 
							
							
							
							llvm-svn: 8817 
							
						 
						
							2003-10-02 15:11:26 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								295b907cee 
								
							 
						 
						
							
							
								
								Fix bug: IndVarsSimplify/2003-09-23-NotAtTop.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 8689 
							
						 
						
							2003-09-23 20:26:48 +00:00  
						
					 
				
					
						
							
							
								 
								Misha Brukman
							
						 
						
							 
							
							
							
							
								
							
							
								e051f86a3d 
								
							 
						 
						
							
							
								
								Credits now go into the top-level CREDITS.TXT  
							
							 
							
							... 
							
							
							
							llvm-svn: 8662 
							
						 
						
							2003-09-22 21:57:56 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2caaaba3e9 
								
							 
						 
						
							
							
								
								Squelch warning  
							
							 
							
							... 
							
							
							
							llvm-svn: 8659 
							
						 
						
							2003-09-22 20:33:34 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								5dac64f629 
								
							 
						 
						
							
							
								
								Rename Function::getEntryNode -> getEntryBlock  
							
							 
							
							... 
							
							
							
							llvm-svn: 8625 
							
						 
						
							2003-09-20 14:39:18 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b6ac976247 
								
							 
						 
						
							
							
								
								Fix a really obvious huge gaping bug, add a comment  
							
							 
							
							... 
							
							
							
							llvm-svn: 8620 
							
						 
						
							2003-09-20 05:24:00 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								0016085602 
								
							 
						 
						
							
							
								
								Expose the TCE pass  
							
							 
							
							... 
							
							
							
							llvm-svn: 8619 
							
						 
						
							2003-09-20 05:14:13 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2e9014cb1b 
								
							 
						 
						
							
							
								
								New transformation: tail recursion elimination  
							
							 
							
							... 
							
							
							
							llvm-svn: 8618 
							
						 
						
							2003-09-20 05:03:31 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2da29177ba 
								
							 
						 
						
							
							
								
								Implement InstCombine/and.ll:test(15|16)  
							
							 
							
							... 
							
							
							
							llvm-svn: 8607 
							
						 
						
							2003-09-19 19:05:02 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ba1cb38c06 
								
							 
						 
						
							
							
								
								pull a large nested conditional out into its own function  
							
							 
							
							... 
							
							
							
							llvm-svn: 8605 
							
						 
						
							2003-09-19 17:17:26 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								dbba189f15 
								
							 
						 
						
							
							
								
								Implement InstCombine/add.ll:test(15|16)  
							
							 
							
							... 
							
							
							
							llvm-svn: 8604 
							
						 
						
							2003-09-19 15:35:42 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								099ec07a95 
								
							 
						 
						
							
							
								
								Make sure to cannonicalize loops before running indvar simplify  
							
							 
							
							... 
							
							
							
							llvm-svn: 8502 
							
						 
						
							2003-09-12 16:45:01 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7fdde92b1f 
								
							 
						 
						
							
							
								
								Do not return success after checking only the FIRST USE of a gep instruction.  
							
							 
							
							... 
							
							
							
							Instead, check all uses.
This fixes bug: ScalarRepl/2003-09-12-IncorrectPromote.ll
This also fixes the miscompilation of Ptrdist/bc
llvm-svn: 8493 
							
						 
						
							2003-09-12 16:02:12 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9a95f2a944 
								
							 
						 
						
							
							
								
								Minor optimization efficiency improvement:  
							
							 
							
							... 
							
							
							
							- Run mem2reg promotion first
  - Only rerun passes if the previous thing changed something
llvm-svn: 8490 
							
						 
						
							2003-09-12 15:36:03 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								cce81be1e1 
								
							 
						 
						
							
							
								
								Simplify code  
							
							 
							
							... 
							
							
							
							Implement InstCombine/mul.ll:test9
llvm-svn: 8488 
							
						 
						
							2003-09-11 22:24:54 +00:00  
						
					 
				
					
						
							
							
								 
								Misha Brukman
							
						 
						
							 
							
							
							
							
								
							
							
								217ca0bcb9 
								
							 
						 
						
							
							
								
								Apostrophes are only used for possession and quoting.  
							
							 
							
							... 
							
							
							
							llvm-svn: 8473 
							
						 
						
							2003-09-11 16:58:31 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								5d8a12e094 
								
							 
						 
						
							
							
								
								Integrate functionality of the mem2reg pass directly into this pass to make  
							
							 
							
							... 
							
							
							
							the combination more effective
llvm-svn: 8471 
							
						 
						
							2003-09-11 16:45:55 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								bb9d03b9c0 
								
							 
						 
						
							
							
								
								Renamed DominatorTree::Node::getNode() -> getBlock()  
							
							 
							
							... 
							
							
							
							llvm-svn: 8469 
							
						 
						
							2003-09-11 16:26:13 +00:00  
						
					 
				
					
						
							
							
								 
								Misha Brukman
							
						 
						
							 
							
							
							
							
								
							
							
								9b8d339f6e 
								
							 
						 
						
							
							
								
								Spell `definite' correctly.  
							
							 
							
							... 
							
							
							
							llvm-svn: 8467 
							
						 
						
							2003-09-11 15:32:37 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2158052ac4 
								
							 
						 
						
							
							
								
								Unwind instructions are intrinsically alive, just like returns  
							
							 
							
							... 
							
							
							
							llvm-svn: 8462 
							
						 
						
							2003-09-10 20:38:14 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								216c7b8aed 
								
							 
						 
						
							
							
								
								Fix spell-o's  
							
							 
							
							... 
							
							
							
							llvm-svn: 8431 
							
						 
						
							2003-09-10 05:29:43 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4e621cd861 
								
							 
						 
						
							
							
								
								Spelling fixes.  I think that "cannonical" is ok, but "canonical" appears to  
							
							 
							
							... 
							
							
							
							be the canonical form for the word
llvm-svn: 8430 
							
						 
						
							2003-09-10 05:24:46 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								36257f049e 
								
							 
						 
						
							
							
								
								Fix up file header  
							
							 
							
							... 
							
							
							
							llvm-svn: 8428 
							
						 
						
							2003-09-10 05:10:34 +00:00  
						
					 
				
					
						
							
							
								 
								Misha Brukman
							
						 
						
							 
							
							
							
							
								
							
							
								4ace48e0ca 
								
							 
						 
						
							
							
								
								Spell `occurrence' correctly.  
							
							 
							
							... 
							
							
							
							llvm-svn: 8425 
							
						 
						
							2003-09-09 21:54:45 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9c58cf6d03 
								
							 
						 
						
							
							
								
								Add support for the unwind instruction  
							
							 
							
							... 
							
							
							
							llvm-svn: 8408 
							
						 
						
							2003-09-08 18:54:55 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								01a8391236 
								
							 
						 
						
							
							
								
								Do not hoist volatile loads  
							
							 
							
							... 
							
							
							
							llvm-svn: 8399 
							
						 
						
							2003-09-08 18:17:14 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1c884e18e1 
								
							 
						 
						
							
							
								
								Fix bug: TailDuplicate/2003-08-31-UnreachableBlocks.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 8276 
							
						 
						
							2003-08-31 21:17:44 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c817458b66 
								
							 
						 
						
							
							
								
								ScalarRepl does not modify the CFG.  Say so!  
							
							 
							
							... 
							
							
							
							llvm-svn: 8243 
							
						 
						
							2003-08-31 00:45:13 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2887328770 
								
							 
						 
						
							
							
								
								Use new interface, simplifies code  
							
							 
							
							... 
							
							
							
							llvm-svn: 8242 
							
						 
						
							2003-08-31 00:22:27 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								df741d62de 
								
							 
						 
						
							
							
								
								Fix bug: SCCP/2003-08-26-InvokeHandling.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 8152 
							
						 
						
							2003-08-27 01:08:35 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f1b1c5ec2f 
								
							 
						 
						
							
							
								
								Fix bug: LowerSwitch/2003-08-23-EmptySwitch.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 8087 
							
						 
						
							2003-08-23 22:54:34 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								bb4dd7ed34 
								
							 
						 
						
							
							
								
								Fix bug: TailDup/2003-08-23-InvalidatedPointers.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 8078 
							
						 
						
							2003-08-23 20:08:30 +00:00  
						
					 
				
					
						
							
							
								 
								Misha Brukman
							
						 
						
							 
							
							
							
							
								
							
							
								be372b91e1 
								
							 
						 
						
							
							
								
								The word `dependent' has no `a'.  
							
							 
							
							... 
							
							
							
							llvm-svn: 8030 
							
						 
						
							2003-08-21 22:14:26 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a34c477b05 
								
							 
						 
						
							
							
								
								Fix grammar, add comment  
							
							 
							
							... 
							
							
							
							llvm-svn: 7967 
							
						 
						
							2003-08-18 22:54:06 +00:00  
						
					 
				
					
						
							
							
								 
								Misha Brukman
							
						 
						
							 
							
							
							
							
								
							
							
								7eb05a170a 
								
							 
						 
						
							
							
								
								Spell `necessary' correctly.  
							
							 
							
							... 
							
							
							
							llvm-svn: 7944 
							
						 
						
							2003-08-18 14:43:39 +00:00  
						
					 
				
					
						
							
							
								 
								Brian Gaeke
							
						 
						
							 
							
							
							
							
								
							
							
								8c14ba96ca 
								
							 
						 
						
							
							
								
								Factory methods for function passes now return type FunctionPass *.  
							
							 
							
							... 
							
							
							
							llvm-svn: 7839 
							
						 
						
							2003-08-14 06:09:32 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3ac7c26a1c 
								
							 
						 
						
							
							
								
								Implement instcombine optimizations:  
							
							 
							
							... 
							
							
							
							(A <setcc1> B) logicalop (A <setcc2> B)  -> (A <setcc3> B) or true or false
Where setcc[123] is one of the 6 setcc instructions, and logicalop is one of: And, Or, Xor
llvm-svn: 7828 
							
						 
						
							2003-08-13 20:16:26 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b8b97505ba 
								
							 
						 
						
							
							
								
								Generalize some of the add tests to allow for reassociation to take place  
							
							 
							
							... 
							
							
							
							llvm-svn: 7825 
							
						 
						
							2003-08-13 19:01:45 +00:00  
						
					 
				
					
						
							
							
								 
								Brian Gaeke
							
						 
						
							 
							
							
							
							
								
							
							
								89207943a1 
								
							 
						 
						
							
							
								
								Factory methods for FunctionPasses now return type FunctionPass *.  
							
							 
							
							... 
							
							
							
							llvm-svn: 7823 
							
						 
						
							2003-08-13 18:18:15 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8ac196dd3b 
								
							 
						 
						
							
							
								
								Assign arguments different ranks so they get grouped together  
							
							 
							
							... 
							
							
							
							llvm-svn: 7813 
							
						 
						
							2003-08-13 16:16:26 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d07283a2ad 
								
							 
						 
						
							
							
								
								Implement InstCombine/2003-08-12-AllocaNonNull.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 7807 
							
						 
						
							2003-08-13 05:38:46 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c992add9fe 
								
							 
						 
						
							
							
								
								Do not cannonicalize (X != 0) into (cast X to bool)  
							
							 
							
							... 
							
							
							
							llvm-svn: 7806 
							
						 
						
							2003-08-13 05:33:12 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ede3fe05c5 
								
							 
						 
						
							
							
								
								Change cannonicalization rules: add X,X is represented as multiplies, multiplies  
							
							 
							
							... 
							
							
							
							of a power of two are represented as a shift.
llvm-svn: 7803 
							
						 
						
							2003-08-13 04:18:28 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								deaa0dd71a 
								
							 
						 
						
							
							
								
								Allow pulling logical operations through shifts.  
							
							 
							
							... 
							
							
							
							This implements InstCombine/shift.ll:test14*
llvm-svn: 7793 
							
						 
						
							2003-08-12 21:53:41 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								98b3ecddec 
								
							 
						 
						
							
							
								
								Fix bug: Reassociate/2003-08-12-InfiniteLoop.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 7792 
							
						 
						
							2003-08-12 21:45:24 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								58c7eb60ec 
								
							 
						 
						
							
							
								
								Assign finer grained ranks, make sure to reassociate top-level after reassociating bottom level  
							
							 
							
							... 
							
							
							
							llvm-svn: 7787 
							
						 
						
							2003-08-12 20:14:27 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								01d5639515 
								
							 
						 
						
							
							
								
								Simplify code  
							
							 
							
							... 
							
							
							
							llvm-svn: 7783 
							
						 
						
							2003-08-12 19:17:27 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								812aab7727 
								
							 
						 
						
							
							
								
								Implement testcases InstCombine/or.ll:test16/test17  
							
							 
							
							... 
							
							
							
							llvm-svn: 7782 
							
						 
						
							2003-08-12 19:11:07 +00:00  
						
					 
				
					
						
							
							
								 
								Tanya Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								dc3c9a8545 
								
							 
						 
						
							
							
								
								Fixed minor bug in SafeToHoist and made some changes suggested by Chris.  
							
							 
							
							... 
							
							
							
							llvm-svn: 7614 
							
						 
						
							2003-08-05 20:39:02 +00:00  
						
					 
				
					
						
							
							
								 
								Tanya Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								57c03df032 
								
							 
						 
						
							
							
								
								Fixed LICM bug that hoists trapping instructions that are not guaranteed to execute.  
							
							 
							
							... 
							
							
							
							llvm-svn: 7612 
							
						 
						
							2003-08-05 18:45:46 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8abcd56c74 
								
							 
						 
						
							
							
								
								DEBUG got moved to Support/Debug.h  
							
							 
							
							... 
							
							
							
							llvm-svn: 7492 
							
						 
						
							2003-08-01 22:15:03 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ab780dfab5 
								
							 
						 
						
							
							
								
								Instcombine: (A >> c1) << c2 for signed integers  
							
							 
							
							... 
							
							
							
							llvm-svn: 7295 
							
						 
						
							2003-07-24 18:38:56 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3204d4ed4e 
								
							 
						 
						
							
							
								
								Reorganization of code, no functional changes.  
							
							 
							
							... 
							
							
							
							Now it shoudl be a bit more efficient
llvm-svn: 7292 
							
						 
						
							2003-07-24 17:52:58 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								dfae8be3c9 
								
							 
						 
						
							
							
								
								Allow folding several instructions into casts, which can simplify a lot  
							
							 
							
							... 
							
							
							
							of codes.  For example,
short kernel (short t1) {
  t1 >>= 8; t1 <<= 8;
  return t1;
}
became:
short %kernel(short %t1.1) {
        %tmp.3 = shr short %t1.1, ubyte 8               ; <short> [#uses=1]
        %tmp.5 = cast short %tmp.3 to int               ; <int> [#uses=1]
        %tmp.7 = shl int %tmp.5, ubyte 8                ; <int> [#uses=1]
        %tmp.8 = cast int %tmp.7 to short               ; <short> [#uses=1]
        ret short %tmp.8
}
before, now it becomes:
short %kernel(short %t1.1) {
        %tmp.3 = shr short %t1.1, ubyte 8               ; <short> [#uses=1]
        %tmp.8 = shl short %tmp.3, ubyte 8              ; <short> [#uses=1]
        ret short %tmp.8
}
which will become:
short %kernel(short %t1.1) {
        %tmp.3 = and short %t1.1, 0xFF00
        ret short %tmp.3
}
This implements cast-set.ll:test4 and test5
llvm-svn: 7290 
							
						 
						
							2003-07-24 17:35:25 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								bfb1d03159 
								
							 
						 
						
							
							
								
								Add comments  
							
							 
							
							... 
							
							
							
							llvm-svn: 7283 
							
						 
						
							2003-07-23 21:41:57 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9763859e8d 
								
							 
						 
						
							
							
								
								Remove explicit check for: not (not X) = X, it is already handled because xor is commutative  
							
							 
							
							... 
							
							
							
							- InstCombine: (X & C1) ^ C2 --> (X & C1) | C2 iff (C1&C2) == 0
  - InstCombine: (X | C1) ^ C2 --> (X | C1) & ~C2 iff (C1&C2) == C2
llvm-svn: 7282 
							
						 
						
							2003-07-23 21:37:07 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								33217db4d9 
								
							 
						 
						
							
							
								
								InstCombine: (X ^ C1) & C2 --> (X & C2) iff (C1&C2) == 0  
							
							 
							
							... 
							
							
							
							llvm-svn: 7272 
							
						 
						
							2003-07-23 19:36:21 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								16464b36ff 
								
							 
						 
						
							
							
								
								- InstCombine: (X | C1) & C2 --> X & C2 iff C1 & C1 == 0  
							
							 
							
							... 
							
							
							
							- InstCombine: (X | C) & C --> C
  - InstCombine: (X | C1) & C2 --> (X | (C1&C2)) & C2
llvm-svn: 7269 
							
						 
						
							2003-07-23 19:25:52 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8f0d15601a 
								
							 
						 
						
							
							
								
								IC: (X & C1) | C2 --> (X | C2) & (C1|C2)  
							
							 
							
							... 
							
							
							
							IC: (X ^ C1) | C2 --> (X | C2) ^ (C1&~C2)
We are now guaranteed that all 'or's will be inside of 'and's, and all 'and's
will be inside of 'xor's, if the second operands are constants.
llvm-svn: 7264 
							
						 
						
							2003-07-23 18:29:44 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								49b47ae565 
								
							 
						 
						
							
							
								
								IC: (X ^ C1) & C2 --> (X & C2) ^ (C1&C2)  
							
							 
							
							... 
							
							
							
							Minor code cleanup
llvm-svn: 7262 
							
						 
						
							2003-07-23 17:57:01 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								cfbce7c880 
								
							 
						 
						
							
							
								
								InstCombine: (X ^ 4) == 8  --> X == 12  
							
							 
							
							... 
							
							
							
							llvm-svn: 7260 
							
						 
						
							2003-07-23 17:26:36 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d492a0b7b4 
								
							 
						 
						
							
							
								
								IC: (X & 5) == 13 --> false  
							
							 
							
							... 
							
							
							
							IC: (X | 8) == 4  --> false
llvm-svn: 7257 
							
						 
						
							2003-07-23 17:02:11 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6077c3195f 
								
							 
						 
						
							
							
								
								Simplify code by using ConstantInt::getRawValue instead of checking to see  
							
							 
							
							... 
							
							
							
							whether the constant is signed or unsigned, then casting
llvm-svn: 7252 
							
						 
						
							2003-07-23 15:22:26 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d78ebd0c6b 
								
							 
						 
						
							
							
								
								Fix bug: TailDup/2003-07-22-InfiniteLoop.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 7243 
							
						 
						
							2003-07-23 03:32:41 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								bdb0ce0605 
								
							 
						 
						
							
							
								
								- InstCombine (cast (xor A, B) to bool) ==> (setne A, B)  
							
							 
							
							... 
							
							
							
							- InstCombine (cast (and X, (1 << size(X)-1)) to bool) ==> x < 0
llvm-svn: 7241 
							
						 
						
							2003-07-22 21:46:59 +00:00  
						
					 
				
					
						
							
							
								 
								John Criswell
							
						 
						
							 
							
							
							
							
								
							
							
								d6dcbc6ce8 
								
							 
						 
						
							
							
								
								Added code that checks to see if a global variable is external before replacing  
							
							 
							
							... 
							
							
							
							a load of the global variable with the variable's constant value.
llvm-svn: 7216 
							
						 
						
							2003-07-21 19:42:57 +00:00  
						
					 
				
					
						
							
							
								 
								John Criswell
							
						 
						
							 
							
							
							
							
								
							
							
								0643ceafcf 
								
							 
						 
						
							
							
								
								Dinakar and I fixed a bug where we were trying to get the initializer of  
							
							 
							
							... 
							
							
							
							an external constant.  Since external constants don't have initializers, we
were failing on an assert() call in llvm/GlobalVariable.h.
llvm-svn: 7193 
							
						 
						
							2003-07-17 19:06:55 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								0f1d8a3947 
								
							 
						 
						
							
							
								
								Add support for elimination of load instruction from global constants  
							
							 
							
							... 
							
							
							
							llvm-svn: 6912 
							
						 
						
							2003-06-26 05:06:25 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								35236d8477 
								
							 
						 
						
							
							
								
								Instcombine:  X * -1 -> -X  
							
							 
							
							... 
							
							
							
							llvm-svn: 6904 
							
						 
						
							2003-06-25 17:09:20 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b396afde26 
								
							 
						 
						
							
							
								
								Fix bug: Mem2Reg/2003-06-26-IterativePromote.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 6901 
							
						 
						
							2003-06-25 14:58:56 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ee967711e9 
								
							 
						 
						
							
							
								
								Fix bug: ADCE/2003-06-24-BadSuccessor.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 6891 
							
						 
						
							2003-06-24 23:02:45 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								834105502d 
								
							 
						 
						
							
							
								
								Do not mark ALL terminators live if any instruciton in the block is live.  We only  
							
							 
							
							... 
							
							
							
							want to mark it live if it is an unconditional branch.  This fixes bug:
ADCE/2002-05-28-Crash.ll and makes this pass _much_ more useful.
llvm-svn: 6887 
							
						 
						
							2003-06-24 21:49:45 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7e270580c8 
								
							 
						 
						
							
							
								
								Fix bug: SCCP/2003-06-24-OverdefinedPHIValue.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 6883 
							
						 
						
							2003-06-24 20:29:52 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f7544873de 
								
							 
						 
						
							
							
								
								Fix bug: TailDup/2003-06-24-Simpleloop.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 6881 
							
						 
						
							2003-06-24 19:48:06 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								55d4bda861 
								
							 
						 
						
							
							
								
								Implement new transforms:  
							
							 
							
							... 
							
							
							
							Replace (cast (sub A, B) to bool) -> (setne A, B)
  Replace (cast (add A, B) to bool) -> (setne A, -B)
llvm-svn: 6873 
							
						 
						
							2003-06-23 21:59:52 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								92963de6fa 
								
							 
						 
						
							
							
								
								Add paranoia checking  
							
							 
							
							... 
							
							
							
							llvm-svn: 6856 
							
						 
						
							2003-06-22 20:46:00 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								268c1392da 
								
							 
						 
						
							
							
								
								Test change  
							
							 
							
							... 
							
							
							
							llvm-svn: 6852 
							
						 
						
							2003-06-22 20:25:27 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a5434caa5c 
								
							 
						 
						
							
							
								
								Initial checkin of Tail duplication pass.  
							
							 
							
							... 
							
							
							
							llvm-svn: 6846 
							
						 
						
							2003-06-22 20:10:28 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d0d51605b2 
								
							 
						 
						
							
							
								
								Instcombine cast (getelementptr Ptr, 0, 0, 0) to ... into: cast Ptr to ...  
							
							 
							
							... 
							
							
							
							This fixes type safety problems in a variety of benchmarks that were confusing
DSA.
llvm-svn: 6837 
							
						 
						
							2003-06-21 23:12:02 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								970c33abb1 
								
							 
						 
						
							
							
								
								Implement the functionality of InstCombine/call.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 6783 
							
						 
						
							2003-06-19 17:00:31 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2a8c301c9f 
								
							 
						 
						
							
							
								
								Don't corrupt memory when removing an instruction from the program, but  
							
							 
							
							... 
							
							
							
							not the worklist
llvm-svn: 6733 
							
						 
						
							2003-06-17 03:57:18 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								dc62f1e021 
								
							 
						 
						
							
							
								
								Fix bug: ADCE/2003-06-11-InvalidCFG.ll  
							
							 
							
							... 
							
							
							
							This was because we were deleting large chunks of functions without an exit block, because the post-dominance
information was not useful.  This broke crafty and twolf.
llvm-svn: 6698 
							
						 
						
							2003-06-16 12:10:45 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								45789aca97 
								
							 
						 
						
							
							
								
								Fix bug: InstCombine/2003-06-05-BranchInvertInfLoop.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 6630 
							
						 
						
							2003-06-05 20:12:51 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								e967b348bf 
								
							 
						 
						
							
							
								
								Clean up previous code.  
							
							 
							
							... 
							
							
							
							Add new combination to turn seteq X, 0 -> not(cast X to bool)
llvm-svn: 6604 
							
						 
						
							2003-06-04 05:10:11 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9eef8a78b4 
								
							 
						 
						
							
							
								
								Implement combination of boolean not with branch  
							
							 
							
							... 
							
							
							
							llvm-svn: 6599 
							
						 
						
							2003-06-04 04:46:00 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								791ac1a4c8 
								
							 
						 
						
							
							
								
								Implement xform: (X != 0) -> (bool)X  
							
							 
							
							... 
							
							
							
							llvm-svn: 6506 
							
						 
						
							2003-06-01 03:35:25 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								0078d9c5bb 
								
							 
						 
						
							
							
								
								Okay totally give up on trying to optimize aggregates that cannot be completely  
							
							 
							
							... 
							
							
							
							broken up into their elements.  Too many programs break because of this.
llvm-svn: 6440 
							
						 
						
							2003-05-30 19:22:14 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d847be0539 
								
							 
						 
						
							
							
								
								add a check that allows the SRoA pass to avoid breaking programs, even if their  
							
							 
							
							... 
							
							
							
							behavior is technically undefined
llvm-svn: 6438 
							
						 
						
							2003-05-30 18:09:57 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								38d88c07f4 
								
							 
						 
						
							
							
								
								Fix bug: ScalarRepl/2003-05-30-MultiLevel.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 6428 
							
						 
						
							2003-05-30 05:26:30 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6e5398d69d 
								
							 
						 
						
							
							
								
								Fix bug: ScalarRepl/2003-05-29-ArrayFail.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 6425 
							
						 
						
							2003-05-30 04:15:41 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6c81ebc97d 
								
							 
						 
						
							
							
								
								Add comment  
							
							 
							
							... 
							
							
							
							llvm-svn: 6415 
							
						 
						
							2003-05-29 20:26:30 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3442844742 
								
							 
						 
						
							
							
								
								Fix bug: Instcombine/2003-05-27-ConstExprCrash.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 6352 
							
						 
						
							2003-05-27 16:40:51 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c16b210349 
								
							 
						 
						
							
							
								
								* Actually USE the statistic that we made  
							
							 
							
							... 
							
							
							
							* Implement SRoA for arrays
llvm-svn: 6349 
							
						 
						
							2003-05-27 16:09:27 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								fb41a50d15 
								
							 
						 
						
							
							
								
								Implementation of the simple "scalar replacement of aggregates" transformation  
							
							 
							
							... 
							
							
							
							llvm-svn: 6346 
							
						 
						
							2003-05-27 15:45:27 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								196897c424 
								
							 
						 
						
							
							
								
								Fix bug: InstCombine/2003-05-26-CastMiscompile.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 6338 
							
						 
						
							2003-05-26 23:41:32 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8d0a71aff8 
								
							 
						 
						
							
							
								
								Remove using declarations  
							
							 
							
							... 
							
							
							
							llvm-svn: 6306 
							
						 
						
							2003-05-22 22:00:07 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								471bd76281 
								
							 
						 
						
							
							
								
								Minor cleanups.  
							
							 
							
							... 
							
							
							
							This hunk:
-    } else if (Src->getNumOperands() == 2 && Src->use_size() == 1) {
+    } else if (Src->getNumOperands() == 2) {
Allows GEP folding to be more aggressive, which reduces the number of instructions
and can dramatically speed up BasicAA in some cases.
llvm-svn: 6286 
							
						 
						
							2003-05-22 19:07:21 +00:00  
						
					 
				
					
						
							
							
								 
								Misha Brukman
							
						 
						
							 
							
							
							
							
								
							
							
								373086db75 
								
							 
						 
						
							
							
								
								Hopefully, the final fix for `[Pp]ropogate'.  
							
							 
							
							... 
							
							
							
							llvm-svn: 6251 
							
						 
						
							2003-05-20 21:01:22 +00:00  
						
					 
				
					
						
							
							
								 
								Misha Brukman
							
						 
						
							 
							
							
							
							
								
							
							
								e5838c4d72 
								
							 
						 
						
							
							
								
								s/convertable/convertible/g  
							
							 
							
							... 
							
							
							
							llvm-svn: 6248 
							
						 
						
							2003-05-20 18:45:36 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								652e7bf8a8 
								
							 
						 
						
							
							
								
								Fix long standing bug  
							
							 
							
							... 
							
							
							
							llvm-svn: 6232 
							
						 
						
							2003-05-15 18:25:13 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								0895025b30 
								
							 
						 
						
							
							
								
								Fix bug: LoopPreheaders/2003-05-12-PreheaderExitOfChild.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 6153 
							
						 
						
							2003-05-12 22:04:34 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b02697210e 
								
							 
						 
						
							
							
								
								Handle va_arg instruction correctly  
							
							 
							
							... 
							
							
							
							llvm-svn: 6030 
							
						 
						
							2003-05-08 02:50:13 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3666378690 
								
							 
						 
						
							
							
								
								Fix spelling  
							
							 
							
							... 
							
							
							
							llvm-svn: 5983 
							
						 
						
							2003-05-02 19:26:34 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								df7cc91159 
								
							 
						 
						
							
							
								
								Fix Bug: LowerSwitch/2003-05-01-PHIProblem.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 5979 
							
						 
						
							2003-05-01 22:21:21 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								dd65d863a9 
								
							 
						 
						
							
							
								
								Fix another case where constexprs could cause a crash  
							
							 
							
							... 
							
							
							
							llvm-svn: 5972 
							
						 
						
							2003-04-30 22:34:06 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9244df60d3 
								
							 
						 
						
							
							
								
								Fix constant folding of constexprs  
							
							 
							
							... 
							
							
							
							llvm-svn: 5971 
							
						 
						
							2003-04-30 22:19:10 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b68a34eb3f 
								
							 
						 
						
							
							
								
								Fix bug: ADCE/2003-04-25-PHIPostDominateProblem.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 5952 
							
						 
						
							2003-04-25 22:53:27 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3c98276168 
								
							 
						 
						
							
							
								
								Fix major problem with PHI node traversal: rechecking PHIs should go into  
							
							 
							
							... 
							
							
							
							the visit function.  The worklist is for when their lattice value changes.
llvm-svn: 5927 
							
						 
						
							2003-04-25 03:35:10 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								cccc5c76c8 
								
							 
						 
						
							
							
								
								Minor non-functional changes:  
							
							 
							
							... 
							
							
							
							* Spell propagate right
  * Improve performance of phi node handling
  * Delete using directive
  * Other minor changes
llvm-svn: 5920 
							
						 
						
							2003-04-25 02:50:03 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								889f620841 
								
							 
						 
						
							
							
								
								Remove unnecesary &*'s  
							
							 
							
							... 
							
							
							
							llvm-svn: 5872 
							
						 
						
							2003-04-23 16:37:45 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1b094a0f2e 
								
							 
						 
						
							
							
								
								New pass to lower switch instructions to branch instructions  
							
							 
							
							... 
							
							
							
							llvm-svn: 5865 
							
						 
						
							2003-04-23 16:23:59 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1f45f4e4d8 
								
							 
						 
						
							
							
								
								Minor cleanups  
							
							 
							
							... 
							
							
							
							llvm-svn: 5863 
							
						 
						
							2003-04-23 16:18:14 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								46b3d30bf6 
								
							 
						 
						
							
							
								
								Change the interface to constant expressions to allow automatic folding  
							
							 
							
							... 
							
							
							
							llvm-svn: 5793 
							
						 
						
							2003-04-16 22:40:51 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9023155621 
								
							 
						 
						
							
							
								
								Initial checkin of PRE on LLVM.  This implementation is still lacking in  
							
							 
							
							... 
							
							
							
							several ways:
 * Load expressions are not PRE'd well.  Alias Analysis should be used to
   get accurate information when computing anticipatibility.
 * The expression collection implementation does not handle PHI nodes properly,
   thus the implementation misses many opportunities to PRE.
 * This code could be sped up quite a bit
Despite these flaws, the code seems to work well, and handles PR's as one
would expect.
llvm-svn: 5759 
							
						 
						
							2003-03-31 19:55:43 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c42046f9f1 
								
							 
						 
						
							
							
								
								Move BreakCriticalEdges pass to lib/Transforms/Utils  
							
							 
							
							... 
							
							
							
							llvm-svn: 5754 
							
						 
						
							2003-03-21 21:43:19 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7fb29e19f0 
								
							 
						 
						
							
							
								
								Add the following instcombine xforms:  
							
							 
							
							... 
							
							
							
							- Implement simple reassociation: (A|c1)|(B|c2) == (A|B)|(c1|c2)
  - (A & C1)+(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0
  - (A & C1)^(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0
llvm-svn: 5743 
							
						 
						
							2003-03-11 00:12:48 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								934a64cfa4 
								
							 
						 
						
							
							
								
								Implement: -A*-B == A*B  
							
							 
							
							... 
							
							
							
							llvm-svn: 5740 
							
						 
						
							2003-03-10 23:23:04 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3e327a4334 
								
							 
						 
						
							
							
								
								Add new transformation: // (~A | ~B) == (~(A & B))  
							
							 
							
							... 
							
							
							
							llvm-svn: 5738 
							
						 
						
							2003-03-10 23:13:59 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								bb74e2284a 
								
							 
						 
						
							
							
								
								Generalize not and neg comparison testers to allow constant to be considered not'able and neg'able.  This  
							
							 
							
							... 
							
							
							
							allows optimization of this:
int %test4(int %A, int %B) {
        %a = xor int %A, -1
        %c = and int %a, 5    ; 5 = ~c2
        %d = xor int %c, -1
        ret int %d
}
into this:
int %test4(int %A, int %B) {            ; No predecessors!
        %c.demorgan = or int %A, -6             ; <int> [#uses=1]
        ret int %c.demorgan
}
llvm-svn: 5736 
							
						 
						
							2003-03-10 23:06:50 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								dcf240a649 
								
							 
						 
						
							
							
								
								Generalize (A+c1)+c2 optimization to work with all associative operators  
							
							 
							
							... 
							
							
							
							llvm-svn: 5733 
							
						 
						
							2003-03-10 21:43:22 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3695257724 
								
							 
						 
						
							
							
								
								Minor change, no functionality diff  
							
							 
							
							... 
							
							
							
							llvm-svn: 5731 
							
						 
						
							2003-03-10 19:20:30 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								e8d6c604bb 
								
							 
						 
						
							
							
								
								Fix bug: (x << 100) wasn't folded to 0, but (x >> 100) was (when x is unsigned)  
							
							 
							
							... 
							
							
							
							Implement new shift optimizations for shifting the result of a shift.
llvm-svn: 5729 
							
						 
						
							2003-03-10 19:16:08 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1bbb7b6f19 
								
							 
						 
						
							
							
								
								Implement:  (A|B)^B == A & (~B)  
							
							 
							
							... 
							
							
							
							llvm-svn: 5728 
							
						 
						
							2003-03-10 18:24:17 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								235af5673b 
								
							 
						 
						
							
							
								
								Implement %test7 in InstCombine/getelementptr.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 5704 
							
						 
						
							2003-03-05 22:33:14 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								0592bb7654 
								
							 
						 
						
							
							
								
								Convert LICM over to use AliasSetTracker.  Besides being nicer, this automatically  
							
							 
							
							... 
							
							
							
							allows LICM to use access sizes to help alias analysis be more precise.
llvm-svn: 5693 
							
						 
						
							2003-03-03 23:32:45 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								e27406eb59 
								
							 
						 
						
							
							
								
								Change the mem2reg interface to accept a TargetData argument  
							
							 
							
							... 
							
							
							
							llvm-svn: 5685 
							
						 
						
							2003-03-03 17:25:18 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								e19a9f8ef7 
								
							 
						 
						
							
							
								
								Fix bug: LICM/2003-02-28-PromoteDifferentType.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 5675 
							
						 
						
							2003-02-28 19:21:40 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								49eb0e3026 
								
							 
						 
						
							
							
								
								Fix bug I introduced yesterday :(  
							
							 
							
							... 
							
							
							
							llvm-svn: 5669 
							
						 
						
							2003-02-28 16:54:17 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								32a39c26e0 
								
							 
						 
						
							
							
								
								Fix bug: LICM/2003-02-27-PreheaderExitNodeUpdate.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 5667 
							
						 
						
							2003-02-28 03:07:54 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f2d9f94a33 
								
							 
						 
						
							
							
								
								Fix bug: 2003-02-27-PreheaderExitNodeUpdate.ll by updating exit node info  
							
							 
							
							... 
							
							
							
							llvm-svn: 5664 
							
						 
						
							2003-02-27 22:48:57 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								10b2b055e8 
								
							 
						 
						
							
							
								
								Add a new assertion to check that stuff is happening right  
							
							 
							
							... 
							
							
							
							Ironically the exit block modification code wasn't updating the exit block
information itself.  Fix this.
llvm-svn: 5659 
							
						 
						
							2003-02-27 22:31:07 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1ad80e2511 
								
							 
						 
						
							
							
								
								Fix bug: 2003-02-27-StoreSinkPHIs.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 5658 
							
						 
						
							2003-02-27 21:59:36 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4e2fbfb4c3 
								
							 
						 
						
							
							
								
								* Don't forget to update Loop information!  
							
							 
							
							... 
							
							
							
							* Remove bogus assertion: there may be a single outside predecessor and
    still need a new loop-preheader if the predecessor has multiple
    successors.  See bug: LICM/2003-02-27-PreheaderProblem.ll
llvm-svn: 5655 
							
						 
						
							2003-02-27 21:50:19 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								650096a061 
								
							 
						 
						
							
							
								
								* Significant changes to the preheader insertion pass:  
							
							 
							
							... 
							
							
							
							- Now we perform loop exit-block splitting to ensure exit blocks are
     always dominated by the loop header.
   - We now preserve dominance frontier information
   - This fixes bug: LICM/2003-02-26-LoopExitNotDominated.ll
llvm-svn: 5652 
							
						 
						
							2003-02-27 20:27:08 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								71b82bb494 
								
							 
						 
						
							
							
								
								Convert to work with new AliasAnalysis interface by conservatively assuming all pointers are arbitrarily large accesses  
							
							 
							
							... 
							
							
							
							llvm-svn: 5636 
							
						 
						
							2003-02-26 19:28:57 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4869f3700e 
								
							 
						 
						
							
							
								
								Rename Instruction::hasSideEffects() -> mayWriteToMemory()  
							
							 
							
							... 
							
							
							
							llvm-svn: 5620 
							
						 
						
							2003-02-24 20:48:32 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								45d67d6ea7 
								
							 
						 
						
							
							
								
								Initial implementation of Loop invariant memory->scalar promotion  
							
							 
							
							... 
							
							
							
							llvm-svn: 5613 
							
						 
						
							2003-02-24 03:52:32 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								26f159046c 
								
							 
						 
						
							
							
								
								Split mem2reg promotion into two parts: a function which does the work, and  
							
							 
							
							... 
							
							
							
							a pass which wraps the function.  This allows other passes to use the functionality
llvm-svn: 5610 
							
						 
						
							2003-02-22 23:57:48 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								57c8d99bbd 
								
							 
						 
						
							
							
								
								4 new transformations:  
							
							 
							
							... 
							
							
							
							* X*C + X --> X * (C+1)
  * X + X*C --> X * (C+1)
  * X - X*C --> X * (1-C)
  * X*C - X --> X * (C-1)
llvm-svn: 5592 
							
						 
						
							2003-02-18 19:57:07 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3082c5a070 
								
							 
						 
						
							
							
								
								Add a variety of new transformations:  
							
							 
							
							... 
							
							
							
							* A & ~A == 0
  * A / (2^c) == A >> c  if unsigned
  * 0 / A == 0
  * 1.0 * A == A
  * A * (2^c) == A << c
  * A ^ ~A == -1
  * A | ~A == -1
  * 0 % X = 0
  * A % (2^c) == A & (c-1) if unsigned
  * A - (A & B) == A & ~B
  * -1 - A == ~A
llvm-svn: 5587 
							
						 
						
							2003-02-18 19:28:33 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f683599915 
								
							 
						 
						
							
							
								
								Fix typo  
							
							 
							
							... 
							
							
							
							llvm-svn: 5458 
							
						 
						
							2003-02-01 04:50:59 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6fa1629c47 
								
							 
						 
						
							
							
								
								Fix bug: ADCE/2003-01-22-PredecessorProblem.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 5405 
							
						 
						
							2003-01-23 02:12:18 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3aa7767352 
								
							 
						 
						
							
							
								
								Fix a huge performance problem in reassociate by introducing a  
							
							 
							
							... 
							
							
							
							rank map cache for instruction ranks
llvm-svn: 5030 
							
						 
						
							2002-12-15 03:56:00 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f96c8befe0 
								
							 
						 
						
							
							
								
								Minor changes:  
							
							 
							
							... 
							
							
							
							* Reword comment to make more clear
  * Don't print out BB's after modification made
  * Don't delete and new an instruction when we need to move something, just move it.
llvm-svn: 5029 
							
						 
						
							2002-12-15 03:49:50 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								688ac5b723 
								
							 
						 
						
							
							
								
								Remove dead code  
							
							 
							
							... 
							
							
							
							llvm-svn: 4952 
							
						 
						
							2002-12-07 18:42:13 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c6509f487b 
								
							 
						 
						
							
							
								
								Fix bug: 2002-12-05-MissedConstProp.ll pointed out by Casey Carter  
							
							 
							
							... 
							
							
							
							llvm-svn: 4935 
							
						 
						
							2002-12-05 22:41:53 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								98cf1f5d64 
								
							 
						 
						
							
							
								
								- Eliminated the deferred symbol table stuff in Module & Function, it really  
							
							 
							
							... 
							
							
							
							wasn't an optimization and it was causing lots of bugs.
llvm-svn: 4779 
							
						 
						
							2002-11-20 18:36:02 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a2620ac156 
								
							 
						 
						
							
							
								
								Fix warning  
							
							 
							
							... 
							
							
							
							llvm-svn: 4649 
							
						 
						
							2002-11-09 00:49:43 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								0da31d6648 
								
							 
						 
						
							
							
								
								Fix spelling error  
							
							 
							
							... 
							
							
							
							llvm-svn: 4645 
							
						 
						
							2002-11-08 23:18:37 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								5d606a09ff 
								
							 
						 
						
							
							
								
								Instcombine this away:  
							
							 
							
							... 
							
							
							
							%A = getelementptr [4 x int]* %M, long 0, long 0
        %B = getelementptr int* %A, long 2
llvm-svn: 4536 
							
						 
						
							2002-11-04 16:43:32 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1085bdf49f 
								
							 
						 
						
							
							
								
								Add a transformation to turn:  
							
							 
							
							... 
							
							
							
							malloc Ty, C
int
  malloc [C x Ty], 1
llvm-svn: 4534 
							
						 
						
							2002-11-04 16:18:53 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								669c6cf459 
								
							 
						 
						
							
							
								
								Make sure to _delete_ memory allocated by worklists  
							
							 
							
							... 
							
							
							
							llvm-svn: 4523 
							
						 
						
							2002-11-04 02:54:22 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8fdf75cde5 
								
							 
						 
						
							
							
								
								Fixes to the reassociate pass to make it respect dominance properties  
							
							 
							
							... 
							
							
							
							Huge thanks go to Casey Carter for writing this fix, reassociate is now
reoperational!
llvm-svn: 4471 
							
						 
						
							2002-10-31 17:12:59 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								12764c85e8 
								
							 
						 
						
							
							
								
								BreakCriticalEdges should update dominance frontier information as well as  
							
							 
							
							... 
							
							
							
							other dominance stuff.  Patch contributed by Casey Carter
llvm-svn: 4457 
							
						 
						
							2002-10-31 02:44:36 +00:00  
						
					 
				
					
						
							
							
								 
								Misha Brukman
							
						 
						
							 
							
							
							
							
								
							
							
								632df28deb 
								
							 
						 
						
							
							
								
								Fix spelling of `propagate'.  
							
							 
							
							... 
							
							
							
							llvm-svn: 4423 
							
						 
						
							2002-10-29 23:06:16 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								820d971233 
								
							 
						 
						
							
							
								
								- Rename AnalysisUsage::preservesAll to getPreservesAll & preservesCFG to  
							
							 
							
							... 
							
							
							
							setPreservesCFG to be less confusing.
llvm-svn: 4255 
							
						 
						
							2002-10-21 20:00:28 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b7368500dc 
								
							 
						 
						
							
							
								
								- Fix bug: cee/2002-10-07-NoImmediateDominator.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 4081 
							
						 
						
							2002-10-08 21:53:51 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								736709feda 
								
							 
						 
						
							
							
								
								- Checkin LARGE number of Changes to CEE pass that will make it much more  
							
							 
							
							... 
							
							
							
							powerful, but that are largely disabled.  The basic idea here is that it
    is trying to forward branches across basic blocks that have PHI nodes in
    it, which are crucial to be able to handle cases like whet.ll.
    Unfortunately we are not updating SSA correctly, causing sim.c to die, and I
    don't have time to fix the regression now, so I must disable the
    functionality.
llvm-svn: 4077 
							
						 
						
							2002-10-08 21:34:15 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								5ac72defc9 
								
							 
						 
						
							
							
								
								Expose isCriticalEdge & SplitCriticalEdge methods from crit-edges pass  
							
							 
							
							... 
							
							
							
							llvm-svn: 4075 
							
						 
						
							2002-10-08 21:06:27 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								394617f38b 
								
							 
						 
						
							
							
								
								It is illegal for PHI nodes to have zero values, delete the code to handle them  
							
							 
							
							... 
							
							
							
							llvm-svn: 4071 
							
						 
						
							2002-10-08 17:07:39 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2e0fb39d87 
								
							 
						 
						
							
							
								
								Fold ashr -1, X into -1  
							
							 
							
							... 
							
							
							
							llvm-svn: 4070 
							
						 
						
							2002-10-08 16:16:40 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								bf3a099a62 
								
							 
						 
						
							
							
								
								Updates to work with recent Statistic's changes:  
							
							 
							
							... 
							
							
							
							* Renamed StatisticReporter.h/cpp to Statistic.h/cpp
    * Broke constructor to take two const char * arguments instead of one, so
      that indendation can be taken care of automatically.
    * Sort the list by pass name when printing
    * Make sure to print all statistics as a group, instead of randomly when
      the statistics dtors are called.
    * Updated ProgrammersManual with new semantics.
llvm-svn: 4002 
							
						 
						
							2002-10-01 22:38:41 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								05e86302f4 
								
							 
						 
						
							
							
								
								Fix bug in LICM that caused the previous big win. :(  
							
							 
							
							... 
							
							
							
							llvm-svn: 3980 
							
						 
						
							2002-09-29 22:26:07 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6443769b34 
								
							 
						 
						
							
							
								
								Hoist the contents of Loops in depth first order in the dominator tree,  
							
							 
							
							... 
							
							
							
							rather than in random order.  This causes LICM to be DRAMATICALLY more
effective. For example, on bzip2.c, it is able to hoist 302 loads and
2380 total instructions, as opposed to 44/338 before.  This  obviously
makes other transformations much more powerful as well!
llvm-svn: 3978 
							
						 
						
							2002-09-29 21:46:09 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								03a9e15a9f 
								
							 
						 
						
							
							
								
								Fix major bugs in dominator set & tree information updating  
							
							 
							
							... 
							
							
							
							llvm-svn: 3975 
							
						 
						
							2002-09-29 21:41:38 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d57f3f5073 
								
							 
						 
						
							
							
								
								- Further cleanups of LICM pass, remove extra work from previous implementation  
							
							 
							
							... 
							
							
							
							- Do not clone instructions then insert clone outside of loop.  Just move them.
llvm-svn: 3951 
							
						 
						
							2002-09-26 19:40:25 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f64f2d3fb3 
								
							 
						 
						
							
							
								
								Improve comments, doxygenize more  
							
							 
							
							... 
							
							
							
							llvm-svn: 3950 
							
						 
						
							2002-09-26 16:52:07 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								718b221ff8 
								
							 
						 
						
							
							
								
								Clean up LICM significantly now that it is guaranteed to have loop preheaders  
							
							 
							
							... 
							
							
							
							llvm-svn: 3947 
							
						 
						
							2002-09-26 16:38:03 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ca056914c6 
								
							 
						 
						
							
							
								
								Change pass name to something sane  
							
							 
							
							... 
							
							
							
							llvm-svn: 3946 
							
						 
						
							2002-09-26 16:37:37 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d771fdfd75 
								
							 
						 
						
							
							
								
								Loop invariant code motion now depends on the LoopPreheader pass.  Dead code  
							
							 
							
							... 
							
							
							
							has not yet been removed.
llvm-svn: 3945 
							
						 
						
							2002-09-26 16:19:31 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								bedbd6bc16 
								
							 
						 
						
							
							
								
								- Cleanup break-crit-edges pass by making SplitCriticalEdge a member method.  
							
							 
							
							... 
							
							
							
							- break-crit-edges pass does not invalidate loop-preheader pass.
llvm-svn: 3944 
							
						 
						
							2002-09-26 16:18:51 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								61992f66d8 
								
							 
						 
						
							
							
								
								Checkin new loop-preheader insertion pass.  
							
							 
							
							... 
							
							
							
							llvm-svn: 3942 
							
						 
						
							2002-09-26 16:17:31 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3cab9f0396 
								
							 
						 
						
							
							
								
								Change LowerAllocations pass to 'require' TargetData instead of it being  
							
							 
							
							... 
							
							
							
							passed in.
llvm-svn: 3929 
							
						 
						
							2002-09-25 23:47:47 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4357e54760 
								
							 
						 
						
							
							
								
								Eliminate extraneous #include  
							
							 
							
							... 
							
							
							
							llvm-svn: 3916 
							
						 
						
							2002-09-24 21:18:40 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								75f80bd0b6 
								
							 
						 
						
							
							
								
								- Do not expose Critical Edge breaking mechanics outside the BCE pass, thus  
							
							 
							
							... 
							
							
							
							removing it from Transforms/Local.h and from Transforms/Utils/*
llvm-svn: 3910 
							
						 
						
							2002-09-24 15:51:56 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b4e7e22be3 
								
							 
						 
						
							
							
								
								Correlated Exprs pass now requires BCE pass instead of doing it manually  
							
							 
							
							... 
							
							
							
							llvm-svn: 3908 
							
						 
						
							2002-09-24 15:43:56 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4bec665b09 
								
							 
						 
						
							
							
								
								- Expose passinfo from BreakCriticalEdges pass so that it may be "Required"  
							
							 
							
							... 
							
							
							
							by other passes.  Make BCE pass be in anonymous namespace now.
llvm-svn: 3907 
							
						 
						
							2002-09-24 15:43:12 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b03832d5d0 
								
							 
						 
						
							
							
								
								Add new BreakCriticalEdges pass  
							
							 
							
							... 
							
							
							
							llvm-svn: 3903 
							
						 
						
							2002-09-24 00:08:39 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								555518c70f 
								
							 
						 
						
							
							
								
								Optimize away cases like:  
							
							 
							
							... 
							
							
							
							%cast109 = cast uint %cast212 to short          ; <short> [#uses=1]
        %cast214 = cast short %cast109 to uint          ; <uint> [#uses=1]
        %cast215 = cast uint %cast214 to short          ; <short> [#uses=1]
llvm-svn: 3897 
							
						 
						
							2002-09-23 23:39:43 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7ccb217f21 
								
							 
						 
						
							
							
								
								* Fix bug: CorrelatedExprs/2002-09-23-PHIUpdateBug.ll  
							
							 
							
							... 
							
							
							
							* Make sure "Changed" is updated correctly
llvm-svn: 3891 
							
						 
						
							2002-09-23 20:06:22 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a8339e3613 
								
							 
						 
						
							
							
								
								Fix bug: test/Regression/Transforms/InstCombine/2002-09-17-GetElementPtrCrash.ll  
							
							 
							
							... 
							
							
							
							Thanks to Casey for finding it!
llvm-svn: 3783 
							
						 
						
							2002-09-17 21:05:42 +00:00  
						
					 
				
					
						
							
							
								 
								Vikram S. Adve
							
						 
						
							 
							
							
							
							
								
							
							
								dba59921d7 
								
							 
						 
						
							
							
								
								Extract most of the transformation into an externally accessible  
							
							 
							
							... 
							
							
							
							function -- DecomposeArrayRef(GetElementPtrInst* GEP) -- that can
be invoked on a single instruction at a time.
llvm-svn: 3755 
							
						 
						
							2002-09-16 16:40:07 +00:00  
						
					 
				
					
						
							
							
								 
								Misha Brukman
							
						 
						
							 
							
							
							
							
								
							
							
								2e8086f046 
								
							 
						 
						
							
							
								
								Function.h is unnecessary when Module.h is included.  
							
							 
							
							... 
							
							
							
							llvm-svn: 3716 
							
						 
						
							2002-09-14 03:04:02 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								136dab7d86 
								
							 
						 
						
							
							
								
								- Change getelementptr instruction to use long indexes instead of uint  
							
							 
							
							... 
							
							
							
							indexes for sequential types.
llvm-svn: 3682 
							
						 
						
							2002-09-11 01:21:33 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								cbc532603a 
								
							 
						 
						
							
							
								
								Fix the last of the silly bugs I just introduced.  :(  
							
							 
							
							... 
							
							
							
							llvm-svn: 3674 
							
						 
						
							2002-09-10 23:46:10 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								55f3d94b40 
								
							 
						 
						
							
							
								
								Add cannonicalization of shl X, 1 -> add X, X  
							
							 
							
							... 
							
							
							
							llvm-svn: 3671 
							
						 
						
							2002-09-10 23:04:09 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a239e6879d 
								
							 
						 
						
							
							
								
								Clean up code due to auto-insert constructors  
							
							 
							
							... 
							
							
							
							llvm-svn: 3665 
							
						 
						
							2002-09-10 22:38:47 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								28a8d2468a 
								
							 
						 
						
							
							
								
								Simplify code (somtimes dramatically), by using the new "auto-insert" feature  
							
							 
							
							... 
							
							
							
							of instruction constructors.
llvm-svn: 3656 
							
						 
						
							2002-09-10 17:04:02 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4184bcc701 
								
							 
						 
						
							
							
								
								* Clean up code a little bit  
							
							 
							
							... 
							
							
							
							* Fix bug: test/Regression/Transforms/IndVarsSimplify/2002-09-09-PointerIndVar.ll
llvm-svn: 3644 
							
						 
						
							2002-09-10 05:24:05 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								e103d178c5 
								
							 
						 
						
							
							
								
								Hack unneccesary now that shifts of pointers are no longer legal!  
							
							 
							
							... 
							
							
							
							llvm-svn: 3640 
							
						 
						
							2002-09-10 03:50:54 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b8bba6f765 
								
							 
						 
						
							
							
								
								Fix Bug: test/Regression/Transforms/InstCombine/2002-09-08-PointerShiftBug.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 3626 
							
						 
						
							2002-09-08 21:39:07 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								bdb147c373 
								
							 
						 
						
							
							
								
								Minor simplification  
							
							 
							
							... 
							
							
							
							llvm-svn: 3619 
							
						 
						
							2002-09-08 18:55:04 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1871472e14 
								
							 
						 
						
							
							
								
								Initial checkin of Correlated Expression Elimination Pass  
							
							 
							
							... 
							
							
							
							llvm-svn: 3599 
							
						 
						
							2002-09-06 18:41:55 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b0b412e66e 
								
							 
						 
						
							
							
								
								- Renamed Type::isIntegral() to Type::isInteger()  
							
							 
							
							... 
							
							
							
							- Added new method Type::isIntegral() that is the same as isInteger, but
    also accepts bool.
llvm-svn: 3574 
							
						 
						
							2002-09-03 01:08:28 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								99f48c614d 
								
							 
						 
						
							
							
								
								Add constant prop & DIE to InstCombine, so it cleans up after itself  
							
							 
							
							... 
							
							
							
							llvm-svn: 3568 
							
						 
						
							2002-09-02 04:59:56 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								dd6522e7a0 
								
							 
						 
						
							
							
								
								- Implement SCCP of getelementptr instructions  
							
							 
							
							... 
							
							
							
							- Implement SCCP of globals into ConstantExprs hopefully opening new
   opportunities for more SCCP.
llvm-svn: 3555 
							
						 
						
							2002-08-30 23:39:00 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1b09a9ab68 
								
							 
						 
						
							
							
								
								Really minor cleanups  
							
							 
							
							... 
							
							
							
							llvm-svn: 3549 
							
						 
						
							2002-08-30 22:53:30 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b2a31090b1 
								
							 
						 
						
							
							
								
								- GCSE now no longer counts instructions not removed (due to no common  
							
							 
							
							... 
							
							
							
							dominator as being removed)
  - GCSE now uses new Value #'ing interface, instead of dealing with AA itself
  - GCSE worklist implementation much simpler, class cleaned up.
llvm-svn: 3533 
							
						 
						
							2002-08-30 20:22:29 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								65217ff294 
								
							 
						 
						
							
							
								
								- instcombine demorgan's law: and (not A), (not B) == not (or A, B)  
							
							 
							
							... 
							
							
							
							llvm-svn: 3495 
							
						 
						
							2002-08-23 18:32:43 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								dfb3a2cd07 
								
							 
						 
						
							
							
								
								Eliminated the MemAccessInst class, folding contents into GEP class.  
							
							 
							
							... 
							
							
							
							llvm-svn: 3487 
							
						 
						
							2002-08-22 23:37:20 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								cd709cbf53 
								
							 
						 
						
							
							
								
								Load & StoreInst no longer derive from MemAccessInst, so we don't have  
							
							 
							
							... 
							
							
							
							to handle indexing anymore
llvm-svn: 3485 
							
						 
						
							2002-08-22 22:49:05 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a51fa88702 
								
							 
						 
						
							
							
								
								Add capability of using pointer analysis to LICM  
							
							 
							
							... 
							
							
							
							llvm-svn: 3478 
							
						 
						
							2002-08-22 21:39:55 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								faea121df7 
								
							 
						 
						
							
							
								
								Remove long obsolete comments  
							
							 
							
							... 
							
							
							
							llvm-svn: 3476 
							
						 
						
							2002-08-22 21:25:54 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f6c0efa754 
								
							 
						 
						
							
							
								
								Instcombine PHI's of the form  %PN = phi PN, X into X  and  
							
							 
							
							... 
							
							
							
							%PN = phi PN, PN, PN into 0 (because the phi must not be reachable)
llvm-svn: 3470 
							
						 
						
							2002-08-22 20:22:01 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								879cb97f63 
								
							 
						 
						
							
							
								
								Convert GCSE pass to use new alias analysis infrastructure  
							
							 
							
							... 
							
							
							
							llvm-svn: 3463 
							
						 
						
							2002-08-22 18:24:48 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c86203ace3 
								
							 
						 
						
							
							
								
								- Split Dominators.h into Dominators.h & PostDominators.h  
							
							 
							
							... 
							
							
							
							llvm-svn: 3432 
							
						 
						
							2002-08-21 23:43:50 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6f66bc8016 
								
							 
						 
						
							
							
								
								Remove an optimization that isn't.  
							
							 
							
							... 
							
							
							
							llvm-svn: 3419 
							
						 
						
							2002-08-21 22:10:06 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b8d6e40ed7 
								
							 
						 
						
							
							
								
								- instcombine (~(a < b)) into (a >= b)  
							
							 
							
							... 
							
							
							
							llvm-svn: 3406 
							
						 
						
							2002-08-20 18:24:26 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9cd1e66155 
								
							 
						 
						
							
							
								
								- implemented instcombine of phi (X, X, X) -> X  
							
							 
							
							... 
							
							
							
							llvm-svn: 3397 
							
						 
						
							2002-08-20 15:35:35 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c59af1d257 
								
							 
						 
						
							
							
								
								Promote getelementptr instructions to constexprs if we can.  
							
							 
							
							... 
							
							
							
							llvm-svn: 3368 
							
						 
						
							2002-08-17 22:21:59 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3732acab85 
								
							 
						 
						
							
							
								
								Handle more cases of cast-of-cast in more general forms.  
							
							 
							
							... 
							
							
							
							llvm-svn: 3347 
							
						 
						
							2002-08-15 16:15:25 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								0bb75910e2 
								
							 
						 
						
							
							
								
								Implement capability to fold this:  
							
							 
							
							... 
							
							
							
							uint %test4(int %A, int %B) {
        %COND = setlt int %A, %B                ; <bool> [#uses=1]
        %result = cast bool %COND to uint               ; <uint> [#uses=1]
        ret uint %result
}
into a single cast instruction.
llvm-svn: 3339 
							
						 
						
							2002-08-14 23:21:10 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								313fd77767 
								
							 
						 
						
							
							
								
								Avoid inserting an entry block unless we need it  
							
							 
							
							... 
							
							
							
							llvm-svn: 3336 
							
						 
						
							2002-08-14 21:35:02 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b80b69cc3e 
								
							 
						 
						
							
							
								
								Fix bug introduced in last checkin due to CastInst not being visible  
							
							 
							
							... 
							
							
							
							llvm-svn: 3327 
							
						 
						
							2002-08-14 18:22:19 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b193ff8f70 
								
							 
						 
						
							
							
								
								Remove support for NOT instruction  
							
							 
							
							... 
							
							
							
							llvm-svn: 3323 
							
						 
						
							2002-08-14 18:18:02 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								0f4093938a 
								
							 
						 
						
							
							
								
								Remove extra #includes  
							
							 
							
							... 
							
							
							
							llvm-svn: 3322 
							
						 
						
							2002-08-14 18:17:32 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6e1a1b1289 
								
							 
						 
						
							
							
								
								Remove support for unary operators  
							
							 
							
							... 
							
							
							
							llvm-svn: 3318 
							
						 
						
							2002-08-14 17:53:45 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								31ae863284 
								
							 
						 
						
							
							
								
								- Fix InstCombine pass to not generate or process NOT instructions  
							
							 
							
							... 
							
							
							
							- Fixed testcases to not use them either.
llvm-svn: 3315 
							
						 
						
							2002-08-14 17:51:49 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8328263606 
								
							 
						 
						
							
							
								
								- Rename ConstantGenericIntegral -> ConstantIntegral  
							
							 
							
							... 
							
							
							
							llvm-svn: 3300 
							
						 
						
							2002-08-13 17:50:24 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								e6794490ec 
								
							 
						 
						
							
							
								
								* Factor a bunch of code by using ReplaceInstUsesWith  
							
							 
							
							... 
							
							
							
							* Move isMaxValue, isMinValue, isAllOnesValue to Constants.h
llvm-svn: 3290 
							
						 
						
							2002-08-12 21:17:25 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6d14f2a7ae 
								
							 
						 
						
							
							
								
								New functionality for instcombine:  
							
							 
							
							... 
							
							
							
							* New ReplaceInstUsesWith function to factor out tons of common code
     This needs to be used more in the future still, but it's a good start
   * New InsertNewInstBefore to allow multi-instruction replacements
   * Change getMaxValue functions to isAllOnesValue function, which doesn't
     have to CREATE/lookup a new constant.  Also the name is accurate
   * Add new isMaxValue, isMinValue, isMaxValueMinusOne, isMinValuePlusOne
     functions:  This should be moved to Constant* classes eventually
   * Implement xor X, ALLONES -> not X
   * Fold ALL setcc's of booleans away
   * Handle various SetCC's for integers against values at the end of their
     ranges, possibly off by one.  This implements the setcc-strength-reduce.ll
     testcase.
llvm-svn: 3286 
							
						 
						
							2002-08-09 23:47:40 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f0ed55d1ee 
								
							 
						 
						
							
							
								
								- Cleaned up the interface to AnalysisUsage to take analysis class names  
							
							 
							
							... 
							
							
							
							instead of ::ID's.
 - Pass::getAnalysis<> now no longer takes an optional argument
llvm-svn: 3265 
							
						 
						
							2002-08-08 19:01:30 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								650449a1df 
								
							 
						 
						
							
							
								
								Remove extraneous #includes  
							
							 
							
							... 
							
							
							
							llvm-svn: 3262 
							
						 
						
							2002-08-08 19:00:34 +00:00  
						
					 
				
					
						
							
							
								 
								Vikram S. Adve
							
						 
						
							 
							
							
							
							
								
							
							
								4737dd7268 
								
							 
						 
						
							
							
								
								Eliminate cast instructions: use only GEPs in decomposed sequence.  
							
							 
							
							... 
							
							
							
							Don't decompose if there are 2 indices with 0 as first index.
Compute Changed flag correctly in runOnBasicBlock().
llvm-svn: 3233 
							
						 
						
							2002-08-03 13:21:15 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								650b6da0f9 
								
							 
						 
						
							
							
								
								Fix bug: test/Regression/Transforms/InstCombine/2002-08-02-CastTest.ll  
							
							 
							
							... 
							
							
							
							Implement feature: Cast's can now be converted to bitwise AND expressions.
llvm-svn: 3225 
							
						 
						
							2002-08-02 20:00:25 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ae7a0d39fd 
								
							 
						 
						
							
							
								
								* Cleanups of instcombine  
							
							 
							
							... 
							
							
							
							- Reenable gep (gep x) -> x
   - Make instcombine do dead instruction elimination where it's really
     easy.  Now visitors don't have to ensure they aren't not processing
     dead instructions.
llvm-svn: 3222 
							
						 
						
							2002-08-02 19:29:35 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f56bd89918 
								
							 
						 
						
							
							
								
								Fix bug: test/Regression/Transforms/GCSE/2002-05-21-NoSharedDominator.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 3215 
							
						 
						
							2002-08-02 18:06:01 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								33fca976ee 
								
							 
						 
						
							
							
								
								* Fix bug: test/Regression/Transforms/ADCE/2002-07-17-AssertionFailure.ll  
							
							 
							
							... 
							
							
							
							which was caused by us not running the "drop references of dead
  instructions" code when there were no basic blocks that were dead.
  We still don't want to do some of the stuff we do if there are dead
  basic blocks, but we DO want to drop references of dead instructions,
  so we factor the common code out to a new method.
llvm-svn: 3137 
							
						 
						
							2002-07-30 00:22:34 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3be5d0b892 
								
							 
						 
						
							
							
								
								Add code to ensure that no PHI nodes are left laying around with their  
							
							 
							
							... 
							
							
							
							arguments dropped.  This fixes bug:
   test/Regression/Transforms/ADCE/2002-07-17-PHIAssertion.ll
llvm-svn: 3134 
							
						 
						
							2002-07-29 23:40:46 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ee420b7f9d 
								
							 
						 
						
							
							
								
								Fix bug: test/Regression/Transforms/ADCE/2002-07-29-Segfault.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 3129 
							
						 
						
							2002-07-29 22:31:39 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2675007573 
								
							 
						 
						
							
							
								
								* Standardize how analysis results/passes as printed with the print() virtual  
							
							 
							
							... 
							
							
							
							methods
* Eliminate AnalysisID:  Now it is just a typedef for const PassInfo*
* Simplify how AnalysisID's are initialized
* Eliminate Analysis/Writer.cpp/.h: incorporate printing functionality into
  the analyses themselves.
llvm-svn: 3116 
							
						 
						
							2002-07-27 01:12:17 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c8b7092e54 
								
							 
						 
						
							
							
								
								* Add support for different "PassType's"  
							
							 
							
							... 
							
							
							
							* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Remove getPassName implementations from various subclasses
llvm-svn: 3113 
							
						 
						
							2002-07-26 21:12:46 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								64eea749de 
								
							 
						 
						
							
							
								
								*** empty log message ***  
							
							 
							
							... 
							
							
							
							llvm-svn: 3105 
							
						 
						
							2002-07-26 18:40:14 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								10073a9080 
								
							 
						 
						
							
							
								
								*** empty log message ***  
							
							 
							
							... 
							
							
							
							llvm-svn: 3075 
							
						 
						
							2002-07-25 06:17:51 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								42706e4dec 
								
							 
						 
						
							
							
								
								Merge ChangeAllocations into scalar.h  
							
							 
							
							... 
							
							
							
							llvm-svn: 3038 
							
						 
						
							2002-07-23 22:04:17 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b28b680155 
								
							 
						 
						
							
							
								
								*** empty log message ***  
							
							 
							
							... 
							
							
							
							llvm-svn: 3016 
							
						 
						
							2002-07-23 18:06:35 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6788f25f99 
								
							 
						 
						
							
							
								
								* Remove getPassName implementation  
							
							 
							
							... 
							
							
							
							* Register all Passes
llvm-svn: 3015 
							
						 
						
							2002-07-23 18:06:30 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a896b08b5c 
								
							 
						 
						
							
							
								
								*** empty log message ***  
							
							 
							
							... 
							
							
							
							llvm-svn: 3002 
							
						 
						
							2002-07-23 17:52:38 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b2c5cb2525 
								
							 
						 
						
							
							
								
								Disable folding g-e-p instructions into loads and stores.  
							
							 
							
							... 
							
							
							
							llvm-svn: 2870 
							
						 
						
							2002-07-10 22:37:17 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								33422fedc2 
								
							 
						 
						
							
							
								
								*** empty log message ***  
							
							 
							
							... 
							
							
							
							llvm-svn: 2813 
							
						 
						
							2002-06-30 16:25:25 +00:00  
						
					 
				
					
						
							
							
								 
								Anand Shukla
							
						 
						
							 
							
							
							
							
								
							
							
								2bc6419a82 
								
							 
						 
						
							
							
								
								changes to make it compatible with 64bit gcc  
							
							 
							
							... 
							
							
							
							llvm-svn: 2792 
							
						 
						
							2002-06-25 21:07:58 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								113f4f4609 
								
							 
						 
						
							
							
								
								MEGAPATCH checkin.  
							
							 
							
							... 
							
							
							
							For details, See: docs/2002-06-25-MegaPatchInfo.txt
llvm-svn: 2779 
							
						 
						
							2002-06-25 16:13:24 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								194138cd08 
								
							 
						 
						
							
							
								
								Avoid deleting individual instructions until AFTER dead blocks have dropped  
							
							 
							
							... 
							
							
							
							their references.  This fixes bug:
    test/Regression/Transforms/ADCE/2002-05-28-Crash*.ll
llvm-svn: 2753 
							
						 
						
							2002-05-28 21:38:16 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ab038d44b0 
								
							 
						 
						
							
							
								
								Simplify the interface to local DCE and Constant prop  
							
							 
							
							... 
							
							
							
							llvm-svn: 2749 
							
						 
						
							2002-05-26 20:18:18 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9c2765d4aa 
								
							 
						 
						
							
							
								
								Fold add X, 0 for floating point types as well  
							
							 
							
							... 
							
							
							
							llvm-svn: 2734 
							
						 
						
							2002-05-23 17:11:38 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								559f0ee9c9 
								
							 
						 
						
							
							
								
								Fix and implement ADCE to finally work!  
							
							 
							
							... 
							
							
							
							llvm-svn: 2720 
							
						 
						
							2002-05-22 21:32:16 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								71cbd42b98 
								
							 
						 
						
							
							
								
								Use the new DEBUG(x) macro to allow debugging code to be enabled on the commandline  
							
							 
							
							... 
							
							
							
							llvm-svn: 2713 
							
						 
						
							2002-05-22 17:17:27 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a482d52ff4 
								
							 
						 
						
							
							
								
								Fix bug: test/Regression/Transforms/SCCP/2002-05-21-InvalidSimplify.ll  
							
							 
							
							... 
							
							
							
							Improperly handling edges... by not marking them alive properly
llvm-svn: 2707 
							
						 
						
							2002-05-22 16:07:20 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								fa7dad8cd5 
								
							 
						 
						
							
							
								
								New CFG Simplification pass: removed from the old DCE pass  
							
							 
							
							... 
							
							
							
							llvm-svn: 2700 
							
						 
						
							2002-05-21 20:49:37 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b710b1fb22 
								
							 
						 
						
							
							
								
								Fix bug: test/Regression/Transforms/SCCP/2002-05-20-MissedIncomingValue.ll  
							
							 
							
							... 
							
							
							
							That was causing a miscompilation of strtol/atoi plus others
llvm-svn: 2669 
							
						 
						
							2002-05-20 20:48:03 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7bc532dded 
								
							 
						 
						
							
							
								
								* Make debug output conditional on #define  
							
							 
							
							... 
							
							
							
							* Add optimization to rank computation to not recursively search when
  unneccesary.
* More agressively negate expressions to open reassociation opportunities.
* Linearize (A+B)+(C+D) into ((A+B)+C)+D
llvm-svn: 2637 
							
						 
						
							2002-05-16 04:37:07 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								cd9837d32e 
								
							 
						 
						
							
							
								
								* Fix bug: test/Regression/Transforms/GCSE/2002-05-14-OperandSwap.ll  
							
							 
							
							... 
							
							
							
							By making sure to consider binary expressions identical if their operands
are backwards, but swappable.
llvm-svn: 2629 
							
						 
						
							2002-05-14 19:57:25 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								170ed7b6a3 
								
							 
						 
						
							
							
								
								Fix bug: test/Regression/Transforms/InstCombine/2002-05-14-SubFailure.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 2627 
							
						 
						
							2002-05-14 16:44:07 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								053c0939e3 
								
							 
						 
						
							
							
								
								Fix bug: test/Regression/Transforms/InstCombine/2002-05-14-TouchDeletedInst.ll  
							
							 
							
							... 
							
							
							
							"This testcase caused instcombine to fail because it got the same instruction on
it's worklist more than once (which is ok), but then deleted the instruction.
Since the inst stayed on the worklist, as soon as it came back up to be
processed, bad things happened, and opt asserted."
llvm-svn: 2623 
							
						 
						
							2002-05-14 15:24:07 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d38ddb1164 
								
							 
						 
						
							
							
								
								Implement elimination of loads  
							
							 
							
							... 
							
							
							
							llvm-svn: 2620 
							
						 
						
							2002-05-14 05:02:40 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7ab51787ca 
								
							 
						 
						
							
							
								
								Trivial cleanups  
							
							 
							
							... 
							
							
							
							llvm-svn: 2617 
							
						 
						
							2002-05-13 22:04:46 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6ec05f551c 
								
							 
						 
						
							
							
								
								Initial checkin of LICM pass  
							
							 
							
							... 
							
							
							
							llvm-svn: 2615 
							
						 
						
							2002-05-10 22:44:58 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								0b18c1d64e 
								
							 
						 
						
							
							
								
								Add support for printing out statistics information when -stats is added to  
							
							 
							
							... 
							
							
							
							the command line
llvm-svn: 2601 
							
						 
						
							2002-05-10 15:38:35 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								bad1b4dfce 
								
							 
						 
						
							
							
								
								Fix some bugs, straighten stuff out, more work needs to be done.  
							
							 
							
							... 
							
							
							
							llvm-svn: 2600 
							
						 
						
							2002-05-10 15:37:35 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								014ee634ce 
								
							 
						 
						
							
							
								
								Initial checkin of the PiNodeInsertion pass  
							
							 
							
							... 
							
							
							
							llvm-svn: 2593 
							
						 
						
							2002-05-10 05:41:34 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1fc23f382e 
								
							 
						 
						
							
							
								
								Handle setcc <global*>, 0 instructions, Global pointers are never null!  
							
							 
							
							... 
							
							
							
							llvm-svn: 2582 
							
						 
						
							2002-05-09 20:11:54 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6bd7ac6205 
								
							 
						 
						
							
							
								
								Give the longer name to the instruction that will probably be eliminated later  
							
							 
							
							... 
							
							
							
							llvm-svn: 2581 
							
						 
						
							2002-05-09 20:11:23 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ad3c495225 
								
							 
						 
						
							
							
								
								Add ability to transform (x - (y - z)) into (x + (z - y))  
							
							 
							
							... 
							
							
							
							llvm-svn: 2566 
							
						 
						
							2002-05-09 01:29:19 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								147e975c43 
								
							 
						 
						
							
							
								
								* Combine: A-(-B) -> A + B  
							
							 
							
							... 
							
							
							
							* Bugfix:  A + -B and -A + B
llvm-svn: 2561 
							
						 
						
							2002-05-08 22:46:53 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c0f5800678 
								
							 
						 
						
							
							
								
								Initial checkin of expression reassociation pass  
							
							 
							
							... 
							
							
							
							llvm-svn: 2559 
							
						 
						
							2002-05-08 22:19:27 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c1496bda61 
								
							 
						 
						
							
							
								
								Fix bug: test/Regression/Transforms/ADCE/2002-01-31-UseStuckAround.ll  
							
							 
							
							... 
							
							
							
							Cleanup code a lot
llvm-svn: 2547 
							
						 
						
							2002-05-07 22:11:39 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b4cfa7ff97 
								
							 
						 
						
							
							
								
								Merge all individual .h files into a single Scalar.h file  
							
							 
							
							... 
							
							
							
							llvm-svn: 2537 
							
						 
						
							2002-05-07 20:03:00 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								77f791dd5b 
								
							 
						 
						
							
							
								
								Split ChangeAllocations.cpp into Raise & LowerAllocations.cpp  
							
							 
							
							... 
							
							
							
							llvm-svn: 2529 
							
						 
						
							2002-05-07 19:02:48 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7608a46cbe 
								
							 
						 
						
							
							
								
								Updates to move some header files out of include/llvm/Transforms into  
							
							 
							
							... 
							
							
							
							the Scalar and Utils subdirectories
llvm-svn: 2523 
							
						 
						
							2002-05-07 18:36:35 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9b55e5a2f4 
								
							 
						 
						
							
							
								
								Reduce dependance on TransformInternals.h, instead using the TransformUtils library  
							
							 
							
							... 
							
							
							
							llvm-svn: 2518 
							
						 
						
							2002-05-07 18:12:18 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3d86d49604 
								
							 
						 
						
							
							
								
								Add #include no longer included by llvm/Transforms/Scalar/ConstantProp.h  
							
							 
							
							... 
							
							
							
							llvm-svn: 2517 
							
						 
						
							2002-05-07 18:11:30 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								560da70f8c 
								
							 
						 
						
							
							
								
								Factor code out to the TransformUtils library  
							
							 
							
							... 
							
							
							
							llvm-svn: 2516 
							
						 
						
							2002-05-07 18:10:55 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d66a6e33e9 
								
							 
						 
						
							
							
								
								* Convert InstWorkList to vector instead of set, because on big programs it  
							
							 
							
							... 
							
							
							
							is empirically faster by a noticable margin, even though duplicates can
  happen.
llvm-svn: 2511 
							
						 
						
							2002-05-07 04:29:32 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								87e8806f05 
								
							 
						 
						
							
							
								
								* Remove all cfg simplification stuff for a new cfg simplify pass (todo)  
							
							 
							
							... 
							
							
							
							* Convert to worklist instead of iterative algorithm
llvm-svn: 2510 
							
						 
						
							2002-05-07 04:24:11 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a6e047a5d9 
								
							 
						 
						
							
							
								
								Only do masking for unsigned values!  
							
							 
							
							... 
							
							
							
							llvm-svn: 2504 
							
						 
						
							2002-05-06 18:54:59 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								e548507e8c 
								
							 
						 
						
							
							
								
								* Eliminate dead code that should have been removed in last revision  
							
							 
							
							... 
							
							
							
							* Convert main constant propogation pass to be worklist driven instead of
  iterative.
* -constprop pass no longer "constant propogates" terminator instructions
   - CFG is now preserved!
llvm-svn: 2502 
							
						 
						
							2002-05-06 18:21:31 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								bbbdd852b8 
								
							 
						 
						
							
							
								
								Handle X = phi Y  --> X = Y  
							
							 
							
							... 
							
							
							
							llvm-svn: 2501 
							
						 
						
							2002-05-06 18:06:38 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4c3366405a 
								
							 
						 
						
							
							
								
								* Use simplified interface to constant propogation stuff.  
							
							 
							
							... 
							
							
							
							* Remove dead PHI case (which could not work due to getNumOperands rather than
  getNumIncomingValues.  This really belongs in InstCombine, anyway so we'll
  move it there.
llvm-svn: 2497 
							
						 
						
							2002-05-06 17:54:10 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								019f3649bd 
								
							 
						 
						
							
							
								
								Clean up ADCE by removing extraneous wrapper class  
							
							 
							
							... 
							
							
							
							llvm-svn: 2494 
							
						 
						
							2002-05-06 17:27:57 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								5d6bec5e26 
								
							 
						 
						
							
							
								
								Combine not (not X) -> X  
							
							 
							
							... 
							
							
							
							llvm-svn: 2493 
							
						 
						
							2002-05-06 17:03:21 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9fa53de7e9 
								
							 
						 
						
							
							
								
								Support more cases...  
							
							 
							
							... 
							
							
							
							llvm-svn: 2490 
							
						 
						
							2002-05-06 16:49:18 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f4cdbf34e5 
								
							 
						 
						
							
							
								
								Add many more instruction combination simplifications  
							
							 
							
							... 
							
							
							
							llvm-svn: 2484 
							
						 
						
							2002-05-06 16:14:14 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								66e25b8b62 
								
							 
						 
						
							
							
								
								Merge blocks like this:  
							
							 
							
							... 
							
							
							
							void "test3"(bool %T) {
        br bool %T, label %BB1, label %BB1
BB1:
        ret void
}
llvm-svn: 2472 
							
						 
						
							2002-05-06 03:02:02 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								940daedc22 
								
							 
						 
						
							
							
								
								Implement constant propogation of shift instructions  
							
							 
							
							... 
							
							
							
							llvm-svn: 2471 
							
						 
						
							2002-05-06 03:01:37 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7b80b53ab9 
								
							 
						 
						
							
							
								
								Ok, really it only takes me 3 times to get this right!  
							
							 
							
							... 
							
							
							
							Now use #if 0 instead of #ifdef 0
llvm-svn: 2448 
							
						 
						
							2002-05-02 21:49:50 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								dd390e1736 
								
							 
						 
						
							
							
								
								Oops, disable debugging code all the way.  :)  
							
							 
							
							... 
							
							
							
							llvm-svn: 2447 
							
						 
						
							2002-05-02 21:47:40 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								fe6c9eeae3 
								
							 
						 
						
							
							
								
								* Finish the implementation of isEdgeFeasible this fixes bug:  
							
							 
							
							... 
							
							
							
							test/Regression/Transforms/SCCP/2002-05-02-EdgeFailure.ll
* SCCP now preserves the CFG:  It leaves conditional branches the way they
  are in the program, not simplifying them.  A seperate pass should eliminate
  the potentially dead basic blocks and edges in the CFG.
llvm-svn: 2446 
							
						 
						
							2002-05-02 21:44:00 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								13b52e71d8 
								
							 
						 
						
							
							
								
								* Enable SCCP debugging to be turned on with a simple change of #define  
							
							 
							
							... 
							
							
							
							* Change worklist to a set so that duplicates cannot happen
* Add support for the invoke instruction
* Avoid marking store and free instructions as overdefined, since they
  cannot produce a value anyway.
* Inline the OperandChangedState implementation
* Add isEdgeFeasible in preparation to fix a bug.  Right now it behaves
  exactly as before.
* Remove obsolete comment about constant pools
llvm-svn: 2445 
							
						 
						
							2002-05-02 21:18:01 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								5364d1a74a 
								
							 
						 
						
							
							
								
								* Simplify the code by not bothering to name the folded constant  
							
							 
							
							... 
							
							
							
							* Do not skip the instruction immediately after a folded instruction.  This
  was causing the testcase failure:
	test/Regression/Transforms/SCCP/2002-05-02-MissSecondInst.ll
llvm-svn: 2443 
							
						 
						
							2002-05-02 20:32:51 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								48a44f7e23 
								
							 
						 
						
							
							
								
								* Add ability to eliminate a bunch of different cascading cast variations  
							
							 
							
							... 
							
							
							
							* Allow elimination of getelementptr X, uint 0 (which is a noop)
llvm-svn: 2428 
							
						 
						
							2002-05-02 17:06:02 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								31ba129cbe 
								
							 
						 
						
							
							
								
								Add folding rules for mul X, 0 and mul X, 2  
							
							 
							
							... 
							
							
							
							llvm-svn: 2417 
							
						 
						
							2002-04-29 22:24:47 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7d3253876a 
								
							 
						 
						
							
							
								
								Significantly clean up SCCP pass.  Now the two classes are merged and in  
							
							 
							
							... 
							
							
							
							an anonymous namespace where they belong.
llvm-svn: 2415 
							
						 
						
							2002-04-29 21:26:08 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								27eeecbb69 
								
							 
						 
						
							
							
								
								Range insertion now returns an iterator  
							
							 
							
							... 
							
							
							
							llvm-svn: 2414 
							
						 
						
							2002-04-29 21:25:34 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								09bbb5c015 
								
							 
						 
						
							
							
								
								Remove unused files:  This is the old induction varaible cannonicalization  
							
							 
							
							... 
							
							
							
							pass built on top of interval analysis
llvm-svn: 2411 
							
						 
						
							2002-04-29 20:18:00 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								15e8f4c012 
								
							 
						 
						
							
							
								
								changes because iMemory.h no longer #includes DerivedTypes.h  
							
							 
							
							... 
							
							
							
							This only requires Type.h anyway
llvm-svn: 2405 
							
						 
						
							2002-04-29 18:48:30 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d5a847057b 
								
							 
						 
						
							
							
								
								Eliminate duplicate or unneccesary #include's  
							
							 
							
							... 
							
							
							
							llvm-svn: 2397 
							
						 
						
							2002-04-29 17:42:12 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2dfc667a7d 
								
							 
						 
						
							
							
								
								Remove broken assertion.  
							
							 
							
							... 
							
							
							
							llvm-svn: 2396 
							
						 
						
							2002-04-29 16:20:25 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								37104aace8 
								
							 
						 
						
							
							
								
								Add new optional getPassName() virtual function that a Pass can override  
							
							 
							
							... 
							
							
							
							to make debugging output a lot nicer.
llvm-svn: 2395 
							
						 
						
							2002-04-29 14:57:45 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8d843f6b77 
								
							 
						 
						
							
							
								
								More cleanups  
							
							 
							
							... 
							
							
							
							llvm-svn: 2392 
							
						 
						
							2002-04-29 01:58:47 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								fc1a433dae 
								
							 
						 
						
							
							
								
								Code cleanups  
							
							 
							
							... 
							
							
							
							llvm-svn: 2391 
							
						 
						
							2002-04-29 01:22:55 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f12cc842b3 
								
							 
						 
						
							
							
								
								Tighten up the AnalysisUsage of lots of passes, primarily to correctly indicate whether or not they invalidate the CFGA  
							
							 
							
							... 
							
							
							
							llvm-svn: 2386 
							
						 
						
							2002-04-28 21:27:06 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ca14237696 
								
							 
						 
						
							
							
								
								Split ConstantVals.h into Constant.h and Constants.h  
							
							 
							
							... 
							
							
							
							llvm-svn: 2378 
							
						 
						
							2002-04-28 19:55:58 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								78dd56fe62 
								
							 
						 
						
							
							
								
								Eliminate the cfg namespace, moving LoopInfo, Dominators, Interval* classes  
							
							 
							
							... 
							
							
							
							to the global namespace
llvm-svn: 2370 
							
						 
						
							2002-04-28 16:21:30 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1467f64f01 
								
							 
						 
						
							
							
								
								Initial checkin of simple&fast SSA based GCSE algorithm  
							
							 
							
							... 
							
							
							
							llvm-svn: 2338 
							
						 
						
							2002-04-28 00:47:11 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c8e665431b 
								
							 
						 
						
							
							
								
								* Rename MethodPass class to FunctionPass  
							
							 
							
							... 
							
							
							
							- Rename runOnMethod to runOnFunction
* Transform getAnalysisUsageInfo into getAnalysisUsage
  - Method is now const
  - It now takes one AnalysisUsage object to fill in instead of 3 vectors
    to fill in
  - Pass's now specify which other passes they _preserve_ not which ones
    they modify (be conservative!)
  - A pass can specify that it preserves all analyses (because it never
    modifies the underlying program)
* s/Method/Function/g in other random places as well
llvm-svn: 2333 
							
						 
						
							2002-04-27 06:56:12 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								66cfaf1da2 
								
							 
						 
						
							
							
								
								Changes because the Terminator::getSuccessor function now FAILS if successor  
							
							 
							
							... 
							
							
							
							IDX is out of range instead of returning null.
llvm-svn: 2332 
							
						 
						
							2002-04-27 03:15:45 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2716b5e524 
								
							 
						 
						
							
							
								
								Change Constant::getNullConstant to Constant::getNullValue  
							
							 
							
							... 
							
							
							
							llvm-svn: 2323 
							
						 
						
							2002-04-27 02:25:14 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								260ab20422 
								
							 
						 
						
							
							
								
								Significantly rework InstructionCombining to work better and to be cleaner.  
							
							 
							
							... 
							
							
							
							We now use an InstVisitor to delegate to different cases that we are
interested in handling.  We also fix the FIXME's by adding users to the
worklist when appropriate.
llvm-svn: 2292 
							
						 
						
							2002-04-18 17:39:14 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6e56079654 
								
							 
						 
						
							
							
								
								Convert SCCP over to use InstVisitor instead of hand crafted switch  
							
							 
							
							... 
							
							
							
							llvm-svn: 2286 
							
						 
						
							2002-04-18 15:13:15 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								5873900709 
								
							 
						 
						
							
							
								
								GEP instructions can never be constant propogated.  
							
							 
							
							... 
							
							
							
							llvm-svn: 2284 
							
						 
						
							2002-04-18 14:44:13 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f40379e403 
								
							 
						 
						
							
							
								
								Store instructions always return void, so they never get a name  
							
							 
							
							... 
							
							
							
							llvm-svn: 2283 
							
						 
						
							2002-04-18 14:43:54 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3a60d04722 
								
							 
						 
						
							
							
								
								Eliminate cast of same type instructions.  
							
							 
							
							... 
							
							
							
							llvm-svn: 2251 
							
						 
						
							2002-04-15 19:45:29 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2e9fa6d101 
								
							 
						 
						
							
							
								
								Move FunctionArgument out of iOther.h into Argument.h and rename class to  
							
							 
							
							... 
							
							
							
							be 'Argument' instead of FunctionArgument.
llvm-svn: 2216 
							
						 
						
							2002-04-09 19:48:49 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								06be180225 
								
							 
						 
						
							
							
								
								Add explicit #includes of Function.h to make up for the removed #include  
							
							 
							
							... 
							
							
							
							in iOther.h
llvm-svn: 2209 
							
						 
						
							2002-04-09 19:08:28 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d92b01c385 
								
							 
						 
						
							
							
								
								Add #includes to make up for #includes pruned out of header files.  
							
							 
							
							... 
							
							
							
							llvm-svn: 2207 
							
						 
						
							2002-04-09 18:37:46 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f8e4dc33ab 
								
							 
						 
						
							
							
								
								s/Method/Function  
							
							 
							
							... 
							
							
							
							Remove extraneous #includes of llvm/Assembly/Writer
llvm-svn: 2178 
							
						 
						
							2002-04-08 22:03:00 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								65b529fe6d 
								
							 
						 
						
							
							
								
								ConstantHandling moved into VMCore library  
							
							 
							
							... 
							
							
							
							llvm-svn: 2165 
							
						 
						
							2002-04-08 20:18:09 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								62b7fd136e 
								
							 
						 
						
							
							
								
								Change references to the Method class to be references to the Function  
							
							 
							
							... 
							
							
							
							class.  The Method class is obsolete (renamed) and all references to it
are being converted over to Function.
llvm-svn: 2144 
							
						 
						
							2002-04-07 20:49:59 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c13563d5c0 
								
							 
						 
						
							
							
								
								Simplify code a lot by using the Module::getFunction & getOrInsertFunction  
							
							 
							
							... 
							
							
							
							llvm-svn: 2028 
							
						 
						
							2002-03-29 03:38:05 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								57698e2c0b 
								
							 
						 
						
							
							
								
								Change references from Method to Function  
							
							 
							
							... 
							
							
							
							change references from MethodARgument to FunctionArgument
llvm-svn: 1991 
							
						 
						
							2002-03-26 18:01:55 +00:00  
						
					 
				
					
						
							
							
								 
								Vikram S. Adve
							
						 
						
							 
							
							
							
							
								
							
							
								1ee0658a07 
								
							 
						 
						
							
							
								
								Major overhaul to support arbitrary mixed array and structure indices.  
							
							 
							
							... 
							
							
							
							Also moved to the Scalar/ directory and renamed to "MultiDim".
llvm-svn: 1961 
							
						 
						
							2002-03-24 03:21:18 +00:00  
						
					 
				
					
						
							
							
								 
								Vikram S. Adve
							
						 
						
							 
							
							
							
							
								
							
							
								5d218dff24 
								
							 
						 
						
							
							
								
								New pass to decompose multi-dimensional array references into  
							
							 
							
							... 
							
							
							
							a sequence of 1-D references, using a sequence of getElementPtrs.
llvm-svn: 1948 
							
						 
						
							2002-03-23 20:43:39 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								bee86626e1 
								
							 
						 
						
							
							
								
								Fix bug: test/Regression/Other/2002-03-11-InstCombineHang.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 1864 
							
						 
						
							2002-03-11 23:28:45 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								477fe0845a 
								
							 
						 
						
							
							
								
								Fix bug: test/Regression/Other/2002-03-11-ConstPropCrash.ll  
							
							 
							
							... 
							
							
							
							llvm-svn: 1858 
							
						 
						
							2002-03-11 22:11:07 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								04805fa29c 
								
							 
						 
						
							
							
								
								Change over to use new style pass mechanism, now passes only expose small  
							
							 
							
							... 
							
							
							
							creation functions in their public header file, unless they can help it.
llvm-svn: 1816 
							
						 
						
							2002-02-26 21:46:54 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								83d485b310 
								
							 
						 
						
							
							
								
								* Pull BasicBlock::pred_* and BasicBlock::succ_* out of BasicBlock.h and into  
							
							 
							
							... 
							
							
							
							llvm/Support/CFG.h
* Make pred & succ iterators for intervals global functions
* Add #includes that are now neccesary because BasicBlock.h doesn't include
  InstrTypes.h anymore
llvm-svn: 1750 
							
						 
						
							2002-02-12 22:39:50 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								60a6591d83 
								
							 
						 
						
							
							
								
								Method.h no longer includes BasicBlock.h  
							
							 
							
							... 
							
							
							
							Method::inst_* is now in llvm/Support/InstIterator.h
GraphTraits specializations for BasicBlock and Methods are now in llvm/Support/CFG.h
llvm-svn: 1746 
							
						 
						
							2002-02-12 21:07:25 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								352151e222 
								
							 
						 
						
							
							
								
								MethodPass's are now guaranteed to not be run on external methods!  
							
							 
							
							... 
							
							
							
							llvm-svn: 1611 
							
						 
						
							2002-01-31 00:51:24 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d5d56780e2 
								
							 
						 
						
							
							
								
								Convert xforms over to new pass structure.  
							
							 
							
							... 
							
							
							
							llvm-svn: 1605 
							
						 
						
							2002-01-31 00:45:11 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d5851db315 
								
							 
						 
						
							
							
								
								Remove extraneous #includes  
							
							 
							
							... 
							
							
							
							llvm-svn: 1588 
							
						 
						
							2002-01-26 22:47:32 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7209dc2446 
								
							 
						 
						
							
							
								
								Remove opt namespace  
							
							 
							
							... 
							
							
							
							llvm-svn: 1587 
							
						 
						
							2002-01-26 22:47:07 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ccbd4e4643 
								
							 
						 
						
							
							
								
								Implement new DeadInstElmination pass  
							
							 
							
							... 
							
							
							
							remove old comment
llvm-svn: 1555 
							
						 
						
							2002-01-23 05:48:24 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								70090079e7 
								
							 
						 
						
							
							
								
								Don't insert a useless cast  
							
							 
							
							... 
							
							
							
							llvm-svn: 1527 
							
						 
						
							2002-01-22 03:30:06 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3787ee6be6 
								
							 
						 
						
							
							
								
								Rename LowerAllocations.h to ChangeAllocations.h since it now contains the  
							
							 
							
							... 
							
							
							
							RaiseAllocations pass as well.
llvm-svn: 1525 
							
						 
						
							2002-01-22 01:04:08 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4f0f09757d 
								
							 
						 
						
							
							
								
								Pull RaiseAllocations stuff out of the CleanGCC pass into it's own pass in  
							
							 
							
							... 
							
							
							
							the ChangeAllocations.h header file.
llvm-svn: 1522 
							
						 
						
							2002-01-22 00:13:51 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d07471d6c3 
								
							 
						 
						
							
							
								
								LowerAllocations is really a BasicBlock pass.  Make it so.  
							
							 
							
							... 
							
							
							
							llvm-svn: 1521 
							
						 
						
							2002-01-21 23:34:02 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ee965abc36 
								
							 
						 
						
							
							
								
								Move stuff out of the Optimizations directories into the appropriate Transforms  
							
							 
							
							... 
							
							
							
							directories.  Eliminate the opt namespace.
llvm-svn: 1520 
							
						 
						
							2002-01-21 23:17:48 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								0686e435d1 
								
							 
						 
						
							
							
								
								Implement a more powerful, simpler, pass system.  This pass system can figure  
							
							 
							
							... 
							
							
							
							out how to run a collection of passes optimially given their behaviors and
charactaristics.
Convert code to use it.
llvm-svn: 1507 
							
						 
						
							2002-01-21 07:31:50 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7f74a56e24 
								
							 
						 
						
							
							
								
								Changes to build successfully with GCC 3.02  
							
							 
							
							... 
							
							
							
							llvm-svn: 1503 
							
						 
						
							2002-01-20 22:54:45 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ca081257e5 
								
							 
						 
						
							
							
								
								initial checkin  
							
							 
							
							... 
							
							
							
							llvm-svn: 1480 
							
						 
						
							2001-12-14 16:52:21 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b3364fc169 
								
							 
						 
						
							
							
								
								Remove unsized array support  
							
							 
							
							... 
							
							
							
							llvm-svn: 1466 
							
						 
						
							2001-12-14 16:38:04 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f5c6f65e7f 
								
							 
						 
						
							
							
								
								Assertion could never fail because another one would in it's place.  :)  
							
							 
							
							... 
							
							
							
							llvm-svn: 1449 
							
						 
						
							2001-12-13 00:45:40 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								674394077f 
								
							 
						 
						
							
							
								
								Actually return true when a change has been made  
							
							 
							
							... 
							
							
							
							llvm-svn: 1425 
							
						 
						
							2001-12-05 19:41:33 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								25b151dfdf 
								
							 
						 
						
							
							
								
								Fix a bug introduced by "internal linkage" work.  
							
							 
							
							... 
							
							
							
							llvm-svn: 1415 
							
						 
						
							2001-12-04 18:01:49 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d23d752dc5 
								
							 
						 
						
							
							
								
								Fix bugs, don't do external methods which causes segv.  
							
							 
							
							... 
							
							
							
							llvm-svn: 1414 
							
						 
						
							2001-12-04 08:13:06 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								91daaabb56 
								
							 
						 
						
							
							
								
								Implement induction variable simplification  
							
							 
							
							... 
							
							
							
							llvm-svn: 1411 
							
						 
						
							2001-12-04 04:32:29 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2413b160ec 
								
							 
						 
						
							
							
								
								Renamed inst_const_iterator -> const_inst_iterator  
							
							 
							
							... 
							
							
							
							Renamed op_const_iterator   -> const_op_iterator
Renamed PointerType::getValueType() -> PointerType::getElementType()
llvm-svn: 1408 
							
						 
						
							2001-12-04 00:03:30 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3462ae3ad7 
								
							 
						 
						
							
							
								
								Rename ConstPoolVal -> Constant  
							
							 
							
							... 
							
							
							
							Rename ConstPool*   -> Constant*
Rename ConstPoolVals.h -> ConstantVals.h
llvm-svn: 1407 
							
						 
						
							2001-12-03 22:26:30 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								fb5ae02e1a 
								
							 
						 
						
							
							
								
								Split the PHINode class out from the iOther.h file into the iPHINode.h file  
							
							 
							
							... 
							
							
							
							llvm-svn: 1405 
							
						 
						
							2001-12-03 18:02:31 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								476e6df794 
								
							 
						 
						
							
							
								
								Initial checkin of indvar stuff  
							
							 
							
							... 
							
							
							
							llvm-svn: 1404 
							
						 
						
							2001-12-03 17:28:42 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								5de2204fe8 
								
							 
						 
						
							
							
								
								Create a new #include "Support/..." directory structure to move things  
							
							 
							
							... 
							
							
							
							from "llvm/Support/..." that are not llvm dependant.
Move files and fix #includes
llvm-svn: 1400 
							
						 
						
							2001-11-27 00:03:19 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c4ad64cb9c 
								
							 
						 
						
							
							
								
								Misc cleanups  
							
							 
							
							... 
							
							
							
							llvm-svn: 1377 
							
						 
						
							2001-11-26 18:57:38 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1f86880af4 
								
							 
						 
						
							
							
								
								Expose constant propogation of an instruction in a clean way  
							
							 
							
							... 
							
							
							
							llvm-svn: 1376 
							
						 
						
							2001-11-26 18:57:12 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3b7199e36c 
								
							 
						 
						
							
							
								
								Add #includes to enable buiding in Release mode  
							
							 
							
							... 
							
							
							
							llvm-svn: 1174 
							
						 
						
							2001-11-07 13:49:45 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								033324fc0c 
								
							 
						 
						
							
							
								
								Avoid making a broken transformation!  
							
							 
							
							... 
							
							
							
							llvm-svn: 1115 
							
						 
						
							2001-11-03 21:30:22 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7567f6c15f 
								
							 
						 
						
							
							
								
								Expose the low level DCE mechanism to external users  
							
							 
							
							... 
							
							
							
							Refactor code to support it
llvm-svn: 1083 
							
						 
						
							2001-11-01 07:00:27 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								04648a4cc6 
								
							 
						 
						
							
							
								
								Simplify DCE code a lot  
							
							 
							
							... 
							
							
							
							llvm-svn: 1079 
							
						 
						
							2001-11-01 05:55:29 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7e6a0d8c17 
								
							 
						 
						
							
							
								
								Use the correct prototype for malloc and free  
							
							 
							
							... 
							
							
							
							llvm-svn: 1066 
							
						 
						
							2001-10-31 06:36:23 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								9db8b765cd 
								
							 
						 
						
							
							
								
								Implemented constant propogation of cast instructions  
							
							 
							
							... 
							
							
							
							llvm-svn: 1064 
							
						 
						
							2001-10-31 05:07:57 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6fea0324d7 
								
							 
						 
						
							
							
								
								Convert to new simpler pass itf  
							
							 
							
							... 
							
							
							
							llvm-svn: 880 
							
						 
						
							2001-10-18 05:27:33 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								5398a6eb6c 
								
							 
						 
						
							
							
								
								Convert optimizations to the pass infrastructure  
							
							 
							
							... 
							
							
							
							llvm-svn: 873 
							
						 
						
							2001-10-18 01:32:34 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1bb5f8e4ee 
								
							 
						 
						
							
							
								
								Add new Pass infrastructure and some examples  
							
							 
							
							... 
							
							
							
							llvm-svn: 836 
							
						 
						
							2001-10-15 17:31:51 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f0b68888af 
								
							 
						 
						
							
							
								
								Support the invoke instruction  
							
							 
							
							... 
							
							
							
							llvm-svn: 765 
							
						 
						
							2001-10-13 06:52:41 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								da55810666 
								
							 
						 
						
							
							
								
								Commit more code over to new cast style  
							
							 
							
							... 
							
							
							
							llvm-svn: 697 
							
						 
						
							2001-10-02 03:41:24 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3856934386 
								
							 
						 
						
							
							
								
								Convert more code to use new style casts  
							
							 
							
							... 
							
							
							
							Eliminate old style casts from value.h
llvm-svn: 696 
							
						 
						
							2001-10-01 20:11:19 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8f19112923 
								
							 
						 
						
							
							
								
								Add more support for new style casts  
							
							 
							
							... 
							
							
							
							Convert more code to use them
llvm-svn: 695 
							
						 
						
							2001-10-01 18:26:53 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4b717c0edc 
								
							 
						 
						
							
							
								
								Add support for new style casts  
							
							 
							
							... 
							
							
							
							llvm-svn: 694 
							
						 
						
							2001-10-01 16:18:37 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								ba1c1f2fb6 
								
							 
						 
						
							
							
								
								Pull predecessor and successor iterators out of the CFG*.h files, and plop them into  
							
							 
							
							... 
							
							
							
							the BasicBlock class where they should be.  pred_begin/pred_end become methods on BasicBlock,
and the cfg namespace isn't used anymore.
llvm-svn: 691 
							
						 
						
							2001-10-01 13:19:53 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								bb09a10929 
								
							 
						 
						
							
							
								
								Pull iterators out of CFG.h and CFGdecls and put them in Support directory  
							
							 
							
							... 
							
							
							
							llvm-svn: 664 
							
						 
						
							2001-09-28 22:56:31 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b271be3185 
								
							 
						 
						
							
							
								
								ADCE is broken but at least we know why  
							
							 
							
							... 
							
							
							
							llvm-svn: 656 
							
						 
						
							2001-09-28 00:06:42 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								acfd27d502 
								
							 
						 
						
							
							
								
								Make ADCE more robust, it still has problems, but it's getting closer  
							
							 
							
							... 
							
							
							
							llvm-svn: 521 
							
						 
						
							2001-09-09 22:26:47 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d707ec62b6 
								
							 
						 
						
							
							
								
								Types and constants are wierd things in symbol tables now  
							
							 
							
							... 
							
							
							
							llvm-svn: 457 
							
						 
						
							2001-09-07 16:43:50 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								dae05dc937 
								
							 
						 
						
							
							
								
								* Eliminate reference to ConstantPool class  
							
							 
							
							... 
							
							
							
							* Constants are global objects that are not allocated or freed
llvm-svn: 456 
							
						 
						
							2001-09-07 16:43:22 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								6d7bce9f3c 
								
							 
						 
						
							
							
								
								Constants are now global unique objects  
							
							 
							
							... 
							
							
							
							llvm-svn: 454 
							
						 
						
							2001-09-07 16:42:26 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								07e158de3c 
								
							 
						 
						
							
							
								
								* Eliminate constant pool dependancies:  
							
							 
							
							... 
							
							
							
							* Eliminate DoRemoveUnusedConstants
llvm-svn: 453 
							
						 
						
							2001-09-07 16:42:08 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								030772df99 
								
							 
						 
						
							
							
								
								* Supoprt global constants  
							
							 
							
							... 
							
							
							
							* Remove support for local constant pools
* Eliminate constant pool merging method, which is no longer neccesary
* Disable invalid optimization (todo: fix it)
llvm-svn: 452 
							
						 
						
							2001-09-07 16:41:30 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b62b602fe2 
								
							 
						 
						
							
							
								
								Enable the elimination of method prototypes that are not referenced  
							
							 
							
							... 
							
							
							
							llvm-svn: 325 
							
						 
						
							2001-07-28 17:51:49 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								e2472bbf6c 
								
							 
						 
						
							
							
								
								Moved inline/llvm/Tools/* to include/llvm/Support/*  
							
							 
							
							... 
							
							
							
							llvm-svn: 279 
							
						 
						
							2001-07-23 17:46:59 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								3e37ec7c0a 
								
							 
						 
						
							
							
								
								Support external methods  
							
							 
							
							... 
							
							
							
							llvm-svn: 200 
							
						 
						
							2001-07-15 21:43:45 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								5451c9e977 
								
							 
						 
						
							
							
								
								Add knowledge about the struct form of the GetElementPtr instruction  
							
							 
							
							... 
							
							
							
							llvm-svn: 183 
							
						 
						
							2001-07-14 06:11:51 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								5b1200bf8e 
								
							 
						 
						
							
							
								
								Remove dependency on the structure of ValueHolder.  
							
							 
							
							... 
							
							
							
							llvm-svn: 182 
							
						 
						
							2001-07-14 06:11:26 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d6c5a769ea 
								
							 
						 
						
							
							
								
								Don't clean out the type plane of the constant pool... this is a hack.  FIXME  
							
							 
							
							... 
							
							
							
							llvm-svn: 172 
							
						 
						
							2001-07-09 19:38:52 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								31feae8550 
								
							 
						 
						
							
							
								
								Implement checking for new instructions  
							
							 
							
							... 
							
							
							
							llvm-svn: 163 
							
						 
						
							2001-07-08 21:18:49 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								fb8ed0cf3a 
								
							 
						 
						
							
							
								
								Use the CDG to mark branches alive on demand.  
							
							 
							
							... 
							
							
							
							llvm-svn: 159 
							
						 
						
							2001-07-08 18:38:36 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a682182f64 
								
							 
						 
						
							
							
								
								Neg instruction removed.  Cast instruction implemented.  
							
							 
							
							... 
							
							
							
							llvm-svn: 156 
							
						 
						
							2001-07-08 04:57:15 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b1ca9cbceb 
								
							 
						 
						
							
							
								
								Broad superficial changes:  
							
							 
							
							... 
							
							
							
							* Renamed getOpcode to getOpcodeName
* Changed getOpcodeName to return a const char * instead of string
* Added a getOpcode method to replace getInstType
* Changed code to use getOpcode instead of getInstType
llvm-svn: 152 
							
						 
						
							2001-07-07 19:24:15 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								a073acb22d 
								
							 
						 
						
							
							
								
								Changed the fundemental architecture of Operands for Instructions.  Now  
							
							 
							
							... 
							
							
							
							Operands are maintained as a vector<Use> in the User class, and operator
iterators are provided as before.  Getting an operand no longer requires
a virtual function call.
WARNING: getOperand(x) where x >= getNumOperands() will now assert instead
of returning null!
llvm-svn: 149 
							
						 
						
							2001-07-07 08:36:50 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								8024bde7c7 
								
							 
						 
						
							
							
								
								Update to include right file  
							
							 
							
							... 
							
							
							
							llvm-svn: 138 
							
						 
						
							2001-07-06 16:32:07 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b28986ffc7 
								
							 
						 
						
							
							
								
								Initial checkin.  Should print dead instructions, except it doesn't do  
							
							 
							
							... 
							
							
							
							control dependencies.  :(
llvm-svn: 119 
							
						 
						
							2001-06-30 06:39:11 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1960b3c6d2 
								
							 
						 
						
							
							
								
								Rename DoSparseConditionalConstantProp -> DoSCCP  
							
							 
							
							... 
							
							
							
							llvm-svn: 117 
							
						 
						
							2001-06-30 06:37:43 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d42d492734 
								
							 
						 
						
							
							
								
								Optimizations got their own header files  
							
							 
							
							... 
							
							
							
							Optimizations now live in the 'opt' namespace
include/llvm/Opt was renamed include/llvm/Optimizations
llvm-svn: 113 
							
						 
						
							2001-06-30 04:36:40 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7ce8b17e60 
								
							 
						 
						
							
							
								
								Export ConstantFoldTerminator, allow it to fold conditional branches to  
							
							 
							
							... 
							
							
							
							the same label.
llvm-svn: 107 
							
						 
						
							2001-06-29 23:56:58 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								10b250eb4d 
								
							 
						 
						
							
							
								
								Added documentation.  Constant fold terminators.  
							
							 
							
							... 
							
							
							
							llvm-svn: 106 
							
						 
						
							2001-06-29 23:56:23 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								84f07396d3 
								
							 
						 
						
							
							
								
								* Factored RemovePredecessorFromBlock into BasicBlock::removePredecessor  
							
							 
							
							... 
							
							
							
							* Avoid messing around with this case:
  br label %A
%A:  br label %A
* Enable optimizations that are correct now.
llvm-svn: 102 
							
						 
						
							2001-06-29 05:24:28 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								e4abb60948 
								
							 
						 
						
							
							
								
								We need to make sure to remove PHI nodes in the successor that cannot be  
							
							 
							
							... 
							
							
							
							executed when removing branch dest.
llvm-svn: 101 
							
						 
						
							2001-06-29 05:23:10 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4cee8d8ffb 
								
							 
						 
						
							
							
								
								Miscellaneous cleanups:  
							
							 
							
							... 
							
							
							
							* Convert post to pre-increment for for loops
  * Use generic programming more
  * Use new Value::cast* instructions
  * Use new Module, Method, & BasicBlock forwarding methods
  * Use new facilities in STLExtras.h
  * Use new Instruction::isPHINode() method
llvm-svn: 96 
							
						 
						
							2001-06-27 23:41:11 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								347389dae8 
								
							 
						 
						
							
							
								
								Add a new Sparse Conditional Constant Propogation pass  
							
							 
							
							... 
							
							
							
							llvm-svn: 95 
							
						 
						
							2001-06-27 23:38:11 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								1a67fb8860 
								
							 
						 
						
							
							
								
								Misc cleanup  
							
							 
							
							... 
							
							
							
							llvm-svn: 91 
							
						 
						
							2001-06-27 23:36:09 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f222bf33c3 
								
							 
						 
						
							
							
								
								* Expose DoConstantPoolMerging  
							
							 
							
							... 
							
							
							
							* Cleanups (post->pre increment, new cleaner API, etc)
* Moved stuff into ConstantHandling.h
llvm-svn: 90 
							
						 
						
							2001-06-27 23:35:26 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								dbdaaef7d5 
								
							 
						 
						
							
							
								
								Implement induction variable injection!  
							
							 
							
							... 
							
							
							
							llvm-svn: 75 
							
						 
						
							2001-06-25 07:32:19 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								c3a6f546de 
								
							 
						 
						
							
							
								
								A silly stupid test of the loop depth calculator was added.  REMOVE in the  
							
							 
							
							... 
							
							
							
							future.
llvm-svn: 72 
							
						 
						
							2001-06-25 03:55:37 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f64a8936e5 
								
							 
						 
						
							
							
								
								#include a different header due to Intervals.h splitting up  
							
							 
							
							... 
							
							
							
							llvm-svn: 63 
							
						 
						
							2001-06-24 04:05:45 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								4c4f178723 
								
							 
						 
						
							
							
								
								Implement a lot more functionality.  Now loop invariant and linear  
							
							 
							
							... 
							
							
							
							induction variables are correctly identified.
llvm-svn: 57 
							
						 
						
							2001-06-22 02:24:38 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								b20a15d334 
								
							 
						 
						
							
							
								
								Moved printing code to the Assembly/Writer library.  
							
							 
							
							... 
							
							
							
							Code now detects looping intervals
llvm-svn: 52 
							
						 
						
							2001-06-21 05:27:22 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								778de94723 
								
							 
						 
						
							
							
								
								Get rid of a silly printout that isn't needed right now  
							
							 
							
							... 
							
							
							
							llvm-svn: 45 
							
						 
						
							2001-06-20 23:09:39 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								f86e38e452 
								
							 
						 
						
							
							
								
								Add capability to print a derived interval graph  
							
							 
							
							... 
							
							
							
							llvm-svn: 42 
							
						 
						
							2001-06-20 22:44:38 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d286a997d3 
								
							 
						 
						
							
							
								
								Add a test case for interval code  
							
							 
							
							... 
							
							
							
							llvm-svn: 36 
							
						 
						
							2001-06-20 19:27:11 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								5ba5f88c35 
								
							 
						 
						
							
							
								
								Updates to work with new cfg namespace  
							
							 
							
							... 
							
							
							
							llvm-svn: 29 
							
						 
						
							2001-06-13 19:55:22 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								874ddadf72 
								
							 
						 
						
							
							
								
								Updates to support  
							
							 
							
							... 
							
							
							
							* Changes in PHI node structure
llvm-svn: 25 
							
						 
						
							2001-06-11 15:04:40 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								7e0d6e05ac 
								
							 
						 
						
							
							
								
								Updated to work with new CFG.h file.  
							
							 
							
							... 
							
							
							
							llvm-svn: 15 
							
						 
						
							2001-06-07 21:18:45 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								d821c2af37 
								
							 
						 
						
							
							
								
								Significant rework.  DCE is still not done (see #ifdef'd out parts)  
							
							 
							
							... 
							
							
							
							but at least the stuff that is checked in, now works.
llvm-svn: 10 
							
						 
						
							2001-06-07 16:59:26 +00:00  
						
					 
				
					
						
							
							
								 
								Chris Lattner
							
						 
						
							 
							
							
							
							
								
							
							
								2f7c963559 
								
							 
						 
						
							
							
								
								Initial revision  
							
							 
							
							... 
							
							
							
							llvm-svn: 2 
							
						 
						
							2001-06-06 20:29:01 +00:00