LLVM
8.0.1
|
#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>
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 MDNode * | getLeastCommonType (const MDNode *A, const MDNode *B) |
static const MDNode * | createAccessTag (const MDNode *AccessType) |
static bool | hasField (TBAAStructTypeNode BaseType, TBAAStructTypeNode FieldType) |
static bool | mayBeAccessToSubobjectOf (TBAAStructTagNode BaseTag, TBAAStructTagNode SubobjectTag, const MDNode *CommonType, const MDNode **GenericTag, bool &MayAlias) |
Return true if for two given accesses, one of the accessed objects may be a subobject of the other. More... | |
INITIALIZE_PASS (TypeBasedAAWrapperPass, "tbaa", "Type-Based Alias Analysis", false, true) ImmutablePass *llvm | |
Variables | |
static cl::opt< bool > | EnableTBAA ("enable-tbaa", cl::init(true), cl::Hidden) |
Definition at line 539 of file TypeBasedAliasAnalysis.cpp.
References llvm::IntegerType::get(), llvm::ConstantInt::get(), llvm::ConstantAsMetadata::get(), llvm::MDNode::get(), llvm::MDNode::getContext(), llvm::MDNode::getNumOperands(), and UINT64_MAX.
Referenced by matchAccessTags(), and mayBeAccessToSubobjectOf().
Definition at line 478 of file TypeBasedAliasAnalysis.cpp.
References llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::count(), llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::insert(), llvm::report_fatal_error(), llvm::MipsISD::Ret, llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::size(), llvm::X86II::TA, and llvm::X86II::TB.
Referenced by matchAccessTags().
|
static |
Definition at line 566 of file TypeBasedAliasAnalysis.cpp.
Referenced by mayBeAccessToSubobjectOf().
INITIALIZE_PASS | ( | TypeBasedAAWrapperPass | , |
"tbaa" | , | ||
"Type-Based Alias Analysis" | , | ||
false | , | ||
true | |||
) |
Definition at line 714 of file TypeBasedAliasAnalysis.cpp.
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 364 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().
|
static |
matchTags - Return true if the given couple of accesses are allowed to overlap.
If
Definition at line 654 of file TypeBasedAliasAnalysis.cpp.
References assert(), createAccessTag(), getLeastCommonType(), isStructPathTBAA(), llvm::MayAlias, and mayBeAccessToSubobjectOf().
Referenced by llvm::MDNode::getMostGenericTBAA(), and llvm::MDNode::isTBAAVtableAccess().
|
static |
Return true if for two given accesses, one of the accessed objects may be a subobject of the other.
The BaseTag
and SubobjectTag
parameters describe the accesses to the base object and the subobject respectively. CommonType
must be the metadata node describing the common type of the accessed objects. On return, MayAlias
is set to true iff these accesses may alias and Generic
, if not null, points to the most generic access tag for the given two.
Definition at line 583 of file TypeBasedAliasAnalysis.cpp.
References assert(), createAccessTag(), and hasField().
Referenced by matchAccessTags().