LLVM  3.7.0
Macros | Enumerations | Functions
CFLAliasAnalysis.cpp File Reference
#include "StratifiedSets.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/Optional.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/Passes.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/InstVisitor.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/ValueHandle.h"
#include "llvm/Pass.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <forward_list>
#include <memory>
#include <tuple>
#include "llvm/IR/Instruction.def"
Include dependency graph for CFLAliasAnalysis.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "cfl-aa"
 
#define HANDLE_INST(NUM, OPCODE, CLASS)
 

Enumerations

enum  Level
 
enum  EdgeType
 

Functions

static Optional< Function * > parentFunctionOfValue (Value *)
 
template<typename Inst >
static bool getPossibleTargets (Inst *, SmallVectorImpl< Function * > &)
 
static Optional< Value * > getTargetValue (Instruction *)
 
static bool hasUsefulEdges (Instruction *)
 
 INITIALIZE_AG_PASS (CFLAliasAnalysis, AliasAnalysis,"cfl-aa","CFL-Based AA implementation", false, true, false) ImmutablePass *llvm
 
static StratifiedAttr argNumberToAttrIndex (StratifiedAttr)
 
static Optional< StratifiedAttr > valueToAttrIndex (Value *Val)
 
static EdgeType flipWeight (EdgeType)
 
static void argsToEdges (CFLAliasAnalysis &, Instruction *, SmallVectorImpl< Edge > &)
 
static void argsToEdges (CFLAliasAnalysis &, ConstantExpr *, SmallVectorImpl< Edge > &)
 
static Level directionOfEdgeType (EdgeType)
 
static void buildGraphFrom (CFLAliasAnalysis &, Function *, SmallVectorImpl< Value * > &, NodeMapT &, GraphT &)
 
static void constexprToEdges (CFLAliasAnalysis &, ConstantExpr &, SmallVectorImpl< Edge > &)
 
static void addInstructionToGraph (CFLAliasAnalysis &, Instruction &, SmallVectorImpl< Value * > &, NodeMapT &, GraphT &)
 
static bool canSkipAddingToSets (Value *Val)
 
static FunctionInfo buildSetsFrom (CFLAliasAnalysis &, Function *)
 
static bool hasUsefulEdges (ConstantExpr *CE)
 
static StratifiedAttr argNumberToAttrIndex (unsigned ArgNum)
 

Macro Definition Documentation

#define DEBUG_TYPE   "cfl-aa"

Definition at line 56 of file CFLAliasAnalysis.cpp.

#define HANDLE_INST (   NUM,
  OPCODE,
  CLASS 
)
Value:
visit##OPCODE(*(CLASS *)CE); \
break;
#define OPCODE(NAME)

Enumeration Type Documentation

enum EdgeType
strong

Definition at line 104 of file CFLAliasAnalysis.cpp.

enum Level
strong

Definition at line 100 of file CFLAliasAnalysis.cpp.

Function Documentation

static void addInstructionToGraph ( CFLAliasAnalysis &  Analysis,
Instruction Inst,
SmallVectorImpl< Value * > &  ReturnedValues,
NodeMapT &  Map,
GraphT &  Graph 
)
static
static StratifiedAttr argNumberToAttrIndex ( StratifiedAttr  )
static

Referenced by valueToAttrIndex().

static StratifiedAttr argNumberToAttrIndex ( unsigned  ArgNum)
static

Definition at line 847 of file CFLAliasAnalysis.cpp.

static void argsToEdges ( CFLAliasAnalysis &  Analysis,
Instruction Inst,
SmallVectorImpl< Edge > &  Output 
)
static

Definition at line 865 of file CFLAliasAnalysis.cpp.

References hasUsefulEdges().

Referenced by addInstructionToGraph(), and constexprToEdges().

static void argsToEdges ( CFLAliasAnalysis &  Analysis,
ConstantExpr CE,
SmallVectorImpl< Edge > &  Output 
)
static

Definition at line 873 of file CFLAliasAnalysis.cpp.

References hasUsefulEdges().

static void buildGraphFrom ( CFLAliasAnalysis &  Analysis,
Function Fn,
SmallVectorImpl< Value * > &  ReturnedValues,
NodeMapT &  Map,
GraphT &  Graph 
)
static

Definition at line 985 of file CFLAliasAnalysis.cpp.

References addInstructionToGraph(), and llvm::Function::getBasicBlockList().

Referenced by buildSetsFrom().

static FunctionInfo buildSetsFrom ( CFLAliasAnalysis &  Analysis,
Function Fn 
)
static
static bool canSkipAddingToSets ( Value Val)
static

Definition at line 993 of file CFLAliasAnalysis.cpp.

Referenced by buildSetsFrom().

static void constexprToEdges ( CFLAliasAnalysis &  Analysis,
ConstantExpr CExprToCollapse,
SmallVectorImpl< Edge > &  Results 
)
static
static Level directionOfEdgeType ( EdgeType  Weight)
static

Definition at line 880 of file CFLAliasAnalysis.cpp.

References llvm_unreachable.

Referenced by buildSetsFrom().

static EdgeType flipWeight ( EdgeType  Initial)
static

Definition at line 853 of file CFLAliasAnalysis.cpp.

References llvm_unreachable.

Referenced by addInstructionToGraph().

template<typename Inst >
static bool getPossibleTargets ( Inst *  Call,
SmallVectorImpl< Function * > &  Output 
)
static
static Optional< Value * > getTargetValue ( Instruction Inst)
static

Definition at line 816 of file CFLAliasAnalysis.cpp.

Referenced by addInstructionToGraph().

static bool hasUsefulEdges ( Instruction Inst)
static

Definition at line 821 of file CFLAliasAnalysis.cpp.

Referenced by addInstructionToGraph(), argsToEdges(), and constexprToEdges().

static bool hasUsefulEdges ( ConstantExpr CE)
static

Definition at line 827 of file CFLAliasAnalysis.cpp.

References llvm::ConstantExpr::getOpcode().

INITIALIZE_AG_PASS ( CFLAliasAnalysis  ,
AliasAnalysis  ,
"cfl-aa ,
"CFL-Based AA implementation"  ,
false  ,
true  ,
false   
)

Definition at line 733 of file CFLAliasAnalysis.cpp.

static Optional< Function * > parentFunctionOfValue ( Value Val)
static
static Optional< StratifiedAttr > valueToAttrIndex ( Value Val)
static

Definition at line 834 of file CFLAliasAnalysis.cpp.

References argNumberToAttrIndex().

Referenced by buildSetsFrom().