From 294611a6e4ddf4caf48699fe8c34b0c7ba72e932 Mon Sep 17 00:00:00 2001
From: Misha Brukman s * Wrap lines
at 80 cols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15311 91177308-0d34-0410-b5e6-96231b3b80d8
---
docs/AliasAnalysis.html | 119 +++++++++++++++++++++-------------------
1 file changed, 64 insertions(+), 55 deletions(-)
diff --git a/docs/AliasAnalysis.html b/docs/AliasAnalysis.html
index 10227fb90a5..d137ffe5f39 100644
--- a/docs/AliasAnalysis.html
+++ b/docs/AliasAnalysis.html
@@ -134,16 +134,18 @@ symbolic LLVM Value*) and a static size. In this case, the basicaa pass will disambiguate the stores to
C[0] and C[1] because they are accesses to two distinct
@@ -151,16 +153,18 @@ locations one byte apart, and the accesses are each one byte. In this case, the
LICM pass can use store motion to remove the stores from the loop. In
constrast, the following code: In this case, the two stores to C do alias each other, because the access to
the &C[0] element is a two byte access. If size information wasn't
@@ -361,25 +365,29 @@ the AliasAnalysis base class: getAnalysisUsage and
declaring any pass dependencies your pass has. Thus you should have something
like this: Additionally, your must invoke the InitializeAliasAnalysis method
from your analysis run method (run for a Pass,
runOnFunction for a FunctionPass, or InitializePass
for an ImmutablePass). For example (as part of a Pass):
- int i;
- char C[2];
- char A[10];
- /* ... */
- for (i = 0; i != 10; ++i) {
- C[0] = A[i]; /* One byte store */
- C[1] = A[9-i]; /* One byte store */
- }
+int i;
+char C[2];
+char A[10];
+/* ... */
+for (i = 0; i != 10; ++i) {
+ C[0] = A[i]; /* One byte store */
+ C[1] = A[9-i]; /* One byte store */
+}
+
- int i;
- char C[2];
- char A[10];
- /* ... */
- for (i = 0; i != 10; ++i) {
- ((short*)C)[0] = A[i]; /* Two byte store! */
- C[1] = A[9-i]; /* One byte store */
- }
+int i;
+char C[2];
+char A[10];
+/* ... */
+for (i = 0; i != 10; ++i) {
+ ((short*)C)[0] = A[i]; /* Two byte store! */
+ C[1] = A[9-i]; /* One byte store */
+}
+
- void getAnalysisUsage(AnalysisUsage &AU) const {
- AliasAnalysis::getAnalysisUsage(AU);
- // declare your dependencies here.
- }
+void getAnalysisUsage(AnalysisUsage &AU) const {
+ AliasAnalysis::getAnalysisUsage(AU);
+ // declare your dependencies here.
+}
+
- bool run(Module &M) {
- InitializeAliasAnalysis(this);
- // Perform analysis here...
- return false;
- }
+bool run(Module &M) {
+ InitializeAliasAnalysis(this);
+ // Perform analysis here...
+ return false;
+}
+
- AliasAnalysis::AliasResult alias(const Value *V1, unsigned V1Size, - const Value *V2, unsigned V2Size) { - if (...) - return NoAlias; - ... - - // Couldn't determine a must or no-alias result. - return AliasAnalysis::alias(V1, V1Size, V2, V2Size); - } +AliasAnalysis::AliasResult alias(const Value *V1, unsigned V1Size, + const Value *V2, unsigned V2Size) { + if (...) + return NoAlias; + ... + + // Couldn't determine a must or no-alias result. + return AliasAnalysis::alias(V1, V1Size, V2, V2Size); +}+
In addition to analysis queries, you must make sure to unconditionally pass LLVM update notification methods to the superclass as @@ -473,7 +483,6 @@ for each value in the program. When this method is called, they should remove any entries for the specified value, if they exist. -
Many transformations need information about alias sets that are active in some scope, rather than information about pairwise aliasing. The AliasSetTracker class is used -to efficiently build these Alias Sets from the pairwise alias analysis +href="/doxygen/classllvm_1_1AliasSetTracker.html">AliasSetTracker class +is used to efficiently build these Alias Sets from the pairwise alias analysis information provided by the AliasAnalysis interface.
First you initialize the AliasSetTracker by using the "add" methods @@ -602,7 +610,6 @@ are.
-
-The -load-vn pass uses alias analysis to "value
+
+ The -load-vn pass uses alias analysis to "value
number" loads and pointers values, which is used by the GCSE pass to
eliminate instructions. The -load-vn pass relies on alias information
and must-alias information. This combination of passes can make the following
@@ -864,18 +870,19 @@ calls into direct calls.
These passes are useful for evaluating the various alias analysis implementations. You can use them with commands like 'opt -anders-aa -ds-aa --aa-eval foo.bc -disable-output -stats'. +-aa-eval foo.bc -disable-output -stats'.
+The -count-aa pass is useful to see how many queries a particular -pass is making and what responses are returned by the alias analysis. An -example usage is:
+pass is making and what responses are returned by the alias analysis. As an +example, +- $ opt -basicaa -count-aa -ds-aa -count-aa -licm +% opt -basicaa -count-aa -ds-aa -count-aa -licm+
Which will print out how many queries (and what responses are returned) by -the -licm pass (of the -ds-aa pass) and how many queries are -made of the -basicaa pass by the -ds-aa pass. This can be -useful when debugging a transformation or an alias analysis implementation.
+will print out how many queries (and what responses are returned) by the +-licm pass (of the -ds-aa pass) and how many queries are made +of the -basicaa pass by the -ds-aa pass. This can be useful +when debugging a transformation or an alias analysis implementation.