aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Oops! Fix bug introduced in my recent cleanup change. Thanks to Tobias GrosserNick Lewycky2009-11-271-1/+1
| | | | | | | for pointing this out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90015 91177308-0d34-0410-b5e6-96231b3b80d8
* I accidentally implemented this :)Chris Lattner2009-11-271-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90014 91177308-0d34-0410-b5e6-96231b3b80d8
* add support for recursive phi translation and phi Chris Lattner2009-11-272-10/+110
| | | | | | | | | | | | | | | | | | translation of add with immediate. This allows us to optimize this function: void test(int N, double* G) { long j; G[1] = 1; for (j = 1; j < N - 1; j++) G[j+1] = G[j] + G[j+1]; } to only do one load every iteration of the loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90013 91177308-0d34-0410-b5e6-96231b3b80d8
* add two simple test cases we now optimize (to one load in the loop each) and ↵Chris Lattner2009-11-271-0/+121
| | | | | | one we don't (corresponding to the fixme I added yesterday). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90012 91177308-0d34-0410-b5e6-96231b3b80d8
* factor some logic out of instcombine into a new SimplifyAddInst method.Chris Lattner2009-11-273-17/+47
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90011 91177308-0d34-0410-b5e6-96231b3b80d8
* add a deadargelim note.Chris Lattner2009-11-271-0/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90009 91177308-0d34-0410-b5e6-96231b3b80d8
* This testcase is actually only partially redundant, and requiresChris Lattner2009-11-271-2/+2
| | | | | | | the FIXME I added yesterday to be implemented. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90008 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR5436 by making the 'simple' case of SRoA not promote out of range Chris Lattner2009-11-272-10/+68
| | | | | | | | | | | array indexes. The "complex" case of SRoA still handles them, and correctly. This fixes a weirdness where we'd correctly avoid transforming A[0][42] if the 42 was too large, but we'd only do it if it was one gep, not two separate ones. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90007 91177308-0d34-0410-b5e6-96231b3b80d8
* filecheckizeChris Lattner2009-11-271-5/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90006 91177308-0d34-0410-b5e6-96231b3b80d8
* While this test is testing a problem in the generic part of codegen,Duncan Sands2009-11-272-1/+36
| | | | | | | | | | the problem only shows for msp430 and pic16 which is why it specifies them using -march. But it is wrong to put such tests in CodeGen/Generic, since not everyone builds these targets. Put a copy of the test in each of the target test directories. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90005 91177308-0d34-0410-b5e6-96231b3b80d8
* Vector types are no longer required to have a power-of-two length.Duncan Sands2009-11-271-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90004 91177308-0d34-0410-b5e6-96231b3b80d8
* These code generator limitations have been removed.Duncan Sands2009-11-271-28/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90003 91177308-0d34-0410-b5e6-96231b3b80d8
* add comment.Chris Lattner2009-11-271-1/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90002 91177308-0d34-0410-b5e6-96231b3b80d8
* reduce nesting, no functionality change.Chris Lattner2009-11-271-50/+51
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90001 91177308-0d34-0410-b5e6-96231b3b80d8
* limit the recursion depth of GetLinearExpression. ThisChris Lattner2009-11-271-6/+13
| | | | | | | | fixes a crash analyzing consumer-lame, which had an "%X = add %X, 1" in unreachable code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90000 91177308-0d34-0410-b5e6-96231b3b80d8
* teach GVN's load PRE to insert computations of the address in predecessorsChris Lattner2009-11-274-23/+134
| | | | | | | | where it is not available. It's unclear how to get this inserted computation into GVN's scalar availability sets, Owen, help? :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89997 91177308-0d34-0410-b5e6-96231b3b80d8
* add some tests for memdep phi translation + PRE.Chris Lattner2009-11-271-2/+53
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89996 91177308-0d34-0410-b5e6-96231b3b80d8
* this test is failing, and is expected to.Chris Lattner2009-11-271-1/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89995 91177308-0d34-0410-b5e6-96231b3b80d8
* filecheckizeChris Lattner2009-11-271-2/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89994 91177308-0d34-0410-b5e6-96231b3b80d8
* rename test.Chris Lattner2009-11-271-0/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89993 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix phi translation in load PRE to agree with the phi Chris Lattner2009-11-274-12/+31
| | | | | | | | translation done by memdep, and reenable gep translation again. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89992 91177308-0d34-0410-b5e6-96231b3b80d8
* redisable this, my bootstrap worked because it wasn't an optimized build, ↵Chris Lattner2009-11-272-6/+7
| | | | | | whoops. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89991 91177308-0d34-0410-b5e6-96231b3b80d8
* try again.Chris Lattner2009-11-272-13/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89990 91177308-0d34-0410-b5e6-96231b3b80d8
* this is causing buildbot failures, disable for now.Chris Lattner2009-11-272-6/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89985 91177308-0d34-0410-b5e6-96231b3b80d8
* this (and probably several others) are now done.Chris Lattner2009-11-271-33/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89982 91177308-0d34-0410-b5e6-96231b3b80d8
* teach phi translation of GEPs to simplify geps like 'gep x, 0'.Chris Lattner2009-11-272-3/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to compile the example from PR5313 into: LBB1_2: ## %bb incl %ecx movb %al, (%rsi) movslq %ecx, %rax movb (%rdi,%rax), %al testb %al, %al jne LBB1_2 instead of: LBB1_2: ## %bb movslq %eax, %rcx incl %eax movb (%rdi,%rcx), %cl movb %cl, (%rsi) movslq %eax, %rcx cmpb $0, (%rdi,%rcx) jne LBB1_2 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89981 91177308-0d34-0410-b5e6-96231b3b80d8
* factor some instcombine simplifications for getelementptr out to a new Chris Lattner2009-11-273-10/+46
| | | | | | | SimplifyGEPInst method in InstructionSimplify.h. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89980 91177308-0d34-0410-b5e6-96231b3b80d8
* teach memdep to do trivial PHI translation of GEPs. More toChris Lattner2009-11-272-2/+69
| | | | | | | come. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89979 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach memdep to phi translate bitcasts. This allows us to compileChris Lattner2009-11-263-5/+53
| | | | | | | | | | | | | | | | | | | | | | | | | the example in GCC PR16799 to: LBB1_2: ## %bb1 movl %eax, %eax subq %rax, %rdi movq %rdi, (%rcx) movl (%rdi), %eax testl %eax, %eax je LBB1_2 instead of: LBB1_2: ## %bb1 movl (%rdi), %ecx subq %rcx, %rdi movq %rdi, (%rax) cmpl $0, (%rdi) je LBB1_2 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89978 91177308-0d34-0410-b5e6-96231b3b80d8
* convert to filecheckChris Lattner2009-11-261-15/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89977 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo spotted by Gabor Greif.Nick Lewycky2009-11-261-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89976 91177308-0d34-0410-b5e6-96231b3b80d8
* factor some code out into some helper functions.Chris Lattner2009-11-261-10/+36
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89975 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up file, no functionality change.Nick Lewycky2009-11-261-24/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89974 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a hack for PR5601, a crash on obsolete syntax that we plan toChris Lattner2009-11-261-0/+4
| | | | | | | remove in LLVM 3.0 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89973 91177308-0d34-0410-b5e6-96231b3b80d8
* fix crash on Transforms/InstCombine/intrinsics.ll introduced by r89970 Chris Lattner2009-11-261-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89972 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR5471 by removing an instcombine xform. Some pieces of the codeChris Lattner2009-11-263-6/+13
| | | | | | | | | generates store to undef and some generates store to null as the idiom for undefined behavior. Since simplifycfg zaps both, don't remove the undefined behavior in instcombine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89971 91177308-0d34-0410-b5e6-96231b3b80d8
* implement a bunch of xforms for overflow intrinsics, based on a patchChris Lattner2009-11-261-0/+114
| | | | | | | | by Alastair Lynn. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89970 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename new TailDuplicationPass to avoid name conflict with the old one.Bob Wilson2009-11-263-14/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89968 91177308-0d34-0410-b5e6-96231b3b80d8
* @test9 is a testcase for r89958. Before 89958, we misanalyzed theChris Lattner2009-11-261-1/+39
| | | | | | | | | | | first expression as P+4+4*i which we considered to possibly alias P+4*j. Now we correctly analyze the former one as P+1+4*i. @test10 is a sanity test that verfies that we know that P+4+4*i != P+4*i. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89960 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement PR1143 (at -m64) by making basicaa look through extensions. WeChris Lattner2009-11-263-3/+45
| | | | | | | | previously already handled it at -m32 because there were no i32->i64 extensions for addressing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89959 91177308-0d34-0410-b5e6-96231b3b80d8
* fix two transposed lines duncan caught and add an explanatory comment.Chris Lattner2009-11-261-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89958 91177308-0d34-0410-b5e6-96231b3b80d8
* this todo is resolved.Chris Lattner2009-11-261-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89957 91177308-0d34-0410-b5e6-96231b3b80d8
* move DecomposeGEPExpression out into ValueTracking.cppChris Lattner2009-11-263-158/+170
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89956 91177308-0d34-0410-b5e6-96231b3b80d8
* teach GetLinearExpression to be a bit more aggressive.Chris Lattner2009-11-262-1/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89955 91177308-0d34-0410-b5e6-96231b3b80d8
* resolve a fixme. I haven't figured out how to write a testcaseChris Lattner2009-11-261-5/+4
| | | | | | | to exercise this though. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89954 91177308-0d34-0410-b5e6-96231b3b80d8
* update status of this. basicaa is much improved now,Chris Lattner2009-11-261-2/+2
| | | | | | | | | only missing the one form (in this testcase). Dan, do you consider this example to be important? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89953 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach basicaa that x|c == x+c when the c bits of x are clear. ThisChris Lattner2009-11-263-22/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | allows us to compile the example in readme.txt into: LBB1_1: ## %bb movl 4(%rdx,%rax), %ecx movl %ecx, %esi imull (%rdx,%rax), %esi imull %esi, %ecx movl %esi, 8(%rdx,%rax) imull %ecx, %esi movl %ecx, 12(%rdx,%rax) movl %esi, 16(%rdx,%rax) imull %ecx, %esi movl %esi, 20(%rdx,%rax) addq $16, %rax cmpq $4000, %rax jne LBB1_1 instead of: LBB1_1: movl (%rdx,%rax), %ecx imull 4(%rdx,%rax), %ecx movl %ecx, 8(%rdx,%rax) imull 4(%rdx,%rax), %ecx movl %ecx, 12(%rdx,%rax) imull 8(%rdx,%rax), %ecx movl %ecx, 16(%rdx,%rax) imull 12(%rdx,%rax), %ecx movl %ecx, 20(%rdx,%rax) addq $16, %rax cmpq $4000, %rax jne LBB1_1 GCC (4.2) doesn't seem to be able to eliminate the loads in this testcase either, it generates: L2: movl (%rdx), %eax imull 4(%rdx), %eax movl %eax, 8(%rdx) imull 4(%rdx), %eax movl %eax, 12(%rdx) imull 8(%rdx), %eax movl %eax, 16(%rdx) imull 12(%rdx), %eax movl %eax, 20(%rdx) addl $4, %ecx addq $16, %rdx cmpl $1002, %ecx jne L2 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89952 91177308-0d34-0410-b5e6-96231b3b80d8
* teach basicaa that A[i] != A[i+1].Chris Lattner2009-11-263-2/+48
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89951 91177308-0d34-0410-b5e6-96231b3b80d8
* rename testChris Lattner2009-11-261-0/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89950 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the other half of aliasGEP (which handles GEP differencing) to use ↵Chris Lattner2009-11-262-468/+167
| | | | | | DecomposeGEPExpression. This dramatically simplifies and shrinks the code by eliminating the horrible CheckGEPInstructions method, fixes a miscompilation (@test3) and makes the code more aggressive. In particular, we now handle the @test4 case, which is reduced from the SmallPtrSet constructor. Missing this caused us to emit a variable length memset instead of a fixed size one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89922 91177308-0d34-0410-b5e6-96231b3b80d8