summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/AliasAnalysis.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add a doesAccessArgPointees helper function, and update code to useDan Gohman2010-11-101-22/+24
| | | | | | it, and to be consistent. llvm-svn: 118692
* Make ModRefBehavior a lattice. Use this to clean up AliasAnalysisDan Gohman2010-11-101-1/+1
| | | | | | chaining and simplify FunctionAttrs' GetModRefBehavior logic. llvm-svn: 118660
* Teach AliasAnalysis about AccessesArgumentsReadonly.Dan Gohman2010-11-091-6/+8
| | | | llvm-svn: 118621
* Extend the AliasAnalysis::pointsToConstantMemory interface to allow itDan Gohman2010-11-081-2/+3
| | | | | | | | | | | | to optionally look for constant or local (alloca) memory. Teach BasicAliasAnalysis::pointsToConstantMemory to look through Select and Phi nodes, and to support looking for local memory. Remove FunctionAttrs' PointsToLocalOrConstantMemory function, now that AliasAnalysis knows all the tricks that it knew. llvm-svn: 118412
* Delete getIntrinsicModRefBehavior. Clients can just use the normalDan Gohman2010-11-081-7/+0
| | | | | | | getModRefBehavior now, since it now understands intrinsics as well as normal functions. llvm-svn: 118411
* Update comments; BasicAA is no longer necessarily the end of the chain.Dan Gohman2010-10-251-3/+3
| | | | llvm-svn: 117268
* Reintroduce these asserts, now that BasicAA is a normal AliasAnalysis pass.Dan Gohman2010-10-251-6/+3
| | | | llvm-svn: 117266
* Move NoAA out of BasicAliasAnalysis.cpp into its own file, now thatDan Gohman2010-10-191-6/+0
| | | | | | | it doesn't have a special relationship with BasicAliasAnalysis anymore. llvm-svn: 116876
* Reapply r116831 and r116839, converting AliasAnalysis to useDan Gohman2010-10-191-1/+1
| | | | | | uint64_t, plus fixes for places I missed before. llvm-svn: 116875
* Revert r116831 and r116839, which are breaking selfhost builds.Dan Gohman2010-10-191-1/+1
| | | | llvm-svn: 116858
* Change AliasAnalysis and its clients to use uint64_t instead of unsignedDan Gohman2010-10-191-1/+1
| | | | | | for representing object sizes, for consistency with other parts of LLVM. llvm-svn: 116831
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-191-1/+1
| | | | | | | | | | | | | | | | | exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. llvm-svn: 116820
* Consistently use AliasAnalysis::UnknownSize instead of hardcoding ~0u.Dan Gohman2010-10-191-1/+1
| | | | llvm-svn: 116815
* Analysis groups need to initialize their default implementations.Owen Anderson2010-10-131-1/+1
| | | | llvm-svn: 116441
* Now with fewer extraneous semicolons!Owen Anderson2010-10-071-1/+1
| | | | llvm-svn: 115996
* Hide analysis group registration behind a macro, just like pass registration.Owen Anderson2010-10-061-1/+1
| | | | llvm-svn: 115835
* Remove the experimental AliasAnalysis::getDependency interface, whichDan Gohman2010-09-141-254/+31
| | | | | | | | | | | isn't a good level of abstraction for memdep. Instead, generalize AliasAnalysis::alias and related interfaces with a new Location class for describing a memory location. For now, this is the same Pointer and Size as before, plus an additional field for a TBAA tag. Also, introduce a fixed MD_tbaa metadata tag kind. llvm-svn: 113858
* Extend the getDependence query with support for PHI translation.Dan Gohman2010-09-091-12/+49
| | | | llvm-svn: 113521
* Add a new experimental generalized dependence query interface toDan Gohman2010-09-081-0/+192
| | | | | | | | AliasAnalysis, and some code for implementing the new query on top of existing implementations by making standard alias and getModRefInfo queries. llvm-svn: 113329
* Implement a proper getModRefInfo for va_arg.Dan Gohman2010-08-061-0/+17
| | | | llvm-svn: 110458
* Be more conservative in the face of volatile.Dan Gohman2010-08-061-8/+8
| | | | llvm-svn: 110456
* Fix a comment.Dan Gohman2010-08-061-2/+2
| | | | llvm-svn: 110455
* Move all the logic for function attributes and call attributes out of theDan Gohman2010-08-061-59/+119
| | | | | | | | | | | | | AliasAnalysis base class and into BasicAliasAnalyais. This avoids confusion about where such logic is happening when there are other AliasAnalysis implementations present. Move the logic for translating two-callsite getModRefInfo queries into other AliasAnalysis queries out of BasicAliasAnalysis and into the AliasAnalysis base class, as it is useful for other AliasAnalysis implementations. llvm-svn: 110421
* Yes, we can do better, but this is not the place for it.Dan Gohman2010-08-051-1/+0
| | | | llvm-svn: 110391
* Remove PointerAccessInfo, which nothing was using.Dan Gohman2010-08-031-5/+3
| | | | llvm-svn: 110167
* Thread const correctness through a bunch of AliasAnalysis interfaces andDan Gohman2010-08-031-13/+15
| | | | | | | | | | | | eliminate several const_casts. Make CallSite implicitly convertible to ImmutableCallSite. Rename the getModRefBehavior for intrinsic IDs to getIntrinsicModRefBehavior to avoid overload ambiguity with CallSite, which happens to be implicitly convertible to bool. llvm-svn: 110155
* Make AliasAnalysis::getModRefInfo conservative in the face of volatility.Dan Gohman2010-08-031-3/+20
| | | | llvm-svn: 110120
* Remove interprocedural-basic-aa and associated code. The AliasAnalysisDan Gohman2010-07-071-9/+7
| | | | | | | | | | | interface needs implementations to be consistent, so any code which wants to support different semantics must use a different interface. It's not currently worthwhile to add a new interface for this new concept. Document that AliasAnalysis doesn't support cross-function queries. llvm-svn: 107776
* Add an Intraprocedural form of BasicAliasAnalysis, which aims toDan Gohman2010-06-291-6/+10
| | | | | | | properly handles instructions and arguments defined in different functions, or across recursive function iterations. llvm-svn: 107109
* Partially address a README by having functionattrs consider calls toDuncan Sands2010-01-061-4/+7
| | | | | | | | | | memcpy, memset and other intrinsics that only access their arguments to be readnone if the intrinsic's arguments all point to local memory. This improves the testcase in the README to readonly, but it could in theory be made readnone, however this would involve more sophisticated analysis that looks through the memcpy. llvm-svn: 92829
* use the new isNoAlias method to simplify some code, only do an escaping ↵Chris Lattner2009-11-231-3/+4
| | | | | | | | check if we have a non-constant pointer. Constant pointers can't be local. llvm-svn: 89665
* Remove the AliasAnalysis::getMustAliases method, which is dead.Chris Lattner2009-11-221-10/+0
| | | | | | | | The hasNoModRefInfoForCalls isn't worth it as a filter because basicaa provides m/r info and everything chains to it, so remove it. llvm-svn: 89599
* 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
* Global Aliases are not identifiable objects.Dan Gohman2009-08-271-2/+4
| | | | llvm-svn: 80263
* Make AliasAnalysis and related classes useDan Gohman2009-07-251-6/+11
| | | | | | getAnalysisIfAvailable<TargetData>(). llvm-svn: 77028
* Generalize some alias analysis logic from atomicDuncan Sands2009-02-141-1/+6
| | | | | | intrinsics to any IntrWriteArgMem intrinsics. llvm-svn: 64551
* If a function only reads memory, then we know that...Duncan Sands2009-02-131-7/+11
| | | | | | | | it only reads memory! The other change has no functional effect, it just seems more logical to go in order of decreasing knowledge. llvm-svn: 64463
* Fix a crasher: we need to check that the function is non-null before using it!Owen Anderson2009-02-061-1/+1
| | | | llvm-svn: 63902
* Refactor my previous change to maintain the distinction between ↵Owen Anderson2009-02-051-56/+14
| | | | | | | | 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/+21
| | | | | | | | only dereference their arguments, and enhance BasicAA to make use of this fact when computing ModRef info. llvm-svn: 63718
* Teach AliasAnalysis that a bunch of the atomic intrinsics only dereference ↵Owen Anderson2009-02-031-0/+22
| | | | | | their arguments. llvm-svn: 63616
* Move isIdentifiedObject and isNoAliasCall into AliasAnalysis.cpp sinceDan Gohman2009-02-031-0/+24
| | | | | | | | 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 copy+paste error in a comment.Dan Gohman2008-05-301-1/+1
| | | | llvm-svn: 51717
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-3/+1
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Revert r44626, which turned off the use of readonlyDuncan Sands2007-12-121-12/+4
| | | | | | | | | | and readnone for functions with bodies because it broke llvm-gcc-4.2 bootstrap. It turns out that, because of LLVM's array_ref hack, gcc was computing pure/const attributes wrong (now fixed by turning off the gcc ipa-pure-const pass). llvm-svn: 44937
* Commit 44487 broke bootstrap of llvm-gcc-4.2. It isDuncan Sands2007-12-051-4/+12
| | | | | | | not yet clear why, but in the meantime work around the problem by making less use of readnone/readonly info. llvm-svn: 44626
* Rather than having special rules like "intrinsics cannotDuncan Sands2007-12-031-4/+4
| | | | | | | | | 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
* Integrate the readonly/readnone logic more deeplyDuncan Sands2007-12-011-7/+32
| | | | | | | | | | | | | | | into alias analysis. This meant updating the API which now has versions of the getModRefBehavior, doesNotAccessMemory and onlyReadsMemory methods which take a callsite parameter. These should be used unless the callsite is not known, since in general they can do a better job than the versions that take a function. Also, users should no longer call the version of getModRefBehavior that takes both a function and a callsite. To reduce the chance of misuse it is now protected. llvm-svn: 44487
* Executive summary: getTypeSize -> getTypeStoreSize / getABITypeSize.Duncan Sands2007-11-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The meaning of getTypeSize was not clear - clarifying it is important now that we have x86 long double and arbitrary precision integers. The issue with long double is that it requires 80 bits, and this is not a multiple of its alignment. This gives a primitive type for which getTypeSize differed from getABITypeSize. For arbitrary precision integers it is even worse: there is the minimum number of bits needed to hold the type (eg: 36 for an i36), the maximum number of bits that will be overwriten when storing the type (40 bits for i36) and the ABI size (i.e. the storage size rounded up to a multiple of the alignment; 64 bits for i36). This patch removes getTypeSize (not really - it is still there but deprecated to allow for a gradual transition). Instead there is: (1) getTypeSizeInBits - a number of bits that suffices to hold all values of the type. For a primitive type, this is the minimum number of bits. For an i36 this is 36 bits. For x86 long double it is 80. This corresponds to gcc's TYPE_PRECISION. (2) getTypeStoreSizeInBits - the maximum number of bits that is written when storing the type (or read when reading it). For an i36 this is 40 bits, for an x86 long double it is 80 bits. This is the size alias analysis is interested in (getTypeStoreSize returns the number of bytes). There doesn't seem to be anything corresponding to this in gcc. (3) getABITypeSizeInBits - this is getTypeStoreSizeInBits rounded up to a multiple of the alignment. For an i36 this is 64, for an x86 long double this is 96 or 128 depending on the OS. This is the spacing between consecutive elements when you form an array out of this type (getABITypeSize returns the number of bytes). This is TYPE_SIZE in gcc. Since successive elements in a SequentialType (arrays, pointers and vectors) need to be aligned, the spacing between them will be given by getABITypeSize. This means that the size of an array is the length times the getABITypeSize. It also means that GEP computations need to use getABITypeSize when computing offsets. Furthermore, if an alloca allocates several elements at once then these too need to be aligned, so the size of the alloca has to be the number of elements multiplied by getABITypeSize. Logically speaking this doesn't have to be the case when allocating just one element, but it is simpler to also use getABITypeSize in this case. So alloca's and mallocs should use getABITypeSize. Finally, since gcc's only notion of size is that given by getABITypeSize, if you want to output assembler etc the same as gcc then getABITypeSize is the size you want. Since a store will overwrite no more than getTypeStoreSize bytes, and a read will read no more than that many bytes, this is the notion of size appropriate for alias analysis calculations. In this patch I have corrected all type size uses except some of those in ScalarReplAggregates, lib/Codegen, lib/Target (the hard cases). I will get around to auditing these too at some point, but I could do with some help. Finally, I made one change which I think wise but others might consider pointless and suboptimal: in an unpacked struct the amount of space allocated for a field is now given by the ABI size rather than getTypeStoreSize. I did this because every other place that reserves memory for a type (eg: alloca) now uses getABITypeSize, and I didn't want to make an exception for unpacked structs, i.e. I did it to make things more uniform. This only effects structs containing long doubles and arbitrary precision integers. If someone wants to pack these types more tightly they can always use a packed struct. llvm-svn: 43620
OpenPOWER on IntegriCloud