LLVM  6.0.0svn
Functions | Variables
TypeBasedAliasAnalysis.cpp File Reference
#include "llvm/Analysis/TypeBasedAliasAnalysis.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/MemoryLocation.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Metadata.h"
#include "llvm/Pass.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ErrorHandling.h"
#include <cassert>
#include <cstdint>
Include dependency graph for TypeBasedAliasAnalysis.cpp:

Go to the source code of this file.

Functions

static bool isStructPathTBAA (const MDNode *MD)
 Check the first operand of the tbaa tag node, if it is a MDNode, we treat it as struct-path aware TBAA format, otherwise, we treat it as scalar TBAA format. More...
 
static bool matchAccessTags (const MDNode *A, const MDNode *B, const MDNode **GenericTag)
 matchTags - Return true if the given couple of accesses are allowed to overlap. More...
 
static const MDNodegetLeastCommonType (const MDNode *A, const MDNode *B)
 
static bool findAccessType (TBAAStructTagNode BaseTag, const MDNode *AccessTypeNode, uint64_t &OffsetInBase)
 
static const MDNodecreateAccessTag (const MDNode *AccessType)
 
 INITIALIZE_PASS (TypeBasedAAWrapperPass, "tbaa", "Type-Based Alias Analysis", false, true) ImmutablePass *llvm
 

Variables

static cl::opt< boolEnableTBAA ("enable-tbaa", cl::init(true))
 

Function Documentation

◆ createAccessTag()

static const MDNode* createAccessTag ( const MDNode AccessType)
static

◆ findAccessType()

static bool findAccessType ( TBAAStructTagNode  BaseTag,
const MDNode AccessTypeNode,
uint64_t &  OffsetInBase 
)
static

Definition at line 488 of file TypeBasedAliasAnalysis.cpp.

Referenced by matchAccessTags().

◆ getLeastCommonType()

static const MDNode* getLeastCommonType ( const MDNode A,
const MDNode B 
)
static

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( TypeBasedAAWrapperPass  ,
"tbaa"  ,
"Type-Based Alias Analysis ,
false  ,
true   
)

Definition at line 585 of file TypeBasedAliasAnalysis.cpp.

◆ isStructPathTBAA()

static bool isStructPathTBAA ( const MDNode MD)
static

Check the first operand of the tbaa tag node, if it is a MDNode, we treat it as struct-path aware TBAA format, otherwise, we treat it as scalar TBAA format.

Definition at line 306 of file TypeBasedAliasAnalysis.cpp.

References llvm::MDNode::getNumOperands(), and llvm::MDNode::getOperand().

Referenced by llvm::TypeBasedAAResult::getModRefBehavior(), llvm::MDNode::isTBAAVtableAccess(), matchAccessTags(), and llvm::TypeBasedAAResult::pointsToConstantMemory().

◆ matchAccessTags()

static bool matchAccessTags ( const MDNode A,
const MDNode B,
const MDNode **  GenericTag 
)
static

matchTags - Return true if the given couple of accesses are allowed to overlap.

If

  • GenericTag is not null, then on return it points to the most generic access descriptor for the given two.

Definition at line 524 of file TypeBasedAliasAnalysis.cpp.

References assert(), createAccessTag(), findAccessType(), getLeastCommonType(), and isStructPathTBAA().

Referenced by llvm::MDNode::getMostGenericTBAA(), and llvm::MDNode::isTBAAVtableAccess().

Variable Documentation

◆ EnableTBAA

cl::opt<bool> EnableTBAA("enable-tbaa", cl::init(true))
static