summaryrefslogtreecommitdiff
path: root/lib/Analysis/AliasAnalysis.cpp
Commit message (Collapse)AuthorAge
* Move isKnownNonNull out of AliasAnalysis.h and into ValueTracking.cpp sinceDan Gohman2013-01-31
| | | | | | | | it isn't really an AliasAnalysis concept, and ValueTracking has similar things that it could plausibly share code with some day. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174027 91177308-0d34-0410-b5e6-96231b3b80d8
* Memory Dependence Analysis: fix a miscompile that uses DT to approxmiate theManman Ren2013-01-04
| | | | | | | | | | | | | reachablity. We conservatively approximate the reachability analysis by saying it is not reachable if there is a single path starting from "From" and the path does not reach "To". rdar://12801584 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171512 91177308-0d34-0410-b5e6-96231b3b80d8
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-02
| | | | | | | | | | | | | | | | | | | | | 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
* Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling2012-12-19
| | | | | | single attribute in the future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170502 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-03
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the attribute enums to query if a parameter has an attribute.Bill Wendling2012-10-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165550 91177308-0d34-0410-b5e6-96231b3b80d8
* Move TargetData to DataLayout.Micah Villmow2012-10-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165402 91177308-0d34-0410-b5e6-96231b3b80d8
* Use method to query for NoAlias attribute.Bill Wendling2012-10-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165211 91177308-0d34-0410-b5e6-96231b3b80d8
* Make MemoryBuiltins aware of TargetLibraryInfo.Benjamin Kramer2012-08-29
| | | | | | | | | | | | | | | | This disables malloc-specific optimization when -fno-builtin (or -ffreestanding) is specified. This has been a problem for a long time but became more severe with the recent memory builtin improvements. Since the memory builtin functions are used everywhere, this required passing TLI in many places. This means that functions that now have an optional TLI argument, like RecursivelyDeleteTriviallyDeadFunctions, won't remove dead mallocs anymore if the TLI argument is missing. I've updated most passes to do the right thing. Fixes PR13694 and probably others. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162841 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the capture analysis from MemoryDependencyAnalysis to a more general placeChad Rosier2012-05-14
| | | | | | | | | | 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
* Move isKnownNonNull from private implementation detail of BasicAA to a publicNick Lewycky2012-02-25
| | | | | | | function that others can use, next to llvm::isIdentifiedObject. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151446 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance alias analysis for atomic instructions a bit. Upgrade a couple ↵Eli Friedman2011-09-26
| | | | | | alias-analysis tests to the new atomic instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140557 91177308-0d34-0410-b5e6-96231b3b80d8
* Misc analysis passes that need to be aware of atomic load/store.Eli Friedman2011-08-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137650 91177308-0d34-0410-b5e6-96231b3b80d8
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375 91177308-0d34-0410-b5e6-96231b3b80d8
* When analyzing functions known to only access argument pointees,Dan Gohman2011-04-27
| | | | | | | | | | only check arguments with pointer types. Update the documentation of IntrReadArgMem reflect this. While here, add support for TBAA tags on intrinsic calls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130317 91177308-0d34-0410-b5e6-96231b3b80d8
* Stub out a new updating interface to AliasAnalysis, allowing stateful ↵Owen Anderson2011-01-03
| | | | | | | | | | analyses to be informed when a pointer value has potentially become escaping. Implementations can choose to either fall back to conservative responses for that value, or may recompute their analysis to accomodate the change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122777 91177308-0d34-0410-b5e6-96231b3b80d8
* Make memcpyopt TBAA-aware.Dan Gohman2010-12-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121944 91177308-0d34-0410-b5e6-96231b3b80d8
* getLocationForDest should work for memset as well.Chris Lattner2010-11-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120380 91177308-0d34-0410-b5e6-96231b3b80d8
* add "getLocation" method to AliasAnalysis for getting the source andChris Lattner2010-11-21
| | | | | | | | | destination location of a memcpy/memmove. I'm not clear about whether TBAA works on these, so I'm leaving it out for now. Dan, please revisit this when convenient. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119928 91177308-0d34-0410-b5e6-96231b3b80d8
* Add helper functions for computing the Location of load, store,Dan Gohman2010-11-11
| | | | | | | and vaarg instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118845 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a doesAccessArgPointees helper function, and update code to useDan Gohman2010-11-10
| | | | | | | it, and to be consistent. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118692 91177308-0d34-0410-b5e6-96231b3b80d8
* Make ModRefBehavior a lattice. Use this to clean up AliasAnalysisDan Gohman2010-11-10
| | | | | | | chaining and simplify FunctionAttrs' GetModRefBehavior logic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118660 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach AliasAnalysis about AccessesArgumentsReadonly.Dan Gohman2010-11-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118621 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend the AliasAnalysis::pointsToConstantMemory interface to allow itDan Gohman2010-11-08
| | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118412 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete getIntrinsicModRefBehavior. Clients can just use the normalDan Gohman2010-11-08
| | | | | | | | getModRefBehavior now, since it now understands intrinsics as well as normal functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118411 91177308-0d34-0410-b5e6-96231b3b80d8
* Update comments; BasicAA is no longer necessarily the end of the chain.Dan Gohman2010-10-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117268 91177308-0d34-0410-b5e6-96231b3b80d8
* Reintroduce these asserts, now that BasicAA is a normal AliasAnalysis pass.Dan Gohman2010-10-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117266 91177308-0d34-0410-b5e6-96231b3b80d8
* Move NoAA out of BasicAliasAnalysis.cpp into its own file, now thatDan Gohman2010-10-19
| | | | | | | | it doesn't have a special relationship with BasicAliasAnalysis anymore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116876 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r116831 and r116839, converting AliasAnalysis to useDan Gohman2010-10-19
| | | | | | | uint64_t, plus fixes for places I missed before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116875 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r116831 and r116839, which are breaking selfhost builds.Dan Gohman2010-10-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116858 91177308-0d34-0410-b5e6-96231b3b80d8
* Change AliasAnalysis and its clients to use uint64_t instead of unsignedDan Gohman2010-10-19
| | | | | | | for representing object sizes, for consistency with other parts of LLVM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116831 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-19
| | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116820 91177308-0d34-0410-b5e6-96231b3b80d8
* Consistently use AliasAnalysis::UnknownSize instead of hardcoding ~0u.Dan Gohman2010-10-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116815 91177308-0d34-0410-b5e6-96231b3b80d8
* Analysis groups need to initialize their default implementations.Owen Anderson2010-10-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116441 91177308-0d34-0410-b5e6-96231b3b80d8
* Now with fewer extraneous semicolons!Owen Anderson2010-10-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115996 91177308-0d34-0410-b5e6-96231b3b80d8
* Hide analysis group registration behind a macro, just like pass registration.Owen Anderson2010-10-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115835 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the experimental AliasAnalysis::getDependency interface, whichDan Gohman2010-09-14
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113858 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend the getDependence query with support for PHI translation.Dan Gohman2010-09-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113521 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new experimental generalized dependence query interface toDan Gohman2010-09-08
| | | | | | | | | AliasAnalysis, and some code for implementing the new query on top of existing implementations by making standard alias and getModRefInfo queries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113329 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement a proper getModRefInfo for va_arg.Dan Gohman2010-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110458 91177308-0d34-0410-b5e6-96231b3b80d8
* Be more conservative in the face of volatile.Dan Gohman2010-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110456 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a comment.Dan Gohman2010-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110455 91177308-0d34-0410-b5e6-96231b3b80d8
* Move all the logic for function attributes and call attributes out of theDan Gohman2010-08-06
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110421 91177308-0d34-0410-b5e6-96231b3b80d8
* Yes, we can do better, but this is not the place for it.Dan Gohman2010-08-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110391 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove PointerAccessInfo, which nothing was using.Dan Gohman2010-08-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110167 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread const correctness through a bunch of AliasAnalysis interfaces andDan Gohman2010-08-03
| | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110155 91177308-0d34-0410-b5e6-96231b3b80d8
* Make AliasAnalysis::getModRefInfo conservative in the face of volatility.Dan Gohman2010-08-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110120 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove interprocedural-basic-aa and associated code. The AliasAnalysisDan Gohman2010-07-07
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107776 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an Intraprocedural form of BasicAliasAnalysis, which aims toDan Gohman2010-06-29
| | | | | | | | properly handles instructions and arguments defined in different functions, or across recursive function iterations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107109 91177308-0d34-0410-b5e6-96231b3b80d8
* Partially address a README by having functionattrs consider calls toDuncan Sands2010-01-06
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92829 91177308-0d34-0410-b5e6-96231b3b80d8