LLVM 20.0.0git
|
Evaluate the size and offset of an object pointed to by a Value*. More...
#include "llvm/Analysis/MemoryBuiltins.h"
Static Public Member Functions | |
static SizeOffsetValue | unknown () |
Evaluate the size and offset of an object pointed to by a Value*.
May create code to compute the result at run-time.
Definition at line 327 of file MemoryBuiltins.h.
ObjectSizeOffsetEvaluator::ObjectSizeOffsetEvaluator | ( | const DataLayout & | DL, |
const TargetLibraryInfo * | TLI, | ||
LLVMContext & | Context, | ||
ObjectSizeOpts | EvalOpts = {} |
||
) |
Definition at line 1174 of file MemoryBuiltins.cpp.
References I.
SizeOffsetValue ObjectSizeOffsetEvaluator::compute | ( | Value * | V | ) |
Definition at line 1186 of file MemoryBuiltins.cpp.
References llvm::SmallPtrSetImplBase::clear(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::erase(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::PoisonValue::get(), llvm::DataLayout::getIndexType(), and I.
Referenced by getBoundsCheckCond(), and llvm::lowerObjectSizeCall().
|
inlinestatic |
Definition at line 351 of file MemoryBuiltins.h.
Referenced by llvm::lowerObjectSizeCall(), visitAllocaInst(), visitCallBase(), visitExtractElementInst(), visitExtractValueInst(), visitGEPOperator(), visitInstruction(), visitIntToPtrInst(), visitLoadInst(), visitPHINode(), and visitSelectInst().
SizeOffsetValue ObjectSizeOffsetEvaluator::visitAllocaInst | ( | AllocaInst & | I | ) |
Definition at line 1273 of file MemoryBuiltins.cpp.
References assert(), llvm::IRBuilderBase::CreateMul(), llvm::IRBuilderBase::CreateTypeSize(), llvm::IRBuilderBase::CreateZExtOrTrunc(), llvm::DataLayout::getAllocaAddrSpace(), llvm::DataLayout::getIndexType(), llvm::Value::getType(), llvm::DataLayout::getTypeAllocSize(), I, Size, and unknown().
SizeOffsetValue ObjectSizeOffsetEvaluator::visitCallBase | ( | CallBase & | CB | ) |
Definition at line 1294 of file MemoryBuiltins.cpp.
References llvm::IRBuilderBase::CreateMul(), llvm::IRBuilderBase::CreateZExtOrTrunc(), getAllocationSize(), llvm::CallBase::getArgOperand(), Size, StrDupLike, and unknown().
SizeOffsetValue ObjectSizeOffsetEvaluator::visitExtractElementInst | ( | ExtractElementInst & | I | ) |
Definition at line 1317 of file MemoryBuiltins.cpp.
References unknown().
SizeOffsetValue ObjectSizeOffsetEvaluator::visitExtractValueInst | ( | ExtractValueInst & | I | ) |
Definition at line 1322 of file MemoryBuiltins.cpp.
References unknown().
SizeOffsetValue ObjectSizeOffsetEvaluator::visitGEPOperator | ( | GEPOperator & | GEP | ) |
Definition at line 1326 of file MemoryBuiltins.cpp.
References llvm::SizeOffsetType< T, C >::bothKnown(), llvm::IRBuilderBase::CreateAdd(), llvm::emitGEPOffset(), GEP, llvm::SizeOffsetType< T, C >::Offset, llvm::Offset, llvm::SizeOffsetType< T, C >::Size, and unknown().
SizeOffsetValue ObjectSizeOffsetEvaluator::visitInstruction | ( | Instruction & | I | ) |
Definition at line 1404 of file MemoryBuiltins.cpp.
References llvm::dbgs(), I, LLVM_DEBUG, and unknown().
SizeOffsetValue ObjectSizeOffsetEvaluator::visitIntToPtrInst | ( | IntToPtrInst & | ) |
Definition at line 1336 of file MemoryBuiltins.cpp.
References unknown().
SizeOffsetValue ObjectSizeOffsetEvaluator::visitLoadInst | ( | LoadInst & | I | ) |
Definition at line 1341 of file MemoryBuiltins.cpp.
References unknown().
SizeOffsetValue ObjectSizeOffsetEvaluator::visitPHINode | ( | PHINode & | PHI | ) |
Definition at line 1345 of file MemoryBuiltins.cpp.
References llvm::PHINode::addIncoming(), llvm::SizeOffsetType< T, C >::bothKnown(), llvm::IRBuilderBase::CreatePHI(), llvm::Instruction::eraseFromParent(), llvm::PoisonValue::get(), llvm::BasicBlock::getFirstInsertionPt(), llvm::PHINode::hasConstantValue(), llvm::SizeOffsetType< T, C >::Offset, llvm::Offset, PHI, llvm::Value::replaceAllUsesWith(), llvm::IRBuilderBase::SetInsertPoint(), llvm::SizeOffsetType< T, C >::Size, Size, and unknown().
SizeOffsetValue ObjectSizeOffsetEvaluator::visitSelectInst | ( | SelectInst & | I | ) |
Definition at line 1388 of file MemoryBuiltins.cpp.
References llvm::SizeOffsetType< T, C >::bothKnown(), llvm::IRBuilderBase::CreateSelect(), I, llvm::SizeOffsetType< T, C >::Offset, llvm::Offset, llvm::SizeOffsetType< T, C >::Size, Size, and unknown().