aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* reenable load address insertion in load pre. This allows us toChris Lattner2009-11-282-25/+33
| | | | | | | | | | | | | | | handle cases like this: void test(int N, double* G) { long j; for (j = 1; j < N - 1; j++) G[j+1] = G[j] + G[j+1]; } where G[1] isn't live into the loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90041 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance InsertPHITranslatedPointer to be able to return a list of newlyChris Lattner2009-11-283-13/+19
| | | | | | | inserted instructions. No functionality change until someone starts using it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90039 91177308-0d34-0410-b5e6-96231b3b80d8
* implement a FIXME: limit the depth that DecomposeGEPExpression goes the sameChris Lattner2009-11-282-4/+26
| | | | | | | | | | | way that getUnderlyingObject does it. This fixes the 'DecomposeGEPExpression and getUnderlyingObject disagree!' assertion on sqlite3. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90038 91177308-0d34-0410-b5e6-96231b3b80d8
* enable code to handle un-phi-translatable cases more aggressively:Chris Lattner2009-11-281-3/+0
| | | | | | | | | | | | | | | | | | if we don't have an address expression available in a predecessor, then model this as the value being clobbered at the end of the pred block instead of being modeled as a complete phi translation failure. This is important for PRE of loads because we want to see that the load is available in all but this predecessor, and complete phi translation failure results in not getting any information about predecessors. This doesn't do anything until I renable code insertion since PRE now sees that it is available in all but one predecessors, but can't insert the addressing in the predecessor that is missing it to eliminate the redundancy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90037 91177308-0d34-0410-b5e6-96231b3b80d8
* disable value insertion for now, I need to figure out howChris Lattner2009-11-273-14/+79
| | | | | | | | to inform GVN about the newly inserted values. This fixes PR5631. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90022 91177308-0d34-0410-b5e6-96231b3b80d8
* Rework InsertPHITranslatedPointer to handle the recursive case, this Chris Lattner2009-11-273-58/+112
| | | | | | | | fixes PR5630 and sets the stage for the next phase of goodness (testcase pending). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90019 91177308-0d34-0410-b5e6-96231b3b80d8
* recursively phi translate bitcast operands too, for consistency.Chris Lattner2009-11-271-21/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90016 91177308-0d34-0410-b5e6-96231b3b80d8
* 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