1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

100 Commits

Author SHA1 Message Date
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