aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/MemoryDependenceAnalysis.h
Commit message (Collapse)AuthorAgeFilesLines
* Update aosp/master LLVM for rebase to r235153Pirama Arumuga Nainar2015-05-181-1/+1
| | | | | Change-Id: I9bf53792f9fc30570e81a8d80d296c681d005ea7 (cherry picked from commit 0c7f116bb6950ef819323d855415b2f2b0aad987)
* Update aosp/master llvm for rebase to r233350Pirama Arumuga Nainar2015-04-091-4/+1
| | | | Change-Id: I07d935f8793ee8ec6b7da003f6483046594bca49
* Update aosp/master LLVM for rebase to r230699.Stephen Hines2015-03-231-9/+15
| | | | Change-Id: I2b5be30509658cb8266be782de0ab24f9099f9b9
* Update aosp/master LLVM for rebase to r222494.Stephen Hines2014-12-021-5/+7
| | | | Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d
* Update LLVM for 3.5 rebase (r209712).Stephen Hines2014-05-291-4/+5
| | | | Change-Id: I149556c940fb7dc92d075273c87ff584f400941f
* Update to LLVM 3.5a.Stephen Hines2014-04-241-8/+8
| | | | Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
* Memory Dependence Analysis (not mem-dep test) take advantage of ↵Shuxin Yang2013-03-061-2/+5
| | | | | | | | | | | | | | | | | "invariant.load" metadata. The "invariant.load" metadata indicates the memory unit being accessed is immutable. A load annotated with this metadata can be moved across any store. As I am not sure if it is legal to move such loads across barrier/fence, this change dose not allow such transformation. rdar://11311484 Thank Arnold for code review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176562 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing spaces.Jakub Staszak2013-02-091-37/+37
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174791 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix include guards so they exactly match file names.Jakub Staszak2013-01-101-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172025 91177308-0d34-0410-b5e6-96231b3b80d8
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171366 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort the #include lines for the include/... tree with the script.Chandler Carruth2012-12-031-5/+5
| | | | | | | | | | AKA: Recompile *ALL* the source code! This one went much better. No manual edits here. I spot-checked for silliness and grep-checked for really broken edits and everything seemed good. It all still compiles. Yell if you see something that looks goofy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169133 91177308-0d34-0410-b5e6-96231b3b80d8
* Move TargetData to DataLayout.Micah Villmow2012-10-081-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165402 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a documentation typo.Nadav Rotem2012-08-131-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161758 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the capture analysis from MemoryDependencyAnalysis to a more general placeChad Rosier2012-05-141-3/+0
| | | | | | | | | | so that it can be reused in MemCpyOptimizer. This analysis is needed to remove an unnecessary memcpy when returning a struct into a local variable. rdar://11341081 PR12686 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156776 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor capture tracking (which already had a couple flags for whether returnsNick Lewycky2011-11-141-0/+4
| | | | | | | | | | | and stores capture) to permit the caller to see each capture point and decide whether to continue looking. Use this inside memdep to do an analysis that basicaa won't do. This lets us solve another devirtualization case, fixing PR8908! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144580 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance the memdep interface so that users can tell the difference between a ↵Eli Friedman2011-10-131-13/+48
| | | | | | | | | | dependency which cannot be calculated and a path reaching the entry point of the function. This patch introduces isNonFuncLocal, which replaces isUnknown in some cases. Patch by Xiaoyi Guo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141896 91177308-0d34-0410-b5e6-96231b3b80d8
* Add "unknown" results for memdep, which mean "I don't know whether a ↵Eli Friedman2011-06-151-1/+10
| | | | | | dependence for the given instruction exists in the given block". This cleans up all the existing hacks in memdep which represent this concept by returning clobber with various unrelated instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133031 91177308-0d34-0410-b5e6-96231b3b80d8
* teach GVN to widen integer loads when they are overaligned, when doing an Chris Lattner2011-04-281-0/+14
| | | | | | | | | | | | | wider load would allow elimination of subsequent loads, and when the wider load is still a native integer type. This eliminates a ton of loads on various benchmarks involving struct fields, though it is somewhat hobbled by clang not being very aggressive about field alignment. This is yet another step along the way towards resolving PR6627. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130390 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance MemDep: When alias analysis returns a partial alias result,Chris Lattner2011-04-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | return it as a clobber. This allows GVN to do smart things. Enhance GVN to be smart about the case when a small load is clobbered by a larger overlapping load. In this case, forward the value. This allows us to compile stuff like this: int test(void *P) { int tmp = *(unsigned int*)P; return tmp+*((unsigned char*)P+1); } into: _test: ## @test movl (%rdi), %ecx movzbl %ch, %eax addl %ecx, %eax ret which has one load. We already handled the case where the smaller load was from a must-aliased base pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130180 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrite the main DSE loop to be written in terms of reasoningChris Lattner2010-11-301-0/+3
| | | | | | | | | | | | | | | | about pairs of AA::Location's instead of looking for MemDep's "Def" predicate. This is more powerful and general, handling memset/memcpy/store all uniformly, and implementing PR8701 and probably obsoleting parts of memcpyoptimizer. This also fixes an obscure bug with init.trampoline and i8 stores, but I'm not surprised it hasn't been hit yet. Enhancing init.trampoline to carry the size that it stores would allow DSE to be much more aggressive about optimizing them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120406 91177308-0d34-0410-b5e6-96231b3b80d8
* implement PR8576, deleting dead stores with intervening may-alias stores.Chris Lattner2010-11-211-1/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119927 91177308-0d34-0410-b5e6-96231b3b80d8
* Set NonLocalDepInfo's Size field to UnknownSize when invalidatingDan Gohman2010-11-111-1/+1
| | | | | | | it, so that it doesn't appear to be a known size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118748 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance GVN to do more precise alias queries for non-local memoryDan Gohman2010-11-101-10/+5
| | | | | | | | | | | | | | | | references. For example, this allows gvn to eliminate the load in this example: void foo(int n, int* p, int *q) { p[0] = 0; p[1] = 1; if (n) { *q = p[0]; } } git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118714 91177308-0d34-0410-b5e6-96231b3b80d8
* Give NonLocalDepResult a NonLocalDepEntry member, replacingDan Gohman2010-11-101-30/+29
| | | | | | | | indivudal members holding the same data, to clarify the relationship between NonLocalDepResult and NonLocalDepEntry. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118686 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix uninitialized TBAAFlag field values.Dan Gohman2010-09-221-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114591 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach memdep about TBAA tags.Dan Gohman2010-09-221-6/+28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114588 91177308-0d34-0410-b5e6-96231b3b80d8
* Constify.Dan Gohman2010-09-221-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114574 91177308-0d34-0410-b5e6-96231b3b80d8
* Split critical edges as needed for load PRE.Bob Wilson2010-02-161-1/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96378 91177308-0d34-0410-b5e6-96231b3b80d8
* The phi translated pointer can be computed when returning a partially cached ↵Chris Lattner2009-12-221-14/+30
| | | | | | | | | | | result instead of stored. This reduces memdep memory usage, and also eliminates a bunch of weakvh's. This speeds up gvn on gcc.c-torture/20001226-1.c from 23.9s to 8.45s (2.8x) on a different machine than earlier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91885 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance NonLocalDepEntry to keep the per-block phi translated addressChris Lattner2009-12-091-5/+24
| | | | | | | of the query. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90958 91177308-0d34-0410-b5e6-96231b3b80d8
* change NonLocalDepEntry from being a typedef for an std::pair to be itsChris Lattner2009-12-091-1/+21
| | | | | | | own small class. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90956 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch GVN and memdep to use PHITransAddr, which correctly handlesChris Lattner2009-12-091-24/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90926 91177308-0d34-0410-b5e6-96231b3b80d8
* Document that memory use intrinsics may also return Def results.Nick Lewycky2009-12-051-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90651 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance InsertPHITranslatedPointer to be able to return a list of newlyChris Lattner2009-11-281-2/+3
| | | | | | | 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
* Rework InsertPHITranslatedPointer to handle the recursive case, this Chris Lattner2009-11-271-5/+14
| | | | | | | | 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
* teach GVN's load PRE to insert computations of the address in predecessorsChris Lattner2009-11-271-0/+7
| | | | | | | | 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
* Fix phi translation in load PRE to agree with the phi Chris Lattner2009-11-271-0/+7
| | | | | | | | 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
* Fix a typo in a comment.Dan Gohman2009-07-311-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77715 91177308-0d34-0410-b5e6-96231b3b80d8
* now that you can put a PointerIntPair in a SmallPtrSet, remove someChris Lattner2009-03-291-2/+1
| | | | | | | hackish workarounds from memdep git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67971 91177308-0d34-0410-b5e6-96231b3b80d8
* The operator<() and operator>() were reversing their tests. Have the test ↵Bill Wendling2009-01-221-4/+4
| | | | | | the correct way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62745 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement initial support for PHI translation in memdep. This means thatChris Lattner2008-12-151-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | memdep keeps track of how PHIs affect the pointer in dep queries, which allows it to eliminate the load in cases like rle-phi-translate.ll, which basically end up being: BB1: X = load P br BB3 BB2: Y = load Q br BB3 BB3: R = phi [P] [Q] load R turning "load R" into a phi of X/Y. In addition to additional exposed opportunities, this makes memdep safe in many cases that it wasn't before (which is required for load PRE) and also makes it substantially more efficient. For example, consider: bb1: // has many predecessors. P = some_operator() load P In this example, previously memdep would scan all the predecessors of BB1 to see if they had something that would mustalias P. In some cases (e.g. test/Transforms/GVN/rle-must-alias.ll) it would actually find them and end up eliminating something. In many other cases though, it would scan and not find anything useful. MemDep now stops at a block if the pointer is defined in that block and cannot be phi translated to predecessors. This causes it to miss the (rare) cases like rle-must-alias.ll, but makes it faster by not scanning tons of stuff that is unlikely to be useful. For example, this speeds up GVN as a whole from 3.928s to 2.448s (60%)!. IMO, scalar GVN should be enhanced to simplify the rle-must-alias pointer base anyway, which would allow the loads to be eliminated. In the future, this should be enhanced to phi translate through geps and bitcasts as well (as indicated by FIXMEs) making memdep even more powerful. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61022 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach GVN to invalidate some memdep information when it does an RAUWChris Lattner2008-12-091-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | of a pointer. This allows is to catch more equivalencies. For example, the type_lists_compatible_p function used to require two iterations of the gvn pass (!) to delete its 18 redundant loads because the first pass would CSE all the addressing computation cruft, which would unblock the second memdep/gvn passes from recognizing them. This change allows memdep/gvn to catch all 18 when run just once on the function (as is typical :) instead of just 3. On all of 403.gcc, this bumps up the # reundandancies found from: 63 gvn - Number of instructions PRE'd 153991 gvn - Number of instructions deleted 50069 gvn - Number of loads deleted to: 63 gvn - Number of instructions PRE'd 154137 gvn - Number of instructions deleted 50185 gvn - Number of loads deleted +120 loads deleted isn't bad. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60799 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach BasicAA::getModRefInfo(CallSite, CallSite) someChris Lattner2008-12-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | tricks based on readnone/readonly functions. Teach memdep to look past readonly calls when analyzing deps for a readonly call. This allows elimination of a few more calls from 403.gcc: before: 63 gvn - Number of instructions PRE'd 153986 gvn - Number of instructions deleted 50069 gvn - Number of loads deleted after: 63 gvn - Number of instructions PRE'd 153991 gvn - Number of instructions deleted 50069 gvn - Number of loads deleted 5 calls isn't much, but this adds plumbing for the next change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60794 91177308-0d34-0410-b5e6-96231b3b80d8
* rename getNonLocalDependency -> getNonLocalCallDependency, and removeChris Lattner2008-12-091-3/+3
| | | | | | | pointer stuff from it, simplifying the code a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60783 91177308-0d34-0410-b5e6-96231b3b80d8
* rename getNonLocalPointerDepInternal -> getNonLocalPointerDepFromBBChris Lattner2008-12-091-6/+10
| | | | | | | | and split its inner loop out into a new GetNonLocalInfoForBlock function. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60751 91177308-0d34-0410-b5e6-96231b3b80d8
* use hte new pred cache to speed up the new non-local memdepChris Lattner2008-12-091-10/+7
| | | | | | | | queries. This speeds up GVN using the new queries (not yet checked in) by just over 10%. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60743 91177308-0d34-0410-b5e6-96231b3b80d8
* add another level of caching for non-local pointer queries, keepingChris Lattner2008-12-081-1/+2
| | | | | | | | | | | track of whether the CachedNonLocalPointerInfo for a block is specific to a block. If so, just return it without any pred scanning. This is good for a 6% speedup on GVN (when it uses this lookup method, which it doesn't right now). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60695 91177308-0d34-0410-b5e6-96231b3b80d8
* Use bool instead of int, now that it no longer evokes a warning.Dan Gohman2008-12-071-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60678 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a typo duncan noticed!Chris Lattner2008-12-071-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60671 91177308-0d34-0410-b5e6-96231b3b80d8
* add support for caching pointer dependence queries. Nothing uses this yetChris Lattner2008-12-071-8/+22
| | | | | | | so it "can't" break anything. That said, it does appear to work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60654 91177308-0d34-0410-b5e6-96231b3b80d8