summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Reimplement the non-local dependency data structure in terms of a sortedChris Lattner2008-12-011-50/+82
| | | | | | | | | | | | | | | | | | | vector instead of a densemap. This shrinks the memory usage of this thing substantially (the high water mark) as well as making operations like scanning it faster. This speeds up memdep slightly, gvn goes from 3.9376 to 3.9118s on 403.gcc This also splits out the statistics for the cached non-local case to differentiate between the dirty and clean cached case. Here's the stats for 403.gcc: 6153 memdep - Number of dirty cached non-local responses 169336 memdep - Number of fully cached non-local responses 162428 memdep - Number of uncached non-local responses yay for caching :) llvm-svn: 60313
* Eliminate the DepResultTy abstraction. It is now completely Chris Lattner2008-11-301-48/+43
| | | | | | redundant with MemDepResult, and MemDepResult has a nicer interface. llvm-svn: 60308
* Cache TargetData/AliasAnalysis in the pass instead of callingChris Lattner2008-11-301-18/+18
| | | | | | | getAnalysis<>. getAnalysis<> is apparently extremely expensive. Doing this speeds up GVN on 403.gcc by 16%! llvm-svn: 60304
* Two changes: Make getDependency remove QueryInst for a dirty record'sChris Lattner2008-11-301-18/+26
| | | | | | | | | | | ReverseLocalDeps when we update it. This fixes a regression test failure from my last commit. Second, for each non-local cached information structure, keep a bit that indicates whether it is dirty or not. This saves us a scan over the whole thing in the common case when it isn't dirty. llvm-svn: 60274
* introduce a typedef, no functionality change.Chris Lattner2008-11-301-16/+15
| | | | llvm-svn: 60272
* Change NonLocalDeps to be a densemap of pointers to densemapChris Lattner2008-11-301-30/+52
| | | | | | | | | | | | instead of containing them by value. This increases the density (!) of NonLocalDeps as well as making the reallocation case faster. This speeds up gvn on 403.gcc by 2% and makes room for future improvements. I'm not super thrilled with having to explicitly manage the new/delete of the map, but it is necesary for the next change. llvm-svn: 60271
* calls never depend on allocations.Chris Lattner2008-11-301-12/+5
| | | | llvm-svn: 60268
* Fix a fixme by making memdep's handling of allocations more logical.Chris Lattner2008-11-301-20/+10
| | | | | | | | If we see that a load depends on the allocation of its memory with no intervening stores, we now return a 'None' depedency instead of "Normal". This tweaks GVN to do its optimization with the new result. llvm-svn: 60267
* implement a fixme by introducing a new getDependencyFromInternalChris Lattner2008-11-301-24/+19
| | | | | | | method that returns its result as a DepResultTy instead of as a MemDepResult. This reduces conversion back and forth. llvm-svn: 60266
* Move the getNonLocalDependency method to a more logical place inChris Lattner2008-11-301-90/+89
| | | | | | the file, no functionality change. llvm-svn: 60265
* REmove an old fixme, resolve another fixme by adding liberalChris Lattner2008-11-301-2/+0
| | | | | | comments about what this class does. llvm-svn: 60264
* remove a bit of incorrect code that tried to be tricky about speeding up Chris Lattner2008-11-301-49/+24
| | | | | | | | | | | | | | | | | | | | | | | | | dependencies. The basic situation was this: consider if we had: store1 ... store2 ... store3 Where memdep thinks that store3 depends on store2 and store2 depends on store1. The problem happens when we delete store2: The code in question was updating dep info for store3 to be store1. This is a spiffy optimization, but is not safe at all, because aliasing isn't transitive. This bug isn't exposed today with DSE because DSE will only zap store2 if it is identifical to store 3, and in this case, it is safe to update it to depend on store1. However, memcpyopt is not so fortunate, which is presumably why the "dropInstruction" code used to exist. Since this doesn't actually provide a speedup in practice, just rip the code out. llvm-svn: 60263
* Eliminate the dropInstruction method, which is not needed any more.Chris Lattner2008-11-291-77/+33
| | | | | | Fix a subtle iterator invalidation bug I introduced in the last commit. llvm-svn: 60258
* implement some fixme's: when deleting an instruction withChris Lattner2008-11-291-14/+62
| | | | | | | | | | | | | an entry in the nonlocal deps map, don't reset entries referencing that instruction to [dirty, null], instead, set them to [dirty,next] where next is the instruction after the deleted one. Use this information in the non-local deps code to avoid rescanning entire blocks. This speeds up GVN slightly by avoiding pointless work. On 403.gcc this makes GVN 1.5% faster. llvm-svn: 60256
* Change MemDep::getNonLocalDependency to return its results asChris Lattner2008-11-291-7/+6
| | | | | | | a smallvector instead of a DenseMap. This speeds up GVN by 5% on 403.gcc. llvm-svn: 60255
* move MemoryDependenceAnalysis::verifyRemoved to the end of the file,Chris Lattner2008-11-291-32/+32
| | | | | | no functionality/code change. llvm-svn: 60254
* reimplement getNonLocalDependency with a simpler worklistChris Lattner2008-11-291-136/+73
| | | | | | | formulation that is faster and doesn't require nonLazyHelper. Much less code. llvm-svn: 60253
* rename some maps.Chris Lattner2008-11-291-35/+35
| | | | llvm-svn: 60242
* rename some variables.Chris Lattner2008-11-291-21/+21
| | | | llvm-svn: 60241
* eliminate a bunch of code in favor of using AliasAnalysis::getModRefInfo.Chris Lattner2008-11-291-47/+45
| | | | | | | Put a some code back to handle buggy behavior that GVN expects: it wants loads to depend on each other, and accesses to depend on their allocations. llvm-svn: 60240
* simplify some code and rename some variables. Reduce nesting.Chris Lattner2008-11-291-64/+64
| | | | | | | Use getTypeStoreSize instead of ABITypeSize for in-memory size in a couple places. llvm-svn: 60238
* Split getDependency into getDependency and getDependencyFrom, the Chris Lattner2008-11-291-124/+80
| | | | | | | former does caching, the later doesn't. This dramatically simplifies the logic in getDependency and getDependencyFrom. llvm-svn: 60234
* Now that DepType is private, we can start cleaning up some of its uses:Chris Lattner2008-11-291-73/+61
| | | | | | | | | | | | | | Document the Dirty value more precisely, use it for the uninitialized DepResultTy value. Change reverse mappings to be from an instruction* instead of DepResultTy, and stop tracking other forms. This makes it more clear that we only care about the instruction cases. Eliminate a DepResultTy,bool pair by using Dirty in the local case as well, shrinking the map and simplifying the code. This speeds up GVN by ~3% on 403.gcc. llvm-svn: 60232
* Introduce and use a new MemDepResult class to hold the results of a memdepChris Lattner2008-11-291-41/+40
| | | | | | | | | | | query. This makes it crystal clear what cases can escape from MemDep that the clients have to handle. This also gives the clients a nice simplified interface to it that is easy to poke at. This patch also makes DepResultTy and MemoryDependenceAnalysis::DepType private, yay. llvm-svn: 60231
* Reimplement the internal abstraction used by MemDep in termsChris Lattner2008-11-291-114/+110
| | | | | | | | | | | | | | | of a pointer/int pair instead of a manually bitmangled pointer. This forces clients to think a little more about checking the appropriate pieces and will be useful for internal implementation improvements later. I'm not particularly happy with this. After going through this I don't think that the clients of memdep should be exposed to the internal type at all. I'll fix this in a subsequent commit. This has no functionality change. llvm-svn: 60230
* Fix PR3141 by ensuring that MemoryDependenceAnalysis::removeInstructionChris Lattner2008-11-281-12/+28
| | | | | | | properly updates the reverse dependency map when it installs updated dependencies for instructions that depend on the removed instruction. llvm-svn: 60222
* more cleanups for MemoryDependenceAnalysis::removeInstruction,Chris Lattner2008-11-281-38/+42
| | | | | | no functionality change. llvm-svn: 60219
* random cleanups, no functionality change.Chris Lattner2008-11-281-29/+28
| | | | llvm-svn: 60218
* Run verifyRemoved from removeInstruction when -debug is specified.Chris Lattner2008-11-281-10/+14
| | | | | | This shows the root problem behind PR3141. llvm-svn: 60216
* rename "ping" to "verifyRemoved". I don't know why 'ping' what chosen,Chris Lattner2008-11-281-12/+13
| | | | | | | | but it doesn't make any sense at all. Also make the method const, private, and fit in 80 cols while we're at it. llvm-svn: 60215
* remove mysterious escaped newlines.Chris Lattner2008-11-281-5/+5
| | | | llvm-svn: 60211
* Fix comment typo.Duncan Sands2008-09-111-1/+1
| | | | llvm-svn: 56116
* Fix a subtle bug when removing instructions from memdep. In very specific Owen Anderson2008-07-281-0/+4
| | | | | | | | circumstances we could end up remapping a dependee to the same instruction that we're trying to remove. Handle this properly by just falling back to a conservative solution. llvm-svn: 54132
* A better fix for PR2503 that doesn't pessimize GVN in the presence of ↵Owen Anderson2008-07-021-13/+0
| | | | | | unreachable blocks. llvm-svn: 53032
* Properly handle cases where a predecessor of the block being queried on is ↵Owen Anderson2008-07-011-0/+13
| | | | | | | | unreachable. This fixes PR2503, though we should also fix other passes not to emit this kind of code. llvm-svn: 52946
* Remember to update the reverse non-local cache when cleaning up dirty ↵Owen Anderson2008-06-011-0/+5
| | | | | | entries. This fixes PR2397. llvm-svn: 51846
* Make ping more aggressive in finding nonlocal caching errors.Owen Anderson2008-06-011-0/+3
| | | | llvm-svn: 51845
* Fix memdep's handling of invokes when finding the dependency of another callOwen Anderson2008-05-131-1/+1
| | | | | | instruction. This fixes some Ada miscompiles reported in PR2324. llvm-svn: 51069
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-8/+6
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* Make several variable declarations static.Dan Gohman2008-05-061-1/+1
| | | | llvm-svn: 50696
* Make GVN able to remove unnecessary calls to read-only functions again.Owen Anderson2008-04-171-2/+1
| | | | llvm-svn: 49842
* Fix a typo in a comment.Dan Gohman2008-04-101-1/+1
| | | | llvm-svn: 49504
* Fix for PR2190. Memdep's non-local caching was checking dirtied blocks in theOwen Anderson2008-04-101-2/+4
| | | | | | wrong order. llvm-svn: 49499
* Set blockBegin to point to the beginning of the block,Dan Gohman2008-03-311-2/+2
| | | | | | not the end. llvm-svn: 48999
* Restore isCFGOnly property of various analysis passes.Devang Patel2008-03-201-1/+1
| | | | llvm-svn: 48579
* PassInfo keep tracks whether a pass is an analysis pass or not.Devang Patel2008-03-191-1/+1
| | | | llvm-svn: 48554
* Re-apply the patch to improve the optimizations of memcpy's, with severalOwen Anderson2008-02-121-1/+41
| | | | | | bugs fixed. This now passes PPC bootstrap. llvm-svn: 47026
* Throttle the non-local dependence analysis for basic blocks with more than ↵Tanya Lattner2008-02-061-7/+20
| | | | | | 50 predecessors. Added command line option to play with this threshold. llvm-svn: 46790
* Fix an obscure read-after-free bug that Duncan found.Owen Anderson2008-02-051-10/+20
| | | | llvm-svn: 46738
* Fix an issue where, under very specific circumstances, memdep could end up ↵Owen Anderson2008-01-301-2/+2
| | | | | | | | dereferencing the end of one of its internal maps. llvm-svn: 46541
OpenPOWER on IntegriCloud