Home | History | Annotate | Download | only in docs

Lines Matching full:alias

2 LLVM Alias Analysis Infrastructure
11 Alias Analysis (aka Pointer Analysis) is a class of techniques which attempt to
13 memory. There are many different algorithms for alias analysis and many
17 alias analyses respond to a query with a `Must, May, or No`_ alias response,
23 primary interface used by clients and implementations of alias analyses in the
24 LLVM system. This class is the common interface between clients of alias
27 are assumed to be flow-insensitive). In addition to simple alias analysis
41 class defines the interface that the various alias analysis implementations
43 ``ModRefResult`` which represent the result of an alias query or a mod/ref
61 used to query whether or not two memory objects alias, whether function calls
67 important for correct Alias Analyses. For example, consider this (silly, but
98 In this case, the two stores to C do alias each other, because the access to the
101 accesses alias.
105 The ``alias`` method
108 The ``alias`` method is the primary interface used to determine whether or not
109 two memory objects alias each other. It takes two memory objects as input and
112 Like all ``AliasAnalysis`` interfaces, the ``alias`` method requires that either
118 Must, May, and No Alias Responses
161 Several other tidbits of information are often collected by various alias
198 Writing a new alias analysis implementation for LLVM is quite straight-forward.
201 look at the `various alias analysis implementations`_ included with LLVM.
207 you need to use for your Alias Analysis. As is the case with most other
268 default to providing :ref:`chaining <aliasanalysis-chaining>` to another alias
270 information (returning "May" Alias and "Mod/Ref" for alias and mod/ref queries
280 every alias analysis pass chains to another alias analysis implementation (for
282 benefit from both alias analyses). The alias analysis class automatically
289 AliasResult alias(const Value *V1, unsigned V1Size,
295 // Couldn't determine a must or no-alias result.
296 return AliasAnalysis::alias(V1, V1Size, V2, V2Size);
301 which allows all alias analyses in a change to be updated.
308 Alias analysis information is initially computed for a static snapshot of the
310 code. All but the most trivial forms of alias analysis will need to have their
315 Various alias analysis implementations should use these methods to ensure that
317 example, when an instruction is deleted), and clients of alias analysis must be
325 use pointers). Typically alias analyses keep data structures that have entries
343 value, then deleting the old value. This method cannot be overridden by alias
366 alias analysis is to make sure that alias analysis **queries** are serviced
367 quickly. The actual calculation of the alias analysis results (the "run"
378 There is no way to override the default alias analysis. It would be very useful
393 classes, so if your alias analysis uses ``FunctionPass``, it won't be able to
395 route alias analysis queries directly to ``BasicAliasAnalysis`` instead.
398 pass, which prevents the use of ``FunctionPass`` alias analysis passes.
407 before it appears in an alias query. However, popular clients such as ``GVN``
412 ``AliasAnalysisCounter`` utility, collecting stats on all alias queries in a
418 non-deterministic number of alias queries. This can cause stats collected by
423 Many alias queries can be reformulated in terms of other alias queries. When
429 Using alias analysis results
432 There are several different ways to use alias analysis results. In order of
438 The ``memdep`` pass uses alias analysis to provide high-level dependence
448 Many transformations need information about alias **sets** that are active in
451 class is used to efficiently build these Alias Sets from the pairwise alias
456 interested in. Once all of the alias sets are completed, your pass should
457 simply iterate through the constructed alias sets, using the ``AliasSetTracker``
467 <doxygen/structLICM.html>`_ pass uses ``AliasSetTracker``\s to calculate alias
469 load instructions from that set may be hoisted out of the loop. If any alias
470 sets are stored to **and** are must alias sets, then the stores may be sunk
487 make merging alias sets extremely efficient (the linked list merge is constant
500 `alias`_ method directly if possible) to get the best precision and efficiency.
502 Existing alias analysis implementations and clients
505 If you're going to be working with the LLVM alias analysis infrastructure, you
506 should know what clients and implementations of alias analysis are available.
507 In particular, if you are implementing an alias analysis, you should be aware of
511 .. _various alias analysis implementations:
519 alias analysis implementations.
526 The ``-no-aa`` pass is just like what it sounds: an alias analysis that never
527 returns any useful information. This pass can be useful if you think that alias
536 * Distinct globals, stack allocations, and heap allocations can never alias.
537 * Globals, stack allocations, and heap allocations never alias the null pointer.
538 * Different fields of a structure do not alias.
539 * Indexes into arrays with statically differing subscripts cannot alias.
550 This pass implements a simple context-sensitive mod/ref and alias analysis for
552 does not have its address taken, the pass knows that no pointers alias the
571 algorithm" for interprocedural alias analysis. Steensgaard's algorithm is a
573 alias analysis that is also very scalable (effectively linear time).
590 context-**sensitive**, and speculatively field-**sensitive** alias
593 This algorithm is capable of responding to a full variety of alias analysis
595 only major facility not implemented so far is support for must-alias
608 ``getelementptr`` instructions and loop induction variables than other alias
611 Alias analysis driven transformations
614 LLVM includes several alias-analysis driven transformations which can be used
637 * If uses alias information to promote memory objects that are loaded and stored
647 uses alias information to make sure that the value loaded from the argument
661 These passes are useful for evaluating the various alias analysis
668 The ``-print-alias-sets`` pass
671 The ``-print-alias-sets`` pass is exposed as part of the ``opt`` tool to print
672 out the Alias Sets formed by the `AliasSetTracker`_ class. This is useful if
677 % opt -ds-aa -print-alias-sets -disable-output
683 making and what responses are returned by the alias analysis. As an example:
692 transformation or an alias analysis implementation.
698 function and asks an alias analysis whether or not the pointers alias. This
699 gives an indication of the precision of the alias analysis. Statistics are
706 If you're just looking to be a client of alias analysis information, consider
708 caching layer on top of alias analysis that is able to answer the question of
711 MemDep can be a significant performance win over accessing alias analysis