summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/BasicAliasAnalysis.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Rename PaddedSize to AllocSize, in the hope that thisDuncan Sands2009-05-091-1/+1
| | | | | | | will make it more obvious what it represents, and stop it being confused with the StoreSize. llvm-svn: 71349
* Generalize some alias analysis logic from atomicDuncan Sands2009-02-141-51/+0
| | | | | | intrinsics to any IntrWriteArgMem intrinsics. llvm-svn: 64551
* BasicAA was making the assumption that a local allocation which hadn't escapedNick Lewycky2009-02-131-3/+3
| | | | | | | | couldn't ever be the return of call instruction. However, it's quite possible that said local allocation is itself the return of a function call. That's what malloc and calloc are for, actually. llvm-svn: 64442
* Refactor my previous change to maintain the distinction between ↵Owen Anderson2009-02-051-21/+52
| | | | | | | | AliasAnalysis and BasicAliasAnalysis. This involves some wider changes because it folds away some never-used methods. llvm-svn: 63900
* Finish making AliasAnalysis aware of the fact that most atomic intrinsics ↵Owen Anderson2009-02-041-0/+16
| | | | | | | | only dereference their arguments, and enhance BasicAA to make use of this fact when computing ModRef info. llvm-svn: 63718
* Move isIdentifiedObject and isNoAliasCall into AliasAnalysis.cpp sinceDan Gohman2009-02-031-24/+0
| | | | | | | | they are useful to analyses other than BasicAliasAnalysis.cpp. Include the full comment for isIdentifiedObject in the header file. Thanks to Chris for suggeseting this. llvm-svn: 63589
* Fix a post-RA scheduling dependency bug.Dan Gohman2009-01-301-1/+1
| | | | | | | | | | | | | | | If a MachineInstr doesn't have a memoperand but has an opcode that is known to load or store, assume its memory reference may alias *anything*, including stack slots which the compiler completely controls. To partially compensate for this, teach the ScheduleDAG building code to do basic getUnderlyingValue analysis. This greatly reduces the number of instructions that require restrictive dependencies. This code will need to be revisited when we start doing real alias analysis, but it should suffice for now. llvm-svn: 63370
* BasicAliasAnalysis and FunctionAttrs were bothDuncan Sands2009-01-181-52/+3
| | | | | | | | | doing very similar pointer capture analysis. Factor out the common logic. The new version is from FunctionAttrs since it does a better job than the version in BasicAliasAnalysis llvm-svn: 62461
* add a commentGabor Greif2009-01-181-0/+1
| | | | llvm-svn: 62436
* Rename getABITypeSize to getTypePaddedSize, asDuncan Sands2009-01-121-1/+1
| | | | | | suggested by Chris. llvm-svn: 62099
* make tblgen autogenerate the nocapture intrinsics for Chris Lattner2009-01-121-4/+0
| | | | | | | llvm.memcpy/memset/memmove. This allows removal of some hackish code from basicaa. llvm-svn: 62071
* When checking if an Argument escapes, check ifDuncan Sands2009-01-051-7/+13
| | | | | | | | the argument is marked nocapture - no need to analyze the argument if the answer is already known! llvm-svn: 61753
* Resubmit support for the 'nocapture' attribute.Nick Lewycky2008-12-191-6/+17
| | | | | | | | | | The problematic part of this patch is that we were out of attribute bits, requiring some fancy bit hacking to make it fit (by shrinking alignment) without breaking existing users or the file format. This change will require users to rebuild llvm-gcc to match llvm. llvm-svn: 61239
* Temporarily revert r61019, r61030, and r61040. These were breaking LLVM ReleaseBill Wendling2008-12-161-17/+6
| | | | | | builds. llvm-svn: 61094
* Teach basicaa to use the nocapture attribute when possible. When theChris Lattner2008-12-151-6/+17
| | | | | | intrinsics are properly marked nocapture, the fixme should be addressed. llvm-svn: 61040
* Allow basicaa to walk through geps with identical indices in Chris Lattner2008-12-101-18/+32
| | | | | | | | | | | parallel, allowing it to decide that P/Q must alias if A/B must alias in things like: P = gep A, 0, i, 1 Q = gep B, 0, i, 1 This allows GVN to delete 62 more instructions out of 403.gcc. llvm-svn: 60820
* Teach BasicAA::getModRefInfo(CallSite, CallSite) someChris Lattner2008-12-091-4/+20
| | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 60794
* Fix comment typo.Duncan Sands2008-12-081-1/+1
| | | | llvm-svn: 60697
* Some minor optimizations for isObjectSmallerThan.Chris Lattner2008-12-081-7/+12
| | | | llvm-svn: 60687
* Seriously strengthen the guarantee offered by noalias on a function's returnNick Lewycky2008-11-241-3/+3
| | | | | | | | value. It must now be as if the pointer were allocated and has not escaped to the caller. Thanks to Dan Gohman for pointing out the error in the original and helping devise this definition. llvm-svn: 59940
* Extend the 'noalias' attribute to function return values. This is intended toNick Lewycky2008-11-241-8/+17
| | | | | | | | | indicate functions that allocate, such as operator new, or list::insert. The actual definition is slightly less strict (for now). No changes to the bitcode reader/writer, asm printer or verifier were needed. llvm-svn: 59934
* Factorize code: remove variants of "strip offDuncan Sands2008-10-011-28/+4
| | | | | | | | | | | pointer bitcasts and GEP's", and centralize the logic in Value::getUnderlyingObject. The difference with stripPointerCasts is that stripPointerCasts only strips GEPs if all indices are zero, while getUnderlyingObject strips GEPs no matter what the indices are. llvm-svn: 56922
* s/ParameterAttributes/Attributes/gDevang Patel2008-09-231-1/+0
| | | | llvm-svn: 56513
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-041-3/+3
| | | | llvm-svn: 55779
* simplify some code by using a helper function. This really reallyChris Lattner2008-06-161-22/+16
| | | | | | wants a 'nocapture' predicate. llvm-svn: 52304
* move a bunch of predicates up into their own sectionChris Lattner2008-06-161-157/+171
| | | | | | in this file, no other changes. llvm-svn: 52303
* Other parts of this code treat noalias arguments as objects forChris Lattner2008-06-161-4/+8
| | | | | | the purposes of escape analysis. llvm-svn: 52302
* If we are checking to see if the result of a call aliases aChris Lattner2008-06-161-1/+21
| | | | | | | pointer derived from a local allocation, if the local allocation never escapes, the pointers can't alias. This implements PR2436 llvm-svn: 52301
* Refactor basicaa's main alias function somethin' fierce. Chris Lattner2008-06-161-104/+94
| | | | | | | | This fixes several minor bugs (such as returning noalias for comparisons between external weak functions an null) but is mostly a cleanup. llvm-svn: 52299
* Fixes PR2395. Looking for a constant in a GEP tail (when the first GEP Wojciech Matyjewicz2008-06-021-1/+7
| | | | | | | | is longer than the second one) should stop after finding one. Added break instruction guarantees it. It also changes difference between offsets to absolute value of this difference in the condition. llvm-svn: 51875
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-14/+14
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* Fix a "large integer implicitly truncated to unsigned type"Duncan Sands2008-04-211-1/+1
| | | | | | warning. llvm-svn: 50033
* Don't assume a tail call can't reference a byvalDale Johannesen2008-04-151-2/+4
| | | | | | argument to the outer function, this isn't correct. llvm-svn: 49731
* 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-2/+2
| | | | llvm-svn: 48554
* Fix a compiler warning.Duncan Sands2008-02-191-1/+1
| | | | llvm-svn: 47328
* In addition to arguments passed to it, memcpy (and all other calls) can ↵Owen Anderson2008-02-191-1/+2
| | | | | | ModRef pointers that alias their arguments as well. This fixes PR2057. llvm-svn: 47317
* don't bother calling getUnderlyingObject for non-pointers.Chris Lattner2008-02-181-1/+2
| | | | llvm-svn: 47272
* Since we're not checking for the more general AllocationInst first, we need ↵Owen Anderson2008-02-181-1/+1
| | | | | | | | to explicitly check that Object is an Argument before casting it to one. llvm-svn: 47268
* This check is not correct for mallocs, so exclude them earlier.Owen Anderson2008-02-181-2/+2
| | | | llvm-svn: 47263
* Fix a comment, and a bug where we weren't applying the tail call logic in ↵Owen Anderson2008-02-181-6/+8
| | | | | | cases that failed the first test. llvm-svn: 47253
* Fix bugs that Chris noticed in my last patch.Owen Anderson2008-02-181-9/+17
| | | | llvm-svn: 47252
* bitcasts of pointers are always pointers.Chris Lattner2008-02-181-5/+2
| | | | | | | If we see a memcpy of a pointer, make sure to check later uses of the pointer as well. llvm-svn: 47250
* Teach getModRefInfo that memcpy, memmove, and memset don't "capture" memory ↵Owen Anderson2008-02-171-3/+13
| | | | | | | | | addresses. Also, noalias arguments are be considered "like" stack allocated ones for this purpose, because the only way they can be modref'ed is if they escape somewhere in the current function. llvm-svn: 47247
* getUnderlyingObject can return null, handle this.Chris Lattner2008-01-241-2/+3
| | | | llvm-svn: 46318
* Teach basicaa that 'byval' arguments define a new memory location thatChris Lattner2008-01-241-34/+34
| | | | | | | can't be aliased to other known objects. This allows us to know that byval pointer args don't alias globals, etc. llvm-svn: 46315
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Make these loops follow GetGEPOperands() behavior.Wojciech Matyjewicz2007-12-131-11/+13
| | | | | | | Let: %q = GEP %p, X, ... If %p is a GEP, we can chase baseptr further, only if X==0. llvm-svn: 44999
* Fix PR1782, patch by Wojtek Matyjewicz!Chris Lattner2007-12-091-4/+4
| | | | llvm-svn: 44733
* Rather than having special rules like "intrinsics cannotDuncan Sands2007-12-031-37/+0
| | | | | | | | | throw exceptions", just mark intrinsics with the nounwind attribute. Likewise, mark intrinsics as readnone/readonly and get rid of special aliasing logic (which didn't use anything more than this anyway). llvm-svn: 44544
OpenPOWER on IntegriCloud