1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

183 Commits

Author SHA1 Message Date
Chandler Carruth
935258c90a [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
2015-06-04 02:03:15 +00:00
Daniel Berlin
f6799ad1b8 Move equality function for AliasAnalysis::Location from DenseMapInfo to Location struct so it can be used in other types of maps
llvm-svn: 236237
2015-04-30 16:15:07 +00:00
Daniel Berlin
f347b8bede Add new getModRefInfo API to determine whether an Instruction and a call modify the same memory
llvm-svn: 234814
2015-04-13 23:25:41 +00:00
Daniel Berlin
aae6ae7aa7 Common some code from MemoryDependenceAnalysis that will be used in MemorySSA
llvm-svn: 234813
2015-04-13 23:20:13 +00:00
Daniel Berlin
0dd1c441f1 Make getModRefInfo with a default location not crash.
Add getModRefInfo that works without location.
Add unit tests.

llvm-svn: 234811
2015-04-13 23:05:45 +00:00
Mehdi Amini
f88efe5f8a 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
2015-03-10 02:37:25 +00:00
Mehdi Amini
29ebc2d39f 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
2015-03-04 18:43:29 +00:00
Elena Demikhovsky
1560acad27 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
2014-12-15 14:09:53 +00:00
Benjamin Kramer
860521c88b Make AAMDNodes ctor and operator bool (!!!) explicit, mop up bugs and weirdness exposed by it.
llvm-svn: 219068
2014-10-04 22:44:29 +00:00
Hal Finkel
9be4aefa57 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
2014-07-24 12:16:19 +00:00
Hal Finkel
60f586ad81 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
2014-07-21 12:27:23 +00:00
Hal Finkel
9779454568 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
2014-07-17 01:28:25 +00:00
Nick Lewycky
91e41155de Revert r212572 "improve BasicAA CS-CS queries", it causes PR20303.
llvm-svn: 213024
2014-07-15 00:53:38 +00:00
Hal Finkel
ed72d81b90 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
2014-07-08 23:16:49 +00:00
Craig Topper
30281a67fb [C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr.
llvm-svn: 206142
2014-04-14 00:51:57 +00:00
Chandler Carruth
cfb81122cc [Modules] Move CallSite into the IR library where it belogs. It is
abstracting between a CallInst and an InvokeInst, both of which are IR
concepts.

llvm-svn: 202816
2014-03-04 11:01:28 +00:00
Rafael Espindola
d85e4eb0f5 Rename some member variables from TD to DL.
TargetData was renamed DataLayout back in r165242.

llvm-svn: 201581
2014-02-18 15:33:12 +00:00
Michael Kuperstein
ad5bd9ce5a Make BasicAliasAnalysis recognize the fact a noalias argument cannot alias another argument, even if the other argument is not itself marked noalias.
llvm-svn: 182755
2013-05-28 08:17:48 +00:00
Dan Gohman
6968f40e37 Move isKnownNonNull out of AliasAnalysis.h and into ValueTracking.cpp since
it isn't really an AliasAnalysis concept, and ValueTracking has similar things
that it could plausibly share code with some day.

llvm-svn: 174027
2013-01-31 02:40:59 +00:00
Jakub Staszak
f1ea1a7f37 Fix include guards so they exactly match file names.
llvm-svn: 172025
2013-01-10 00:45:19 +00:00
Sean Silva
ffc628ff80 Fix funky copy-pasted grammatical error.
PR14343

llvm-svn: 169742
2012-12-10 18:37:26 +00:00
Chandler Carruth
ca305491f6 Sort the #include lines for the include/... tree with the script.
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.

llvm-svn: 169133
2012-12-03 17:02:12 +00:00
Dan Gohman
c7892a6f58 Update comment for malloc being a library call now, rather than an instruction.
llvm-svn: 168946
2012-11-29 21:58:47 +00:00
Micah Villmow
bb1a25cd67 Move TargetData to DataLayout.
llvm-svn: 165402
2012-10-08 16:38:25 +00:00
Dan Gohman
e90f78d5cd Make provenance checking conservative in cases when
pointers-to-strong-pointers may be in play. These can lead to retains and
releases happening in unstructured ways, foiling the optimizer. This fixes
rdar://12150909.

llvm-svn: 163180
2012-09-04 23:16:20 +00:00
Benjamin Kramer
b92d13cc42 Make MemoryBuiltins aware of TargetLibraryInfo.
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.

llvm-svn: 162841
2012-08-29 15:32:21 +00:00
Chad Rosier
c3a90c47b9 Move the capture analysis from MemoryDependencyAnalysis to a more general place
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

llvm-svn: 156776
2012-05-14 20:35:04 +00:00
Nick Lewycky
dce2cfc335 Move isKnownNonNull from private implementation detail of BasicAA to a public
function that others can use, next to llvm::isIdentifiedObject.

llvm-svn: 151446
2012-02-25 10:56:28 +00:00
Nick Lewycky
a0e18fb857 Fix extra whitespace in comment.
llvm-svn: 142079
2011-10-15 19:36:45 +00:00
Eli Friedman
9c1a430966 Enhance alias analysis for atomic instructions a bit. Upgrade a couple alias-analysis tests to the new atomic instructions.
llvm-svn: 140557
2011-09-26 20:15:28 +00:00
Eli Friedman
6f2419f1a2 Misc optimizer+codegen work for 'cmpxchg' and 'atomicrmw'. They appear to be
working on x86 (at least for trivial testcases); other architectures will
need more work so that they actually emit the appropriate instructions for
orderings stricter than 'monotonic'. (As far as I can tell, the ARM, PPC,
Mips, and Alpha backends need such changes.)

llvm-svn: 136457
2011-07-29 03:05:32 +00:00
Eli Friedman
f226974353 Misc mid-level changes for new 'fence' instruction.
llvm-svn: 136205
2011-07-27 01:08:30 +00:00
Chris Lattner
e1fe7061ce land David Blaikie's patch to de-constify Type, with a few tweaks.
llvm-svn: 135375
2011-07-18 04:54:35 +00:00
Dan Gohman
edaf7c535a Fix BasicAA's recursion detection so that it doesn't pessimize
queries in the case of a DAG, where a query reaches a node
visited earlier, but it's not on a cycle. This avoids
MayAlias results in cases where BasicAA is expected to
return MustAlias or PartialAlias in order to protect TBAA.

llvm-svn: 132609
2011-06-04 00:31:50 +00:00
Jay Foad
c146569beb Remove unused STL header includes.
llvm-svn: 130068
2011-04-23 19:53:52 +00:00
Chris Lattner
71c356a8b0 fit in 80 cols
llvm-svn: 123085
2011-01-08 20:53:41 +00:00
Owen Anderson
a52e5dbdfa Stub out a new updating interface to AliasAnalysis, allowing stateful 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.

llvm-svn: 122777
2011-01-03 21:38:41 +00:00
Dan Gohman
9d1f5ce1da Introduce a new PartialAlias response for AliasAnalysis. For most
AliasAnalysis consumers, PartialAlias will be treated as MayAlias.

For AliasAnalysis chaining, MayAlias says "procede to the next analysis".
PartialAlias will be used to indicate that the query should terminate,
even though it didn't reach MustAlias or NoAlias.

llvm-svn: 121507
2010-12-10 19:38:58 +00:00
Chris Lattner
db6c348f31 Fix PR8728, a miscompilation I recently introduced. When optimizing
memcpy's like:
  memcpy(A, B)
  memcpy(A, C)

we cannot delete the first memcpy as dead if A and C might be aliases.
If so, we actually get:

  memcpy(A, B)
  memcpy(A, A)

which is not correct to transform into:

  memcpy(A, A)

This patch was heavily influenced by Jakub Staszak's patch in PR8728, thanks
Jakub!

llvm-svn: 120974
2010-12-06 01:48:06 +00:00
Chris Lattner
83445a6415 add a helper method.
llvm-svn: 120973
2010-12-06 01:01:28 +00:00
Chris Lattner
31d8d00187 death to extraneous \n's.
llvm-svn: 120405
2010-11-30 07:20:51 +00:00
Chris Lattner
cbe6b88afe getLocationForDest should work for memset as well.
llvm-svn: 120380
2010-11-30 01:48:20 +00:00
Chris Lattner
0d1afc82b2 the getLocationForSource/Dest methods can be static.
llvm-svn: 119929
2010-11-21 08:05:25 +00:00
Chris Lattner
a39a40d351 add "getLocation" method to AliasAnalysis for getting the source and
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.

llvm-svn: 119928
2010-11-21 07:51:27 +00:00
Dan Gohman
ac4c387e2d Document the units for the Size field.
llvm-svn: 119711
2010-11-18 17:39:01 +00:00
Dan Gohman
f3bf6591e0 Add helper functions for computing the Location of load, store,
and vaarg instructions.

llvm-svn: 118845
2010-11-11 21:50:19 +00:00
Dan Gohman
7c06994452 Add comments.
llvm-svn: 118799
2010-11-11 17:33:39 +00:00
Dan Gohman
503ad44b14 Add brief doxygen comments for AliasResult enum values.
llvm-svn: 118792
2010-11-11 16:37:38 +00:00
Dan Gohman
2b4e8302a6 Enhance GVN to do more precise alias queries for non-local memory
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];
    }
  }

llvm-svn: 118714
2010-11-10 20:37:15 +00:00
Dan Gohman
04e46fa78b Rename AccessesArguments and AccessesArgumentsReadonly, and rewrite
their comments.

llvm-svn: 118696
2010-11-10 18:30:00 +00:00
Dan Gohman
271a238243 Fix a copy+pasto Duncan noticed.
llvm-svn: 118693
2010-11-10 18:18:23 +00:00
Dan Gohman
65a3841f03 Add a doesAccessArgPointees helper function, and update code to use
it, and to be consistent.

llvm-svn: 118692
2010-11-10 18:17:28 +00:00
Dan Gohman
9ae50022a1 Factor out the code for testing whether a function accesses
arbitrary memory into a helper function, and adjust some comments.

llvm-svn: 118687
2010-11-10 17:34:04 +00:00
Dan Gohman
1571dfc883 Make ModRefBehavior a lattice. Use this to clean up AliasAnalysis
chaining and simplify FunctionAttrs' GetModRefBehavior logic.

llvm-svn: 118660
2010-11-10 01:02:18 +00:00
Dan Gohman
2a7e94d265 Convert comments to doxygen syntax.
llvm-svn: 118628
2010-11-09 20:33:57 +00:00
Dan Gohman
27fb58d9c7 AccessesArgumentsReadonly is read-only.
llvm-svn: 118615
2010-11-09 19:50:00 +00:00
Dan Gohman
d50f969460 Add a AccessesArgumentsReadonly ModRefBehavior value, so that the intrinsic
property IntrReadArgMem can be modeled.

llvm-svn: 118614
2010-11-09 19:48:55 +00:00
Dan Gohman
9bdf92c92c Factor out the logic for onlyReadsMemory into a helper function.
llvm-svn: 118611
2010-11-09 19:43:24 +00:00
Dan Gohman
3de0bd24db Delete AccessesArgumentsAndGlobals, which was unused.
llvm-svn: 118610
2010-11-09 19:41:37 +00:00
Dan Gohman
227bf9fea9 Add some comments noting some correspondences between ModRefBehavior
values, LLVM IR function attributes, and LLVM intrinsic attributes.

llvm-svn: 118455
2010-11-08 23:46:02 +00:00
Dan Gohman
6909ecf66e Extend the AliasAnalysis::pointsToConstantMemory interface to allow it
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
2010-11-08 16:45:26 +00:00
Dan Gohman
ee58dba24c Delete getIntrinsicModRefBehavior. Clients can just use the normal
getModRefBehavior now, since it now understands intrinsics as well
as normal functions.

llvm-svn: 118411
2010-11-08 16:11:19 +00:00
Dan Gohman
c3202f8550 Add comments.
llvm-svn: 118408
2010-11-08 15:34:42 +00:00
Dan Gohman
399ef0b44a Move NoAA out of BasicAliasAnalysis.cpp into its own file, now that
it doesn't have a special relationship with BasicAliasAnalysis
anymore.

llvm-svn: 116876
2010-10-19 23:09:08 +00:00
Dan Gohman
befe1767ff Reapply r116831 and r116839, converting AliasAnalysis to use
uint64_t, plus fixes for places I missed before.

llvm-svn: 116875
2010-10-19 22:54:46 +00:00
Dan Gohman
de3c49438f Revert r116831 and r116839, which are breaking selfhost builds.
llvm-svn: 116858
2010-10-19 21:06:16 +00:00
Dan Gohman
37a9b813f5 Oops, check in all the files for converting AliasAnalysis to
use uint64_t.

llvm-svn: 116839
2010-10-19 18:08:27 +00:00
Dan Gohman
008676d2ee Add some utility routines.
llvm-svn: 114483
2010-09-21 21:20:13 +00:00
Dan Gohman
ebbc4df924 Remove the experimental AliasAnalysis::getDependency interface, which
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
2010-09-14 21:25:10 +00:00
Dan Gohman
7fbaed00bf Extend the getDependence query with support for PHI translation.
llvm-svn: 113521
2010-09-09 18:37:31 +00:00
Dan Gohman
e1fb5b5738 Fix this comment.
llvm-svn: 113511
2010-09-09 18:04:22 +00:00
Dan Gohman
de56ae353b Add a new experimental generalized dependence query interface to
AliasAnalysis, and some code for implementing the new query on top of
existing implementations by making standard alias and getModRefInfo
queries.

llvm-svn: 113329
2010-09-08 01:32:20 +00:00
Dan Gohman
6d4356d31f Tidy up the getModRefInfo declarations.
llvm-svn: 113275
2010-09-07 20:37:47 +00:00
Dan Gohman
d261381db5 Update the descriptions of NoModRef and ModRef to be consistent
with the descriptions of Mod and Ref.

llvm-svn: 112557
2010-08-30 23:47:24 +00:00
Dan Gohman
da3f592fb3 Implement a proper getModRefInfo for va_arg.
llvm-svn: 110458
2010-08-06 18:24:38 +00:00
Dan Gohman
66b637e4da Add a comment.
llvm-svn: 110426
2010-08-06 02:04:07 +00:00
Dan Gohman
ecf79cf569 Make AA private, since subclasses shouldn't (aren't don't) access it directly.
llvm-svn: 110398
2010-08-05 23:44:45 +00:00
Dan Gohman
9ded12adcb Delete obsolete comments.
llvm-svn: 110277
2010-08-04 23:08:15 +00:00
Dan Gohman
aac19e4ffe Remove PointerAccessInfo, which nothing was using.
llvm-svn: 110167
2010-08-03 23:08:10 +00:00
Dan Gohman
a087b90950 Thread const correctness through a bunch of AliasAnalysis interfaces and
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
2010-08-03 21:48:53 +00:00
Dan Gohman
aabb615d52 Update some comments.
llvm-svn: 110092
2010-08-03 01:07:32 +00:00
Dan Gohman
6604a72154 Introduce a symbolic constant for ~0u for use with AliasAnalysis.
llvm-svn: 110091
2010-08-03 01:03:11 +00:00
Dan Gohman
e0489ffe8e Add a convenient form of AliasAnalysis::alias for the case where the sizes
are unknown.

llvm-svn: 110090
2010-08-03 00:56:30 +00:00
Dan Gohman
2a08e2ce81 Remove interprocedural-basic-aa and associated code. The AliasAnalysis
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
2010-07-07 14:27:09 +00:00
Dan Gohman
6a179b2376 Remove an unused enum.
llvm-svn: 107507
2010-07-02 20:20:50 +00:00
Dan Gohman
37bf33ccff Add an Intraprocedural form of BasicAliasAnalysis, which aims to
properly handles instructions and arguments defined in different
functions, or across recursive function iterations.

llvm-svn: 107109
2010-06-29 00:50:39 +00:00
Duncan Sands
4ef1119d94 Partially address a README by having functionattrs consider calls to
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
2010-01-06 08:45:52 +00:00
Chris Lattner
51f6279013 add a helper
llvm-svn: 89662
2009-11-23 16:38:54 +00:00
Chris Lattner
b6ecd40652 Remove the AliasAnalysis::getMustAliases method, which is dead.
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
2009-11-22 16:01:44 +00:00
Dan Gohman
a318ec22f2 Global Aliases are not identifiable objects.
llvm-svn: 80263
2009-08-27 17:52:56 +00:00
Dan Gohman
acc5d6eaae Make AliasAnalysis and related classes use
getAnalysisIfAvailable<TargetData>().

llvm-svn: 77028
2009-07-25 00:48:42 +00:00
Duncan Sands
9335c884e3 Correct a comment: since AccessArguments is now
being used for atomic intrinsics, it seems the
access may be volatile.  No code was exploiting
the original non-volatile definition, so only
the comment needs changing.

llvm-svn: 64464
2009-02-13 17:36:13 +00:00
Owen Anderson
acbec98578 Refactor my previous change to maintain the distinction between AliasAnalysis and BasicAliasAnalysis. This involves some wider changes because it
folds away some never-used methods.

llvm-svn: 63900
2009-02-05 23:36:27 +00:00
Dan Gohman
bf5427a7f0 Move isIdentifiedObject and isNoAliasCall into AliasAnalysis.cpp since
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
2009-02-03 01:28:32 +00:00
Dan Gohman
50283ce80b Fix a post-RA scheduling dependency bug.
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
2009-01-30 02:49:14 +00:00
Dan Gohman
862974638a Update comments. There is no getArgumentAccesses.
llvm-svn: 60585
2008-12-05 05:35:21 +00:00
Evan Cheng
ce2c3b07ba Revert 51775.
llvm-svn: 51795
2008-05-30 22:47:19 +00:00
Evan Cheng
8ebaae9d1c Patches for building llvm on Solaris x86. Contributed by Nathan Keynes.
llvm-svn: 51775
2008-05-30 17:16:20 +00:00
Dan Gohman
e587db7187 Fix doxygen comment syntax.
llvm-svn: 51716
2008-05-30 00:01:36 +00:00
Chris Lattner
e0b1ee937a Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.  Boy are my fingers tired. ;-)

llvm-svn: 45411
2007-12-29 19:59:42 +00:00