blob: 8db2051d6731b1595079f72251ac6a96d4c7b667 [file] [log] [blame]
George Burgess IVbfa401e2016-07-06 00:26:41 +00001//- CFLAndersAliasAnalysis.cpp - Unification-based Alias Analysis ---*- C++-*-//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file implements a CFL-based, summary-based alias analysis algorithm. It
11// differs from CFLSteensAliasAnalysis in its inclusion-based nature while
12// CFLSteensAliasAnalysis is unification-based. This pass has worse performance
13// than CFLSteensAliasAnalysis (the worst case complexity of
14// CFLAndersAliasAnalysis is cubic, while the worst case complexity of
15// CFLSteensAliasAnalysis is almost linear), but it is able to yield more
16// precise analysis result. The precision of this analysis is roughly the same
17// as that of an one level context-sensitive Andersen's algorithm.
18//
19//===----------------------------------------------------------------------===//
20
21// N.B. AliasAnalysis as a whole is phrased as a FunctionPass at the moment, and
22// CFLAndersAA is interprocedural. This is *technically* A Bad Thing, because
23// FunctionPasses are only allowed to inspect the Function that they're being
24// run on. Realistically, this likely isn't a problem until we allow
25// FunctionPasses to run concurrently.
26
27#include "llvm/Analysis/CFLAndersAliasAnalysis.h"
28#include "llvm/Pass.h"
29
30using namespace llvm;
31
32#define DEBUG_TYPE "cfl-anders-aa"
33
34CFLAndersAAResult::CFLAndersAAResult() = default;
35
36char CFLAndersAA::PassID;
37
38CFLAndersAAResult CFLAndersAA::run(Function &F, AnalysisManager<Function> &AM) {
39 return CFLAndersAAResult();
40}
41
42char CFLAndersAAWrapperPass::ID = 0;
43INITIALIZE_PASS(CFLAndersAAWrapperPass, "cfl-anders-aa",
44 "Inclusion-Based CFL Alias Analysis", false, true)
45
46ImmutablePass *llvm::createCFLAndersAAWrapperPass() {
47 return new CFLAndersAAWrapperPass();
48}
49
50CFLAndersAAWrapperPass::CFLAndersAAWrapperPass() : ImmutablePass(ID) {
51 initializeCFLAndersAAWrapperPassPass(*PassRegistry::getPassRegistry());
52}
53
54void CFLAndersAAWrapperPass::initializePass() {}
55
56void CFLAndersAAWrapperPass::getAnalysisUsage(AnalysisUsage &AU) const {
57 AU.setPreservesAll();
58}