LLVM API Documentation
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Analysis/MemoryBuiltins.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.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/Metadata.h"
#include "llvm/IR/Operator.h"
#include "llvm/Support/ConstantRange.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/PatternMatch.h"
#include <cstring>
Go to the source code of this file.
Functions | |
static unsigned | getBitWidth (Type *Ty, const DataLayout *TD) |
static void | ComputeMaskedBitsAddSub (bool Add, Value *Op0, Value *Op1, bool NSW, APInt &KnownZero, APInt &KnownOne, APInt &KnownZero2, APInt &KnownOne2, const DataLayout *TD, unsigned Depth) |
static void | ComputeMaskedBitsMul (Value *Op0, Value *Op1, bool NSW, APInt &KnownZero, APInt &KnownOne, APInt &KnownZero2, APInt &KnownOne2, const DataLayout *TD, unsigned Depth) |
static bool | isGEPKnownNonNull (GEPOperator *GEP, const DataLayout *DL, unsigned Depth) |
Test whether a GEP's result is known to be non-null. More... | |
static Value * | BuildSubAggregate (Value *From, Value *To, Type *IndexedType, SmallVectorImpl< unsigned > &Idxs, unsigned IdxSkip, Instruction *InsertBefore) |
static Value * | BuildSubAggregate (Value *From, ArrayRef< unsigned > idx_range, Instruction *InsertBefore) |
static uint64_t | GetStringLengthH (Value *V, SmallPtrSet< PHINode *, 32 > &PHIs) |
Variables | |
const unsigned | MaxDepth = 6 |
|
static |
Definition at line 1552 of file ValueTracking.cpp.
References llvm::InsertValueInst::Create(), llvm::dyn_cast(), llvm::Instruction::eraseFromParent(), llvm::FindInsertedValue(), llvm::InsertValueInst::getAggregateOperand(), llvm::StructType::getElementType(), llvm::StructType::getNumElements(), llvm::makeArrayRef(), llvm::SmallVectorTemplateBase< T, isPodLike >::pop_back(), and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().
Referenced by BuildSubAggregate(), and llvm::FindInsertedValue().
|
static |
|
static |
Definition at line 47 of file ValueTracking.cpp.
References llvm::ComputeMaskedBits(), llvm::countLeadingZeros(), llvm::APInt::countTrailingOnes(), llvm::APInt::getBitWidth(), llvm::APInt::getHighBitsSet(), llvm::APInt::getLowBitsSet(), llvm::APInt::getSignBit(), and llvm::APInt::isNegative().
Referenced by llvm::ComputeMaskedBits().
|
static |
Definition at line 133 of file ValueTracking.cpp.
References llvm::ComputeMaskedBits(), llvm::APInt::countLeadingOnes(), llvm::APInt::countTrailingOnes(), llvm::APInt::getBitWidth(), llvm::APInt::getHighBitsSet(), llvm::APInt::getLowBitsSet(), llvm::isKnownNonZero(), llvm::APInt::isNegative(), and llvm::APInt::setBit().
Referenced by llvm::ComputeMaskedBits().
|
static |
getBitWidth - Returns the bitwidth of the given scalar or pointer type (if unknown returns 0). For vector types, returns the element type's bitwidth.
Definition at line 40 of file ValueTracking.cpp.
References llvm::DataLayout::getPointerTypeSizeInBits(), and llvm::Type::getScalarSizeInBits().
Referenced by llvm::ComputeSignBit(), llvm::ConstantFoldCastInstruction(), dyn_castFoldableMul(), dyn_castZExtVal(), ExtractConstantBytes(), llvm::ExecutionEngine::getConstantValue(), llvm::EVT::getEVT(), llvm::Type::getIntegerBitWidth(), getNoopInput(), llvm::Type::getPrimitiveSizeInBits(), llvm::NVPTXTargetLowering::getPrototype(), getTypePrefix(), llvm::MVT::getVT(), llvm::Type::isIntegerTy(), llvm::isKnownNonZero(), llvm::isSafeToSpeculativelyExecute(), LLVMCreateGenericValueOfInt(), LLVMGetIntTypeWidth(), llvm::ExecutionEngine::LoadValueFromMemory(), llvm::TypePrinting::print(), llvm::JIT::runFunction(), llvm::MCJIT::runFunction(), llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitICmpInst(), llvm::InstCombiner::visitICmpInstWithInstAndIntCst(), llvm::WriteMDNodeComment(), and WriteTypeTable().
|
static |
GetStringLengthH - If we can compute the length of the string pointed to by the specified pointer, return 'len+1'. If we can't, return 0.
Definition at line 1839 of file ValueTracking.cpp.
References llvm::getConstantStringInfo(), llvm::SmallPtrSet< PtrType, SmallSize >::insert(), llvm::StringRef::size(), and llvm::Value::stripPointerCasts().
Referenced by llvm::GetStringLength().
|
static |
Test whether a GEP's result is known to be non-null.
Uses properties inherent in a GEP to try to determine whether it is known to be non-null.
Currently this routine does not support vector GEPs.
Definition at line 916 of file ValueTracking.cpp.
References llvm::gep_type_begin(), llvm::gep_type_end(), llvm::StructLayout::getElementOffset(), llvm::GEPOperator::getPointerAddressSpace(), llvm::GEPOperator::getPointerOperand(), llvm::DataLayout::getStructLayout(), llvm::Value::getType(), llvm::DataLayout::getTypeAllocSize(), llvm::ConstantInt::getZExtValue(), llvm::GEPOperator::isInBounds(), llvm::isKnownNonZero(), llvm::Type::isPointerTy(), and MaxDepth.
Referenced by llvm::isKnownNonZero().
const unsigned MaxDepth = 6 |
Definition at line 36 of file ValueTracking.cpp.
Referenced by llvm::SUnit::biasCriticalPath(), llvm::ComputeMaskedBits(), llvm::ComputeMultiple(), isGEPKnownNonNull(), llvm::isKnownNonZero(), llvm::isKnownToBeAPowerOfTwo(), and visitUDivOperand().