Enzyme main
Loading...
Searching...
No Matches
TBAA.h File Reference
#include "BaseType.h"
#include "ConcreteType.h"
#include "TypeTree.h"
Include dependency graph for TBAA.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  TBAANodeImpl< MDNodeTy >
 This is a simple wrapper around an llvm::MDNode which provides a higher-level interface by hiding the details of how alias analysis information is encoded in its operands. More...
 
class  TBAAStructTagNodeImpl< MDNodeTy >
 This is a simple wrapper around an llvm::MDNode which provides a higher-level interface by hiding the details of how alias analysis information is encoded in its operands. More...
 
class  TBAAStructTypeNode
 This is a simple wrapper around an llvm::MDNode which provides a higher-level interface by hiding the details of how alias analysis information is encoded in its operands. More...
 

Typedefs

Specializations of \c TBAANodeImpl for const and non const qualified

MDNode.

using TBAANode = TBAANodeImpl<const llvm::MDNode>
 
using MutableTBAANode = TBAANodeImpl<llvm::MDNode>
 
Specializations of \c TBAAStructTagNodeImpl for const and non const

qualified MDNods.

using TBAAStructTagNode = TBAAStructTagNodeImpl<const llvm::MDNode>
 
using MutableTBAAStructTagNode = TBAAStructTagNodeImpl<llvm::MDNode>
 

Functions

static bool isNewFormatTypeNode (const llvm::MDNode *N)
 isNewFormatTypeNode - Return true iff the given type node is in the new size-aware format.
 
static bool isStructPathTBAA (const llvm::MDNode *MD)
 Check the first operand of the tbaa tag node, if it is a llvm::MDNode, we treat it as struct-path aware TBAA format, otherwise, we treat it as scalar TBAA format.
 
static const llvm::MDNode * createAccessTag (const llvm::MDNode *AccessType)
 
static std::string getAccessNameTBAA (const llvm::MDNode *M, const std::set< std::string > &legalnames)
 
static std::string getAccessNameTBAA (llvm::Instruction *Inst, const std::set< std::string > &legalnames)
 
static ConcreteType getTypeFromTBAAString (std::string TypeName, llvm::Instruction &I, std::shared_ptr< llvm::ModuleSlotTracker > MST)
 Derive the ConcreteType corresponding to the string TypeName The llvm::Instruction I denotes the context in which this was found.
 
static TypeTree parseTBAA (TBAAStructTypeNode AccessType, llvm::Instruction &I, const llvm::DataLayout &DL, std::shared_ptr< llvm::ModuleSlotTracker > MST)
 Given a TBAA access node return the corresponding TypeTree This includes recursively parsing the access nodes, with corresponding offsets in the result.
 
static TypeTree parseTBAA (const llvm::MDNode *M, llvm::Instruction &I, const llvm::DataLayout &DL, std::shared_ptr< llvm::ModuleSlotTracker > MST)
 Given a TBAA metadata node return the corresponding TypeTree Modified from llvm::MDNode::isTBAAVtableAccess()
 
static TypeTree parseTBAA (llvm::Instruction &I, const llvm::DataLayout &DL, std::shared_ptr< llvm::ModuleSlotTracker > MST)
 Given an llvm::Instruction, return a TypeTree representing any types that can be derived from TBAA metadata attached.
 

Variables

llvm::cl::opt< bool > EnzymePrintType
 The following is not taken from LLVM.
 

Typedef Documentation

◆ MutableTBAANode

using MutableTBAANode = TBAANodeImpl<llvm::MDNode>

Definition at line 94 of file TBAA.h.

◆ MutableTBAAStructTagNode

Definition at line 160 of file TBAA.h.

◆ TBAANode

using TBAANode = TBAANodeImpl<const llvm::MDNode>

Definition at line 93 of file TBAA.h.

◆ TBAAStructTagNode

using TBAAStructTagNode = TBAAStructTagNodeImpl<const llvm::MDNode>

Definition at line 159 of file TBAA.h.

Function Documentation

◆ createAccessTag()

static const llvm::MDNode * createAccessTag ( const llvm::MDNode * AccessType)
inlinestatic

Definition at line 288 of file TBAA.h.

◆ getAccessNameTBAA() [1/2]

static std::string getAccessNameTBAA ( const llvm::MDNode * M,
const std::set< std::string > & legalnames )
inlinestatic

◆ getAccessNameTBAA() [2/2]

static std::string getAccessNameTBAA ( llvm::Instruction * Inst,
const std::set< std::string > & legalnames )
inlinestatic

Definition at line 358 of file TBAA.h.

References getAccessNameTBAA().

◆ getTypeFromTBAAString()

static ConcreteType getTypeFromTBAAString ( std::string TypeName,
llvm::Instruction & I,
std::shared_ptr< llvm::ModuleSlotTracker > MST )
inlinestatic

Derive the ConcreteType corresponding to the string TypeName The llvm::Instruction I denotes the context in which this was found.

Definition at line 387 of file TBAA.h.

References EnzymePrintType, Integer, Pointer, and Unknown.

Referenced by parseTBAA(), and parseTBAA().

◆ isNewFormatTypeNode()

static bool isNewFormatTypeNode ( const llvm::MDNode * N)
static

isNewFormatTypeNode - Return true iff the given type node is in the new size-aware format.

Definition at line 36 of file TBAA.h.

Referenced by TBAANodeImpl< MDNodeTy >::isNewFormat(), and TBAAStructTypeNode::isNewFormat().

◆ isStructPathTBAA()

static bool isStructPathTBAA ( const llvm::MDNode * MD)
inlinestatic

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

Definition at line 280 of file TBAA.h.

Referenced by getAccessNameTBAA(), and parseTBAA().

◆ parseTBAA() [1/3]

static TypeTree parseTBAA ( const llvm::MDNode * M,
llvm::Instruction & I,
const llvm::DataLayout & DL,
std::shared_ptr< llvm::ModuleSlotTracker > MST )
inlinestatic

Given a TBAA metadata node return the corresponding TypeTree Modified from llvm::MDNode::isTBAAVtableAccess()

Definition at line 465 of file TBAA.h.

References getTypeFromTBAAString(), isStructPathTBAA(), TypeTree::Only(), parseTBAA(), and Tag.

◆ parseTBAA() [2/3]

static TypeTree parseTBAA ( llvm::Instruction & I,
const llvm::DataLayout & DL,
std::shared_ptr< llvm::ModuleSlotTracker > MST )
inlinestatic

Given an llvm::Instruction, return a TypeTree representing any types that can be derived from TBAA metadata attached.

Definition at line 487 of file TBAA.h.

References parseTBAA(), Pointer, and TypeTree::ShiftIndices().

◆ parseTBAA() [3/3]

static TypeTree parseTBAA ( TBAAStructTypeNode AccessType,
llvm::Instruction & I,
const llvm::DataLayout & DL,
std::shared_ptr< llvm::ModuleSlotTracker > MST )
inlinestatic

Variable Documentation

◆ EnzymePrintType

llvm::cl::opt<bool> EnzymePrintType
extern

The following is not taken from LLVM.

Flag to print llvm::Type Analysis results as they are derived

Referenced by TypeAnalysis::analyzeFunction(), getTypeFromTBAAString(), TypeAnalyzer::visitCallBase(), TypeAnalyzer::visitIPOCall(), TypeAnalyzer::visitPHINode(), and TypeAnalyzer::visitSelectInst().