LLVM API Documentation
#include "llvm/Analysis/Passes.h"#include "llvm/ADT/SmallPtrSet.h"#include "llvm/ADT/SmallVector.h"#include "llvm/Analysis/AliasAnalysis.h"#include "llvm/Analysis/CaptureTracking.h"#include "llvm/Analysis/InstructionSimplify.h"#include "llvm/Analysis/MemoryBuiltins.h"#include "llvm/Analysis/ValueTracking.h"#include "llvm/IR/Constants.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/DerivedTypes.h"#include "llvm/IR/Function.h"#include "llvm/IR/GlobalAlias.h"#include "llvm/IR/GlobalVariable.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/LLVMContext.h"#include "llvm/IR/Operator.h"#include "llvm/Pass.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/GetElementPtrTypeIterator.h"#include "llvm/Target/TargetLibraryInfo.h"#include <algorithm>#include "llvm/IR/Intrinsics.gen"
Go to the source code of this file.
Defines | |
| #define | GET_INTRINSIC_MODREF_BEHAVIOR |
Enumerations | |
| enum | ExtensionKind |
Functions | |
| static bool | isNonEscapingLocalObject (const Value *V) |
| static bool | isEscapeSource (const Value *V) |
| static uint64_t | getObjectSize (const Value *V, const DataLayout &TD, const TargetLibraryInfo &TLI, bool RoundToAlign=false) |
| static bool | isObjectSmallerThan (const Value *V, uint64_t Size, const DataLayout &TD, const TargetLibraryInfo &TLI) |
| static bool | isObjectSize (const Value *V, uint64_t Size, const DataLayout &TD, const TargetLibraryInfo &TLI) |
| static Value * | GetLinearExpression (Value *V, APInt &Scale, APInt &Offset, ExtensionKind &Extension, const DataLayout &TD, unsigned Depth) |
| static const Value * | DecomposeGEPExpression (const Value *V, int64_t &BaseOffs, SmallVectorImpl< VariableGEPIndex > &VarIndices, const DataLayout *TD) |
| static void | GetIndexDifference (SmallVectorImpl< VariableGEPIndex > &Dest, const SmallVectorImpl< VariableGEPIndex > &Src) |
| static const Function * | getParent (const Value *V) |
| static bool | notDifferentParent (const Value *O1, const Value *O2) |
| INITIALIZE_AG_PASS_BEGIN (BasicAliasAnalysis, AliasAnalysis,"basicaa","Basic Alias Analysis (stateless AA impl)", false, true, false) INITIALIZE_AG_PASS_END(BasicAliasAnalysis | |
| Basic Alias | Analysis (stateless AA impl)" |
| static bool | areVarIndicesEqual (SmallVector< VariableGEPIndex, 4 > &Indices1, SmallVector< VariableGEPIndex, 4 > &Indices2) |
| static AliasAnalysis::AliasResult | MergeAliasResults (AliasAnalysis::AliasResult A, AliasAnalysis::AliasResult B) |
Variables | |
| AliasAnalysis | |
| basicaa | |
| Basic Alias | false |
| Basic Alias | true |
| #define GET_INTRINSIC_MODREF_BEHAVIOR |
| enum ExtensionKind |
Definition at line 150 of file BasicAliasAnalysis.cpp.
| Basic Alias Analysis | ( | stateless AA | impl | ) |
| static bool areVarIndicesEqual | ( | SmallVector< VariableGEPIndex, 4 > & | Indices1, |
| SmallVector< VariableGEPIndex, 4 > & | Indices2 | ||
| ) | [static] |
Definition at line 849 of file BasicAliasAnalysis.cpp.
References I, and llvm::SmallVectorTemplateCommon< T >::size().
| static const Value* DecomposeGEPExpression | ( | const Value * | V, |
| int64_t & | BaseOffs, | ||
| SmallVectorImpl< VariableGEPIndex > & | VarIndices, | ||
| const DataLayout * | TD | ||
| ) | [static] |
DecomposeGEPExpression - If V is a symbolic pointer expression, decompose it into a base pointer with a constant offset and a number of scaled symbolic offsets.
The scaled symbolic offsets (represented by pairs of a Value* and a scale in the VarIndices vector) are Value*'s that are known to be scaled by the specified amount, but which may have other unrepresented high bits. As such, the gep cannot necessarily be reconstructed from its decomposed form.
When DataLayout is around, this function is capable of analyzing everything that GetUnderlyingObject can look through. When not, it just looks through pointer casts.
Definition at line 263 of file BasicAliasAnalysis.cpp.
References llvm::SmallVectorTemplateCommon< T >::begin(), llvm::dyn_cast(), llvm::SmallVectorImpl< T >::erase(), llvm::gep_type_begin(), getBitWidth(), llvm::StructLayout::getElementOffset(), GetLinearExpression(), llvm::Operator::getOpcode(), llvm::User::getOperand(), llvm::DataLayout::getPointerSizeInBits(), llvm::APInt::getSExtValue(), llvm::DataLayout::getStructLayout(), llvm::Value::getType(), llvm::DataLayout::getTypeAllocSize(), llvm::GEPOperator::hasAllZeroIndices(), I, llvm::User::op_begin(), llvm::User::op_end(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::SimplifyInstruction(), and llvm::SmallVectorTemplateCommon< T >::size().
| static void GetIndexDifference | ( | SmallVectorImpl< VariableGEPIndex > & | Dest, |
| const SmallVectorImpl< VariableGEPIndex > & | Src | ||
| ) | [static] |
GetIndexDifference - Dest and Src are the variable indices from two decomposed GetElementPtr instructions GEP1 and GEP2 which have common base pointers. Subtract the GEP2 indices from GEP1 to find the symbolic difference between the two pointers.
Definition at line 400 of file BasicAliasAnalysis.cpp.
References llvm::SmallVectorTemplateCommon< T >::begin(), llvm::SmallVectorBase::empty(), llvm::SmallVectorImpl< T >::erase(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), and llvm::SmallVectorTemplateCommon< T >::size().
| static Value* GetLinearExpression | ( | Value * | V, |
| APInt & | Scale, | ||
| APInt & | Offset, | ||
| ExtensionKind & | Extension, | ||
| const DataLayout & | TD, | ||
| unsigned | Depth | ||
| ) | [static] |
GetLinearExpression - Analyze the specified value as a linear expression: "A*V + B", where A and B are constant integers. Return the scale and offset values as APInts and return V as a Value*, and return whether we looked through any sign or zero extends. The incoming Value is known to have IntegerType and it may already be sign or zero extended.
Note that this looks through extends, so the high bits may not be represented in the result.
Definition at line 181 of file BasicAliasAnalysis.cpp.
References llvm::APInt::getBitWidth(), llvm::APInt::getLimitedValue(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), llvm::Type::isIntegerTy(), llvm::MaskedValueIsZero(), llvm::APIntOps::Or(), llvm::APInt::trunc(), and llvm::APInt::zext().
Referenced by DecomposeGEPExpression().
| static uint64_t getObjectSize | ( | const Value * | V, |
| const DataLayout & | TD, | ||
| const TargetLibraryInfo & | TLI, | ||
| bool | RoundToAlign = false |
||
| ) | [static] |
getObjectSize - Return the size of the object specified by V, or UnknownSize if unknown.
Definition at line 87 of file BasicAliasAnalysis.cpp.
References llvm::getObjectSize(), and llvm::AliasAnalysis::UnknownSize.
Definition at line 437 of file BasicAliasAnalysis.cpp.
References llvm::GlobalValue::getParent().
Referenced by llvm::LiveVariables::VarInfo::findKill(), llvm::Loop::isLCSSAForm(), LLVMGetBasicBlockParent(), LLVMGetGlobalParent(), LLVMGetInstructionParent(), LLVMGetParamParent(), llvm::NVPTXTargetLowering::LowerFormalArguments(), llvm::PHITransAddr::NeedsPHITranslationFromBlock(), notDifferentParent(), llvm::RNSuccIterator< NodeType >::operator=(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), and llvm::LoopBase< BlockT, LoopT >::verifyLoop().
| INITIALIZE_AG_PASS_BEGIN | ( | BasicAliasAnalysis | , |
| AliasAnalysis | , | ||
| "basicaa" | , | ||
| "Basic Alias Analysis (stateless AA impl)" | , | ||
| false | , | ||
| true | , | ||
| false | |||
| ) |
isEscapeSource - Return true if the pointer is one which would have been considered an escape by isNonEscapingLocalObject.
Definition at line 72 of file BasicAliasAnalysis.cpp.
isNonEscapingLocalObject - Return true if the pointer is to a function-local object that never escapes from the function.
Definition at line 47 of file BasicAliasAnalysis.cpp.
References llvm::ARM_PROC::A, llvm::isNoAliasCall(), and llvm::PointerMayBeCaptured().
| static bool isObjectSize | ( | const Value * | V, |
| uint64_t | Size, | ||
| const DataLayout & | TD, | ||
| const TargetLibraryInfo & | TLI | ||
| ) | [static] |
isObjectSize - Return true if we can prove that the object specified by V has size Size.
Definition at line 139 of file BasicAliasAnalysis.cpp.
References llvm::getObjectSize(), and llvm::AliasAnalysis::UnknownSize.
| static bool isObjectSmallerThan | ( | const Value * | V, |
| uint64_t | Size, | ||
| const DataLayout & | TD, | ||
| const TargetLibraryInfo & | TLI | ||
| ) | [static] |
isObjectSmallerThan - Return true if we can prove that the object specified by V is smaller than Size.
Definition at line 98 of file BasicAliasAnalysis.cpp.
References llvm::getObjectSize(), llvm::isIdentifiedObject(), and llvm::AliasAnalysis::UnknownSize.
| static AliasAnalysis::AliasResult MergeAliasResults | ( | AliasAnalysis::AliasResult | A, |
| AliasAnalysis::AliasResult | B | ||
| ) | [static] |
Definition at line 1034 of file BasicAliasAnalysis.cpp.
References llvm::ARM_PROC::A, llvm::AliasAnalysis::MayAlias, llvm::AliasAnalysis::MustAlias, and llvm::AliasAnalysis::PartialAlias.
Definition at line 447 of file BasicAliasAnalysis.cpp.
References getParent().
Definition at line 562 of file BasicAliasAnalysis.cpp.
Definition at line 562 of file BasicAliasAnalysis.cpp.
| Basic Alias false |
Definition at line 564 of file BasicAliasAnalysis.cpp.
| Basic Alias true |
Definition at line 564 of file BasicAliasAnalysis.cpp.