1
- // ===- CFLAliasAnalysis .h - CFL-Based Alias Analysis Interface ---*- C++ -*-= =//
1
+ // =- CFLSteensAliasAnalysis .h - Unification-based Alias Analysis ---*- C++-*-=//
2
2
//
3
3
// The LLVM Compiler Infrastructure
4
4
//
7
7
//
8
8
// ===----------------------------------------------------------------------===//
9
9
// / \file
10
- // / This is the interface for LLVM's primary stateless and local alias analysis.
10
+ // / This is the interface for LLVM's unification-based alias analysis
11
+ // / implemented with CFL graph reachability.
11
12
// /
12
13
// ===----------------------------------------------------------------------===//
13
14
14
- #ifndef LLVM_ANALYSIS_CFLALIASANALYSIS_H
15
- #define LLVM_ANALYSIS_CFLALIASANALYSIS_H
15
+ #ifndef LLVM_ANALYSIS_CFLSTEENSALIASANALYSIS_H
16
+ #define LLVM_ANALYSIS_CFLSTEENSALIASANALYSIS_H
16
17
17
18
#include " llvm/ADT/DenseMap.h"
18
19
#include " llvm/ADT/None.h"
@@ -28,14 +29,14 @@ namespace llvm {
28
29
29
30
class TargetLibraryInfo ;
30
31
31
- class CFLAAResult : public AAResultBase <CFLAAResult > {
32
- friend AAResultBase<CFLAAResult >;
32
+ class CFLSteensAAResult : public AAResultBase <CFLSteensAAResult > {
33
+ friend AAResultBase<CFLSteensAAResult >;
33
34
class FunctionInfo ;
34
35
35
36
public:
36
- explicit CFLAAResult (const TargetLibraryInfo &);
37
- CFLAAResult (CFLAAResult &&Arg);
38
- ~CFLAAResult ();
37
+ explicit CFLSteensAAResult (const TargetLibraryInfo &);
38
+ CFLSteensAAResult (CFLSteensAAResult &&Arg);
39
+ ~CFLSteensAAResult ();
39
40
40
41
// / Handle invalidation events from the new pass manager.
41
42
// /
@@ -59,10 +60,9 @@ class CFLAAResult : public AAResultBase<CFLAAResult> {
59
60
60
61
// Comparisons between global variables and other constants should be
61
62
// handled by BasicAA.
62
- // TODO: ConstantExpr handling -- CFLAA may report NoAlias when comparing
63
- // a GlobalValue and ConstantExpr, but every query needs to have at least
64
- // one Value tied to a Function, and neither GlobalValues nor ConstantExprs
65
- // are.
63
+ // CFLSteensAA may report NoAlias when comparing a GlobalValue and
64
+ // ConstantExpr, but every query needs to have at least one Value tied to a
65
+ // Function, and neither GlobalValues nor ConstantExprs are.
66
66
if (isa<Constant>(LocA.Ptr ) && isa<Constant>(LocB.Ptr ))
67
67
return AAResultBase::alias (LocA, LocB);
68
68
@@ -85,7 +85,7 @@ class CFLAAResult : public AAResultBase<CFLAAResult> {
85
85
86
86
private:
87
87
struct FunctionHandle final : public CallbackVH {
88
- FunctionHandle (Function *Fn, CFLAAResult *Result)
88
+ FunctionHandle (Function *Fn, CFLSteensAAResult *Result)
89
89
: CallbackVH(Fn), Result(Result) {
90
90
assert (Fn != nullptr );
91
91
assert (Result != nullptr );
@@ -95,7 +95,7 @@ class CFLAAResult : public AAResultBase<CFLAAResult> {
95
95
void allUsesReplacedWith (Value *) override { removeSelfFromCache (); }
96
96
97
97
private:
98
- CFLAAResult *Result;
98
+ CFLSteensAAResult *Result;
99
99
100
100
void removeSelfFromCache () {
101
101
assert (Result != nullptr );
@@ -122,38 +122,38 @@ class CFLAAResult : public AAResultBase<CFLAAResult> {
122
122
// /
123
123
// / FIXME: We really should refactor CFL to use the analysis more heavily, and
124
124
// / in particular to leverage invalidation to trigger re-computation of sets.
125
- class CFLAA : public AnalysisInfoMixin <CFLAA > {
126
- friend AnalysisInfoMixin<CFLAA >;
125
+ class CFLSteensAA : public AnalysisInfoMixin <CFLSteensAA > {
126
+ friend AnalysisInfoMixin<CFLSteensAA >;
127
127
static char PassID;
128
128
129
129
public:
130
- typedef CFLAAResult Result;
130
+ typedef CFLSteensAAResult Result;
131
131
132
- CFLAAResult run (Function &F, AnalysisManager<Function> &AM);
132
+ CFLSteensAAResult run (Function &F, AnalysisManager<Function> &AM);
133
133
};
134
134
135
- // / Legacy wrapper pass to provide the CFLAAResult object.
136
- class CFLAAWrapperPass : public ImmutablePass {
137
- std::unique_ptr<CFLAAResult > Result;
135
+ // / Legacy wrapper pass to provide the CFLSteensAAResult object.
136
+ class CFLSteensAAWrapperPass : public ImmutablePass {
137
+ std::unique_ptr<CFLSteensAAResult > Result;
138
138
139
139
public:
140
140
static char ID;
141
141
142
- CFLAAWrapperPass ();
142
+ CFLSteensAAWrapperPass ();
143
143
144
- CFLAAResult &getResult () { return *Result; }
145
- const CFLAAResult &getResult () const { return *Result; }
144
+ CFLSteensAAResult &getResult () { return *Result; }
145
+ const CFLSteensAAResult &getResult () const { return *Result; }
146
146
147
147
void initializePass () override ;
148
148
void getAnalysisUsage (AnalysisUsage &AU) const override ;
149
149
};
150
150
151
151
// ===--------------------------------------------------------------------===//
152
152
//
153
- // createCFLAAWrapperPass - This pass implements a set-based approach to
153
+ // createCFLSteensAAWrapperPass - This pass implements a set-based approach to
154
154
// alias analysis.
155
155
//
156
- ImmutablePass *createCFLAAWrapperPass ();
156
+ ImmutablePass *createCFLSteensAAWrapperPass ();
157
157
}
158
158
159
159
#endif
0 commit comments