#
c41404a0 |
| 17-Jun-2015 |
Chandler Carruth <chandlerc@gmail.com> |
[PM/AA] Split the location computation out of getArgLocation so the virtual interface on AliasAnalysis only deals with ModRef information.
This interface was both computing memory locations by using
[PM/AA] Split the location computation out of getArgLocation so the virtual interface on AliasAnalysis only deals with ModRef information.
This interface was both computing memory locations by using TLI and other tricks to estimate the size of memory referenced by an operand, and computing ModRef information through similar investigations. This change narrows the scope of the virtual interface on AliasAnalysis slightly.
Note that all of this code could live in BasicAA, and be done with a single investigation of the argument, if it weren't for the fact that the generic code in AliasAnalysis::getModRefBehavior for a callsite calls into the virtual aspect of (now) getArgModRefInfo. But this patch's arrangement seems a not terrible way to go for now.
The other interesting wrinkle is how we could reasonably extend LLVM with support for custom memory location sizes and mod/ref behavior for library routines. After discussions with Hal on the review, the conclusion is that this would be best done by fleshing out the much desired support for extensions to TLI, and support these types of queries in that interface where we would likely be doing other library API recognition and analysis.
Differential Revision: http://reviews.llvm.org/D10259
llvm-svn: 239884
show more ...
|
#
70c61c1a |
| 04-Jun-2015 |
Chandler Carruth <chandlerc@gmail.com> |
[PM/AA] Start refactoring AliasAnalysis to remove the analysis group and port it to the new pass manager.
All this does is extract the inner "location" class used by AA into its own full fledged typ
[PM/AA] Start refactoring AliasAnalysis to remove the analysis group and port it to the new pass manager.
All this does is extract the inner "location" class used by AA into its own full fledged type. This seems *much* cleaner as MemoryDependence and soon MemorySSA also use this heavily, and it doesn't make much sense being inside the AA infrastructure.
This will also make it much easier to break apart the AA infrastructure into something that stands on its own rather than using the analysis group design.
There are a few places where this makes APIs not make sense -- they were taking an AliasAnalysis pointer just to build locations. I'll try to clean those up in follow-up commits.
Differential Revision: http://reviews.llvm.org/D10228
llvm-svn: 239003
show more ...
|
Revision tags: llvmorg-3.6.1 |
|
#
bbcf75e5 |
| 13-May-2015 |
Teresa Johnson <tejohnson@google.com> |
Test commit: Remove unnecessary spaces.
llvm-svn: 237259
|
Revision tags: llvmorg-3.6.1-rc1 |
|
#
ec1de3fb |
| 28-Apr-2015 |
Daniel Berlin <dberlin@dberlin.org> |
Make getModRefInfo(Instruction *) not crash on certain types of instructions
llvm-svn: 236023
|
#
8de312d2 |
| 13-Apr-2015 |
Daniel Berlin <dberlin@dberlin.org> |
Add new getModRefInfo API to determine whether an Instruction and a call modify the same memory
llvm-svn: 234814
|
#
b2d22769 |
| 13-Apr-2015 |
Daniel Berlin <dberlin@dberlin.org> |
Make getModRefInfo with a default location not crash. Add getModRefInfo that works without location. Add unit tests.
llvm-svn: 234811
|
Revision tags: llvmorg-3.5.2, llvmorg-3.5.2-rc1 |
|
#
a28d91d8 |
| 10-Mar-2015 |
Mehdi Amini <mehdi.amini@apple.com> |
DataLayout is mandatory, update the API to reflect it with references.
Summary: Now that the DataLayout is a mandatory part of the module, let's start cleaning the codebase. This patch is a first at
DataLayout is mandatory, update the API to reflect it with references.
Summary: Now that the DataLayout is a mandatory part of the module, let's start cleaning the codebase. This patch is a first attempt at doing that.
This patch is not exactly NFC as for instance some places were passing a nullptr instead of the DataLayout, possibly just because there was a default value on the DataLayout argument to many functions in the API. Even though it is not purely NFC, there is no change in the validation.
I turned as many pointer to DataLayout to references, this helped figuring out all the places where a nullptr could come up.
I had initially a local version of this patch broken into over 30 independant, commits but some later commit were cleaning the API and touching part of the code modified in the previous commits, so it seemed cleaner without the intermediate state.
Test Plan:
Reviewers: echristo
Subscribers: llvm-commits
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 231740
show more ...
|
#
46a43556 |
| 04-Mar-2015 |
Mehdi Amini <mehdi.amini@apple.com> |
Make DataLayout Non-Optional in the Module
Summary: DataLayout keeps the string used for its creation.
As a side effect it is no longer needed in the Module. This is "almost" NFC, the string is no
Make DataLayout Non-Optional in the Module
Summary: DataLayout keeps the string used for its creation.
As a side effect it is no longer needed in the Module. This is "almost" NFC, the string is no longer canonicalized, you can't rely on two "equals" DataLayout having the same string returned by getStringRepresentation().
Get rid of DataLayoutPass: the DataLayout is in the Module
The DataLayout is "per-module", let's enforce this by not duplicating it more than necessary. One more step toward non-optionality of the DataLayout in the module.
Make DataLayout Non-Optional in the Module
Module->getDataLayout() will never returns nullptr anymore.
Reviewers: echristo
Subscribers: resistor, llvm-commits, jholewinski
Differential Revision: http://reviews.llvm.org/D7992
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 231270
show more ...
|
Revision tags: llvmorg-3.6.0, llvmorg-3.6.0-rc4, llvmorg-3.6.0-rc3, llvmorg-3.6.0-rc2 |
|
#
b98f63db |
| 15-Jan-2015 |
Chandler Carruth <chandlerc@gmail.com> |
[PM] Separate the TargetLibraryInfo object from the immutable pass.
The pass is really just a means of accessing a cached instance of the TargetLibraryInfo object, and this way we can re-use that ob
[PM] Separate the TargetLibraryInfo object from the immutable pass.
The pass is really just a means of accessing a cached instance of the TargetLibraryInfo object, and this way we can re-use that object for the new pass manager as its result.
Lots of delta, but nothing interesting happening here. This is the common pattern that is developing to allow analyses to live in both the old and new pass manager -- a wrapper pass in the old pass manager emulates the separation intrinsic to the new pass manager between the result and pass for analyses.
llvm-svn: 226157
show more ...
|
Revision tags: llvmorg-3.6.0-rc1 |
|
#
62d4215b |
| 15-Jan-2015 |
Chandler Carruth <chandlerc@gmail.com> |
[PM] Move TargetLibraryInfo into the Analysis library.
While the term "Target" is in the name, it doesn't really have to do with the LLVM Target library -- this isn't an abstraction which LLVM targe
[PM] Move TargetLibraryInfo into the Analysis library.
While the term "Target" is in the name, it doesn't really have to do with the LLVM Target library -- this isn't an abstraction which LLVM targets generally need to implement or extend. It has much more to do with modeling the various runtime libraries on different OSes and with different runtime environments. The "target" in this sense is the more general sense of a target of cross compilation.
This is in preparation for porting this analysis to the new pass manager.
No functionality changed, and updates inbound for Clang and Polly.
llvm-svn: 226078
show more ...
|
Revision tags: llvmorg-3.5.1, llvmorg-3.5.1-rc2 |
|
#
a5599bfd |
| 15-Dec-2014 |
Elena Demikhovsky <elena.demikhovsky@intel.com> |
Sink store based on alias analysis - by Ella Bolshinsky The alias analysis is used define whether the given instruction is a barrier for store sinking. For 2 identical stores, following instructions
Sink store based on alias analysis - by Ella Bolshinsky The alias analysis is used define whether the given instruction is a barrier for store sinking. For 2 identical stores, following instructions are checked in the both basic blocks, to determine whether they are sinking barriers.
http://reviews.llvm.org/D6420
llvm-svn: 224247
show more ...
|
Revision tags: llvmorg-3.5.1-rc1 |
|
#
d0e13af2 |
| 28-Oct-2014 |
NAKAMURA Takumi <geek4civic@gmail.com> |
Reformat partially, where I touched for whitespace changes.
llvm-svn: 220773
|
#
335a7bcf |
| 28-Oct-2014 |
NAKAMURA Takumi <geek4civic@gmail.com> |
Untabify and whitespace cleanups.
llvm-svn: 220771
|
#
2e52f028 |
| 04-Oct-2014 |
Benjamin Kramer <benny.kra@googlemail.com> |
Make AAMDNodes ctor and operator bool (!!!) explicit, mop up bugs and weirdness exposed by it.
llvm-svn: 219068
|
Revision tags: llvmorg-3.5.0, llvmorg-3.5.0-rc4, llvmorg-3.5.0-rc3, llvmorg-3.5.0-rc2 |
|
#
cc39b675 |
| 24-Jul-2014 |
Hal Finkel <hfinkel@anl.gov> |
AA metadata refactoring (introduce AAMDNodes)
In order to enable the preservation of noalias function parameter information after inlining, and the representation of block-level __restrict__ pointer
AA metadata refactoring (introduce AAMDNodes)
In order to enable the preservation of noalias function parameter information after inlining, and the representation of block-level __restrict__ pointer information (etc.), additional kinds of aliasing metadata will be introduced. This metadata needs to be carried around in AliasAnalysis::Location objects (and MMOs at the SDAG level), and so we need to generalize the current scheme (which is hard-coded to just one TBAA MDNode*).
This commit introduces only the necessary refactoring to allow for the introduction of other aliasing metadata types, but does not actually introduce any (that will come in a follow-up commit). What it does introduce is a new AAMDNodes structure to hold all of the aliasing metadata nodes associated with a particular memory-accessing instruction, and uses that structure instead of the raw MDNode* in AliasAnalysis::Location, etc.
No functionality change intended.
llvm-svn: 213859
show more ...
|
Revision tags: llvmorg-3.5.0-rc1 |
|
#
d32803b6 |
| 21-Jul-2014 |
Hal Finkel <hfinkel@anl.gov> |
Match semantics of PointerMayBeCapturedBefore to its name by default
As it turns out, the capture tracker named CaptureBefore used by AA, and now available via the PointerMayBeCapturedBefore functio
Match semantics of PointerMayBeCapturedBefore to its name by default
As it turns out, the capture tracker named CaptureBefore used by AA, and now available via the PointerMayBeCapturedBefore function, would have been more-aptly named CapturedBeforeOrAt, because it considers captures at the instruction provided. This is not always what one wants, and it is difficult to get the strictly-before behavior given only the current interface. This adds an additional parameter which controls whether or not you want to include captures at the provided instruction. The default is not to include the instruction provided, so that 'Before' matches its name.
No functionality change intended.
llvm-svn: 213582
show more ...
|
#
b0356217 |
| 21-Jul-2014 |
Hal Finkel <hfinkel@anl.gov> |
Move the CapturesBefore tracker from AA into CaptureTracking
There were two generally-useful CaptureTracker classes defined in LLVM: the simple tracker defined in CaptureTracking (and made available
Move the CapturesBefore tracker from AA into CaptureTracking
There were two generally-useful CaptureTracker classes defined in LLVM: the simple tracker defined in CaptureTracking (and made available via the PointerMayBeCaptured utility function), and the CapturesBefore tracker available only inside of AA. This change moves the CapturesBefore tracker into CaptureTracking, generalizes it slightly (by adding a ReturnCaptures parameter), and makes it generally available via a PointerMayBeCapturedBefore utility function.
This logic will be needed, for example, to perform noalias function parameter attribute inference.
No functionality change intended.
llvm-svn: 213519
show more ...
|
#
c782aa5a |
| 21-Jul-2014 |
Hal Finkel <hfinkel@anl.gov> |
Move isIdentifiedFunctionLocal from BasicAA to AA
The ability to identify function locals will exist outside of BasicAA (for example, logic for inferring noalias function arguments will need this),
Move isIdentifiedFunctionLocal from BasicAA to AA
The ability to identify function locals will exist outside of BasicAA (for example, logic for inferring noalias function arguments will need this), so make this concept generally accessible without code duplication.
No functionality change.
llvm-svn: 213514
show more ...
|
#
354e23b0 |
| 17-Jul-2014 |
Hal Finkel <hfinkel@anl.gov> |
Improve BasicAA CS-CS queries (redux)
This reverts, "r213024 - Revert r212572 "improve BasicAA CS-CS queries", it causes PR20303." with a fix for the bug in pr20303. As it turned out, the relevant c
Improve BasicAA CS-CS queries (redux)
This reverts, "r213024 - Revert r212572 "improve BasicAA CS-CS queries", it causes PR20303." with a fix for the bug in pr20303. As it turned out, the relevant code was both wrong and over-conservative (because, as with the code it replaced, it would return the overall ModRef mask even if just Ref had been implied by the argument aliasing results). Hopefully, this correctly fixes both problems.
Thanks to Nick Lewycky for reducing the test case for pr20303 (which I've cleaned up a little and added in DSE's test directory). The BasicAA test has also been updated to check for this error.
Original commit message:
BasicAA contains knowledge of certain intrinsics, such as memcpy and memset, and uses that information to form more-accurate answers to CallSite vs. Loc ModRef queries. Unfortunately, it did not use this information when answering CallSite vs. CallSite queries.
Generically, when an intrinsic takes one or more pointers and the intrinsic is marked only to read/write from its arguments, the offset/size is unknown. As a result, the generic code that answers CallSite vs. CallSite (and CallSite vs. Loc) queries in AA uses UnknownSize when forming Locs from an intrinsic's arguments. While BasicAA's CallSite vs. Loc override could use more-accurate size information for some intrinsics, it did not do the same for CallSite vs. CallSite queries.
This change refactors the intrinsic-specific logic in BasicAA into a generic AA query function: getArgLocation, which is overridden by BasicAA to supply the intrinsic-specific knowledge, and used by AA's generic implementation. This allows the intrinsic-specific knowledge to be used by both CallSite vs. Loc and CallSite vs. CallSite queries, and simplifies the BasicAA implementation.
Currently, only one function, Mac's memset_pattern16, is handled by BasicAA (all the rest are intrinsics). As a side-effect of this refactoring, BasicAA's getModRefBehavior override now also returns OnlyAccessesArgumentPointees for this function (which is an improvement).
llvm-svn: 213219
show more ...
|
#
7a63c3b3 |
| 15-Jul-2014 |
Nick Lewycky <nicholas@mxc.ca> |
Revert r212572 "improve BasicAA CS-CS queries", it causes PR20303.
llvm-svn: 213024
|
#
8ae0f8d6 |
| 08-Jul-2014 |
Hal Finkel <hfinkel@anl.gov> |
Improve BasicAA CS-CS queries
BasicAA contains knowledge of certain intrinsics, such as memcpy and memset, and uses that information to form more-accurate answers to CallSite vs. Loc ModRef queries.
Improve BasicAA CS-CS queries
BasicAA contains knowledge of certain intrinsics, such as memcpy and memset, and uses that information to form more-accurate answers to CallSite vs. Loc ModRef queries. Unfortunately, it did not use this information when answering CallSite vs. CallSite queries.
Generically, when an intrinsic takes one or more pointers and the intrinsic is marked only to read/write from its arguments, the offset/size is unknown. As a result, the generic code that answers CallSite vs. CallSite (and CallSite vs. Loc) queries in AA uses UnknownSize when forming Locs from an intrinsic's arguments. While BasicAA's CallSite vs. Loc override could use more-accurate size information for some intrinsics, it did not do the same for CallSite vs. CallSite queries.
This change refactors the intrinsic-specific logic in BasicAA into a generic AA query function: getArgLocation, which is overridden by BasicAA to supply the intrinsic-specific knowledge, and used by AA's generic implementation. This allows the intrinsic-specific knowledge to be used by both CallSite vs. Loc and CallSite vs. CallSite queries, and simplifies the BasicAA implementation.
Currently, only one function, Mac's memset_pattern16, is handled by BasicAA (all the rest are intrinsics). As a side-effect of this refactoring, BasicAA's getModRefBehavior override now also returns OnlyAccessesArgumentPointees for this function (which is an improvement).
llvm-svn: 212572
show more ...
|
Revision tags: llvmorg-3.4.2, llvmorg-3.4.2-rc1, llvmorg-3.4.1, llvmorg-3.4.1-rc2 |
|
#
9f008867 |
| 15-Apr-2014 |
Craig Topper <craig.topper@gmail.com> |
[C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr.
llvm-svn: 206243
|
Revision tags: llvmorg-3.4.1-rc1 |
|
#
e94a518a |
| 11-Mar-2014 |
Tim Northover <tnorthover@apple.com> |
IR: add a second ordering operand to cmpxhg for failure
The syntax for "cmpxchg" should now look something like:
cmpxchg i32* %addr, i32 42, i32 3 acquire monotonic
where the second ordering argu
IR: add a second ordering operand to cmpxhg for failure
The syntax for "cmpxchg" should now look something like:
cmpxchg i32* %addr, i32 42, i32 3 acquire monotonic
where the second ordering argument gives the required semantics in the case that no exchange takes place. It should be no stronger than the first ordering constraint and cannot be either "release" or "acq_rel" (since no store will have taken place).
rdar://problem/15996804
llvm-svn: 203559
show more ...
|
#
64e9aa5c |
| 05-Mar-2014 |
Chandler Carruth <chandlerc@gmail.com> |
[C++11] Make this interface accept const Use pointers and use override to ensure we don't mess up any of the overrides. Necessary for cleaning up the Value use iterators and enabling range-based trav
[C++11] Make this interface accept const Use pointers and use override to ensure we don't mess up any of the overrides. Necessary for cleaning up the Value use iterators and enabling range-based traversing of use lists.
llvm-svn: 202958
show more ...
|
#
e9ba759c |
| 05-Mar-2014 |
Craig Topper <craig.topper@gmail.com> |
[C++11] Add 'override' keyword to virtual methods that override their base class.
llvm-svn: 202945
|