summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* change NonLocalDepEntry from being a typedef for an std::pair to be itsChris Lattner2009-12-091-53/+53
| | | | | | own small class. No functionality change. llvm-svn: 90956
* Switch GVN and memdep to use PHITransAddr, which correctly handlesChris Lattner2009-12-091-303/+34
| | | | | | | | | | | | | | | | | | | | | | | phi translation of complex expressions like &A[i+1]. This has the following benefits: 1. The phi translation logic is all contained in its own class with a strong interface and verification that it is self consistent. 2. The logic is more correct than before. Previously, if intermediate expressions got PHI translated, we'd miss the update and scan for the wrong pointers in predecessor blocks. @phi_trans2 is a testcase for this. 3. We have a lot less code in memdep. We can handle phi translation across blocks of things like @phi_trans3, which is pretty insane :). This patch should fix the miscompiles of 255.vortex, and I tested it with a bootstrap of llvm-gcc, llvm-test and dejagnu of course. llvm-svn: 90926
* Fix indentation in switch statement.Nick Lewycky2009-12-051-15/+16
| | | | llvm-svn: 90650
* Silence compiler warnings.Benjamin Kramer2009-12-021-2/+2
| | | | llvm-svn: 90319
* Cleanup/remove some parts of the lifetime region handling code in memdep and ↵Owen Anderson2009-12-021-16/+13
| | | | | | | | GVN, per Chris' comments. Adjust testcases to match. llvm-svn: 90304
* rename some variables.Chris Lattner2009-12-011-13/+13
| | | | llvm-svn: 90258
* tidyChris Lattner2009-12-011-1/+3
| | | | llvm-svn: 90257
* fix 255.vortex again, third time's the charm.Chris Lattner2009-12-011-2/+35
| | | | llvm-svn: 90217
* Revert r90107, fixing test/Transforms/GVN/2009-11-29-ReverseMap.ll and theNick Lewycky2009-11-301-15/+2
| | | | | | llvm-gcc build. llvm-svn: 90113
* reapply r90093 with an addition of keeping the forwardChris Lattner2009-11-301-2/+15
| | | | | | | and reverse nonlocal memdep maps in synch, this should fix 255.vortex. llvm-svn: 90107
* revert this patch for now, it causes failures of:Chris Lattner2009-11-291-12/+2
| | | | | | | LLVM::Transforms/GVN/2009-02-17-LoadPRECrash.ll LLVM::Transforms/GVN/2009-06-17-InvalidPRE.ll llvm-svn: 90096
* Fix a really nasty caching bug I introduced in memdep. An entryChris Lattner2009-11-291-2/+12
| | | | | | | | | | | | was being added to the Result vector, but not being put in the cache. This means that if the cache was reused wholesale for a later query that it would be missing this entry and we'd do an incorrect load elimination. Unfortunately, it's not really possible to write a useful testcase for this, but this unbreaks 255.vortex. llvm-svn: 90093
* Detabify.Nick Lewycky2009-11-291-1/+1
| | | | llvm-svn: 90085
* Teach memdep to look for memory use intrinsics during dependency queries. FixesNick Lewycky2009-11-281-9/+30
| | | | | | PR5574. llvm-svn: 90045
* Enhance InsertPHITranslatedPointer to be able to return a list of newlyChris Lattner2009-11-281-10/+13
| | | | | | inserted instructions. No functionality change until someone starts using it. llvm-svn: 90039
* 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. llvm-svn: 90037
* Rework InsertPHITranslatedPointer to handle the recursive case, this Chris Lattner2009-11-271-29/+84
| | | | | | | fixes PR5630 and sets the stage for the next phase of goodness (testcase pending). llvm-svn: 90019
* recursively phi translate bitcast operands too, for consistency.Chris Lattner2009-11-271-21/+18
| | | | llvm-svn: 90016
* add support for recursive phi translation and phi Chris Lattner2009-11-271-10/+67
| | | | | | | | | | | | | | | | 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. llvm-svn: 90013
* add comment.Chris Lattner2009-11-271-1/+5
| | | | llvm-svn: 90002
* reduce nesting, no functionality change.Chris Lattner2009-11-271-50/+51
| | | | llvm-svn: 90001
* teach GVN's load PRE to insert computations of the address in predecessorsChris Lattner2009-11-271-5/+67
| | | | | | | where it is not available. It's unclear how to get this inserted computation into GVN's scalar availability sets, Owen, help? :) llvm-svn: 89997
* Fix phi translation in load PRE to agree with the phi Chris Lattner2009-11-271-4/+10
| | | | | | | translation done by memdep, and reenable gep translation again. llvm-svn: 89992
* redisable this, my bootstrap worked because it wasn't an optimized build, ↵Chris Lattner2009-11-271-0/+1
| | | | | | whoops. llvm-svn: 89991
* try again.Chris Lattner2009-11-271-7/+6
| | | | llvm-svn: 89990
* this is causing buildbot failures, disable for now.Chris Lattner2009-11-271-0/+1
| | | | llvm-svn: 89985
* teach phi translation of GEPs to simplify geps like 'gep x, 0'.Chris Lattner2009-11-271-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 89981
* teach memdep to do trivial PHI translation of GEPs. More toChris Lattner2009-11-271-1/+42
| | | | | | come. llvm-svn: 89979
* Teach memdep to phi translate bitcasts. This allows us to compileChris Lattner2009-11-261-3/+27
| | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 89978
* factor some code out into some helper functions.Chris Lattner2009-11-261-10/+36
| | | | llvm-svn: 89975
* Remove dead code. While there, also turn a few 'T* ' into 'T *' to match theNick Lewycky2009-11-221-8/+4
| | | | | | rest of the file. llvm-svn: 89577
* Treat lifetime begin/end markers as allocations/frees respectively for theOwen Anderson2009-10-281-3/+15
| | | | | | purposes for GVN/DSE. llvm-svn: 85383
* Be more careful about invariance reasoning on "store" queries. Stores still ↵Owen Anderson2009-10-281-6/+9
| | | | | | | | need to depend on Ref and ModRef calls within the invariant region. llvm-svn: 85380
* Add trivial support for the invariance intrinsics to memdep. This logic isOwen Anderson2009-10-281-1/+35
| | | | | | purely local for now. llvm-svn: 85378
* Rename MallocFreeHelper as MemoryBuiltinsVictor Hernandez2009-10-271-1/+1
| | | | llvm-svn: 85286
* Rename MallocHelper as MallocFreeHelper, since it now also identifies calls ↵Victor Hernandez2009-10-261-1/+1
| | | | | | to free() llvm-svn: 85181
* Remove FreeInst.Victor Hernandez2009-10-261-9/+4
| | | | | | | Remove LowerAllocations pass. Update some more passes to treate free calls just like they were treating FreeInst. llvm-svn: 85176
* Auto-upgrade free instructions to calls to the builtin free function.Victor Hernandez2009-10-241-0/+8
| | | | | | | Update all analysis passes and transforms to treat free calls just like FreeInst. Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised. llvm-svn: 84987
* Remove AllocationInst. Since MallocInst went away, AllocaInst is the only ↵Victor Hernandez2009-10-231-1/+1
| | | | | | subclass of AllocationInst, so it no longer is necessary. llvm-svn: 84969
* Memory dependence analysis was incorrectly stopping to scan for stores to a ↵Victor Hernandez2009-10-131-10/+5
| | | | | | | | pointer at bitcast uses of a malloc call. It should continue scanning until the malloc call, and this patch fixes that. llvm-svn: 83931
* Revert r82404, it is causing a bootstrap miscompile. This is very very Chris Lattner2009-09-201-14/+1
| | | | | | scary, as it indicates a lurking bug. yay. llvm-svn: 82411
* improve memdep to eliminate bitcasts (and aliases, and noop geps) Chris Lattner2009-09-201-1/+14
| | | | | | | early for the stated reasons: this allows it to find more equivalences and depend less on code layout. llvm-svn: 82404
* Enhance analysis passes so that they apply the same analysis to malloc calls ↵Victor Hernandez2009-09-181-0/+10
| | | | | | | | as to MallocInst. Reviewed by Eli Friedman. llvm-svn: 82281
* Make TargetData optional in MemoryDependenceAnalysis.Dan Gohman2009-07-311-10/+7
| | | | llvm-svn: 77727
* Remove an unnecessary header.Dan Gohman2009-07-311-1/+0
| | | | llvm-svn: 77725
* factor the 'optimized sort' code out into a static helper functionChris Lattner2009-07-131-28/+38
| | | | | | and use it from one more place. Patch by Jakub Staszak! llvm-svn: 75478
* Move the re-sort of invalidated NonLocalPointerDeps cache earlierChris Lattner2009-07-131-14/+14
| | | | | | | | | | | so that all code paths get it. PR4256 was about a case where the phi translation loop would find all preds in the Visited cache, so it could get by without re-sorting the NonLocalPointerDeps cache. Fix this by resorting it earlier, there is no reason not to do this. This patch inspired by Jakub Staszak's patch. llvm-svn: 75476
* make memdep use the getModRefInfo method for stores instead of theChris Lattner2009-05-251-1/+9
| | | | | | | low-level alias() method, allowing it to reason more aggressively about pointers into constant memory. PR4189 llvm-svn: 72403
* now that you can put a PointerIntPair in a SmallPtrSet, remove someChris Lattner2009-03-291-17/+15
| | | | | | hackish workarounds from memdep llvm-svn: 67971
* Debug intriniscs should be skipped when lookingDale Johannesen2009-03-111-1/+1
| | | | | | for a dependency, not terminate the search. llvm-svn: 66709
OpenPOWER on IntegriCloud