LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
llvm::Value Class Reference

LLVM Value Representation. More...

#include <Value.h>

Inheritance diagram for llvm::Value:
Inheritance graph
[legend]
Collaboration diagram for llvm::Value:
Collaboration graph
[legend]

Public Types

enum  ValueTy {
  ArgumentVal, BasicBlockVal, FunctionVal, GlobalAliasVal,
  GlobalVariableVal, UndefValueVal, BlockAddressVal, ConstantExprVal,
  ConstantAggregateZeroVal, ConstantDataArrayVal, ConstantDataVectorVal, ConstantIntVal,
  ConstantFPVal, ConstantArrayVal, ConstantStructVal, ConstantVectorVal,
  ConstantPointerNullVal, MDNodeVal, MDStringVal, InlineAsmVal,
  PseudoSourceValueVal, FixedStackPseudoSourceValueVal, InstructionVal, ConstantFirstVal = FunctionVal,
  ConstantLastVal = ConstantPointerNullVal
}
 
typedef value_use_iterator< Useruse_iterator
 
typedef value_use_iterator
< const User
const_use_iterator
 

Public Member Functions

virtual ~Value ()
 
void dump () const
 dump - Support for debugging, callable in GDB: V->dump() More...
 
void print (raw_ostream &O, AssemblyAnnotationWriter *AAW=0) const
 
TypegetType () const
 
LLVMContextgetContext () const
 All values hold a context through their type. More...
 
bool hasName () const
 
ValueNamegetValueName () const
 
void setValueName (ValueName *VN)
 
StringRef getName () const
 
void setName (const Twine &Name)
 
void takeName (Value *V)
 
void replaceAllUsesWith (Value *V)
 
bool use_empty () const
 
use_iterator use_begin ()
 
const_use_iterator use_begin () const
 
use_iterator use_end ()
 
const_use_iterator use_end () const
 
Useruse_back ()
 
const Useruse_back () const
 
bool hasOneUse () const
 
bool hasNUses (unsigned N) const
 
bool hasNUsesOrMore (unsigned N) const
 
bool isUsedInBasicBlock (const BasicBlock *BB) const
 
unsigned getNumUses () const
 
void addUse (Use &U)
 
unsigned getValueID () const
 
unsigned getRawSubclassOptionalData () const
 
void clearSubclassOptionalData ()
 
bool hasSameSubclassOptionalData (const Value *V) const
 
void intersectOptionalDataWith (const Value *V)
 
bool hasValueHandle () const
 
ValuestripPointerCasts ()
 Strips off any unneeded pointer casts, all-zero GEPs and aliases from the specified value, returning the original uncasted value. More...
 
const ValuestripPointerCasts () const
 
ValuestripPointerCastsNoFollowAliases ()
 Strips off any unneeded pointer casts and all-zero GEPs from the specified value, returning the original uncasted value. More...
 
const ValuestripPointerCastsNoFollowAliases () const
 
ValuestripInBoundsConstantOffsets ()
 Strips off unneeded pointer casts and all-constant GEPs from the specified value, returning the original pointer value. More...
 
const ValuestripInBoundsConstantOffsets () const
 
ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset)
 Strips like stripInBoundsConstantOffsets but also accumulates the constant offset stripped. More...
 
const ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const
 
ValuestripInBoundsOffsets ()
 Strips off unneeded pointer casts and any in-bounds offsets from the specified value, returning the original pointer value. More...
 
const ValuestripInBoundsOffsets () const
 
bool isDereferenceablePointer () const
 
ValueDoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB)
 
const ValueDoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const
 
void mutateType (Type *Ty)
 

Static Public Attributes

static const unsigned MaximumAlignment = 1u << 29
 

Protected Member Functions

virtual void printCustom (raw_ostream &O) const
 
 Value (Type *Ty, unsigned scid)
 
unsigned short getSubclassDataFromValue () const
 
void setValueSubclassData (unsigned short D)
 

Protected Attributes

unsigned char SubclassOptionalData: 7
 

Friends

class ValueSymbolTable
 
class ValueHandleBase
 

Detailed Description

LLVM Value Representation.

This is a very important LLVM class. It is the base class of all values computed by a program that may be used as operands to other values. Value is the super class of other important classes such as Instruction and Function. All Values have a Type. Type is not a subclass of Value. Some values can have a name and they belong to some Module. Setting the name on the Value automatically updates the module's symbol table.

Every value has a "use list" that keeps track of which other Values are using this Value. A Value can also have an arbitrary number of ValueHandle objects that watch it and listen to RAUW and Destroy events. See llvm/Support/ValueHandle.h for details.

Definition at line 66 of file Value.h.

Member Typedef Documentation

Definition at line 147 of file Value.h.

Definition at line 146 of file Value.h.

Member Enumeration Documentation

An enumeration for keeping track of the concrete subclass of Value that is actually instantiated. Values of this enumeration are kept in the Value classes SubclassID field. They are used for concrete type identification.

Enumerator
ArgumentVal 
BasicBlockVal 
FunctionVal 
GlobalAliasVal 
GlobalVariableVal 
UndefValueVal 
BlockAddressVal 
ConstantExprVal 
ConstantAggregateZeroVal 
ConstantDataArrayVal 
ConstantDataVectorVal 
ConstantIntVal 
ConstantFPVal 
ConstantArrayVal 
ConstantStructVal 
ConstantVectorVal 
ConstantPointerNullVal 
MDNodeVal 
MDStringVal 
InlineAsmVal 
PseudoSourceValueVal 
FixedStackPseudoSourceValueVal 
InstructionVal 
ConstantFirstVal 
ConstantLastVal 

Definition at line 191 of file Value.h.

Constructor & Destructor Documentation

Value::Value ( Type Ty,
unsigned  scid 
)
protected
Value::~Value ( )
virtual

Member Function Documentation

void llvm::Value::addUse ( Use U)
inline

addUse - This method should only be used by the Use class.

Definition at line 185 of file Value.h.

Referenced by llvm::Use::set(), and llvm::Use::swap().

void llvm::Value::clearSubclassOptionalData ( )
inline

clearSubclassOptionalData - Clear the optional flags contained in this value.

Definition at line 246 of file Value.h.

References SubclassOptionalData.

Referenced by ClearSubclassDataAfterReassociation().

Value * Value::DoPHITranslation ( const BasicBlock CurBB,
const BasicBlock PredBB 
)

DoPHITranslation - If this value is a PHI node with CurBB as its parent, return the value in the PHI node corresponding to PredBB. If not, return ourself. This is useful if you want to know the value something has in a predecessor block.

Definition at line 509 of file Value.cpp.

References llvm::dyn_cast(), llvm::PHINode::getIncomingValueForBlock(), and llvm::Instruction::getParent().

Referenced by DoPHITranslation().

const Value* llvm::Value::DoPHITranslation ( const BasicBlock CurBB,
const BasicBlock PredBB 
) const
inline

Definition at line 328 of file Value.h.

References DoPHITranslation().

void Value::dump ( ) const
LLVMContext & Value::getContext ( ) const

All values hold a context through their type.

Definition at line 517 of file Value.cpp.

References llvm::Type::getContext().

Referenced by llvm::CallInst::addAttribute(), llvm::InvokeInst::addAttribute(), AddOne(), AddWithOverflow(), AppendMDNodeToInstForPtr(), AppendMDNodeToSourcePtr(), llvm::SelectInst::areInvalidOperands(), BitCastConstantVector(), CanShareConstantPoolEntry(), changeToUnreachable(), llvm::FenceInst::clone_impl(), llvm::UnreachableInst::clone_impl(), CollectInsertionElements(), CollectShuffleElements(), CollectSingleShuffleElements(), llvm::ComputeMultiple(), llvm::FunctionLoweringInfo::ComputePHILiveOutRegInfo(), llvm::ConstantFoldBinaryInstruction(), llvm::ConstantFoldCastInstruction(), llvm::ConstantFoldCompareInstruction(), llvm::ConstantFoldInsertElementInstruction(), llvm::ConstantFoldLoadFromConstPtr(), llvm::ConstantFoldShuffleVectorInstruction(), llvm::SelectionDAGBuilder::CopyValueToVirtualRegister(), llvm::ARMConstantPoolConstant::Create(), CreatePrologue(), decomposeBitTestICmp(), llvm::MDNode::deleteTemporary(), llvm::ConstantAggregateZero::destroyConstant(), llvm::ConstantPointerNull::destroyConstant(), llvm::ConstantDataSequential::destroyConstant(), llvm::UndefValue::destroyConstant(), ExtractConstantBytes(), llvm::FindAllocaDbgDeclare(), FitsInFPType(), FoldBitCast(), llvm::FoldBranchToCommonDest(), llvm::InstCombiner::FoldCmpLoadFromIndexedGlobal(), llvm::InstCombiner::FoldICmpAddOpCst(), FoldReinterpretLoadFromConstPtr(), llvm::InstCombiner::FoldShiftByConstant(), GatherConstantCompares(), genLoopLimit(), llvm::DebugLoc::get(), llvm::ConstantArray::get(), llvm::ConstantVector::get(), llvm::ConstantExpr::get(), llvm::DebugLoc::getAsMDNode(), llvm::LazyValueInfo::getConstant(), llvm::LazyValueInfo::getConstantOnEdge(), getEdgeValueLocal(), llvm::ConstantDataSequential::getElementAsConstant(), llvm::ConstantExpr::getExtractElement(), llvm::ConstantExpr::getExtractValue(), llvm::ConstantExpr::getFCmp(), getFCmpValue(), llvm::ConstantExpr::getGetElementPtr(), llvm::ConstantExpr::getICmp(), llvm::ConstantExpr::getInsertElement(), llvm::ConstantExpr::getInsertValue(), llvm::MDNode::getMostGenericRange(), llvm::MDNode::getMostGenericTBAA(), llvm::getObjectSize(), llvm::FastISel::getRegForValue(), llvm::ConstantExpr::getSelect(), GetShiftedValue(), llvm::ConstantDataVector::getSplat(), llvm::ConstantStruct::getTypeForElements(), HandleByValArgument(), IdxCompare(), llvm::InlineFunction(), llvm::DIBuilder::insertDbgValueIntrinsic(), llvm::DIBuilder::insertDeclare(), InstallGlobalCtors(), InstCombineStoreToCast(), llvm::isAllocaPromotable(), llvm::isBytewiseValue(), LLVMAddAttribute(), LLVMRemoveAttribute(), LLVMSetParamAlignment(), LookThroughFPExtensions(), nvptx::LowerConstant(), llvm::IntrinsicLowering::LowerIntrinsicCall(), llvm::MapValue(), llvm::MergeBasicBlockIntoOnlyPred(), OptimizeGlobalAddressOfMalloc(), OptimizeNoopCopyExpression(), OptimizeVectorResize(), PerformHeapAllocSRoA(), ProcessUGT_ADDCST_ADD(), ReadDataFromGlobal(), llvm::CallInst::removeAttribute(), llvm::InvokeInst::removeAttribute(), llvm::replaceDbgDeclareForAlloca(), ReplaceFPIntrinsicWithCall(), llvm::ConstantStruct::replaceUsesOfWithOnConstant(), llvm::BlockAddress::replaceUsesOfWithOnConstant(), llvm::Instruction::setMetadata(), setName(), setUsedInitializer(), SimplifyCondBranchToCondBranch(), SimplifyICmpInst(), SimplifyTerminatorOnSelect(), llvm::SplitCriticalEdge(), SRAGlobal(), stripAndComputeConstantOffsets(), SubOne(), SubWithOverflow(), TryToShrinkGlobalToBoolean(), TryToSimplifyUncondBranchWithICmpInIt(), TurnSwitchRangeIntoICmp(), llvm::UpgradeBitCastExpr(), llvm::UpgradeBitCastInst(), llvm::UpgradeInstWithTBAATag(), llvm::UpgradeIntrinsicCall(), llvm::ValueHandleBase::ValueIsDeleted(), llvm::ValueHandleBase::ValueIsRAUWd(), llvm::InstCombiner::visitAllocaInst(), llvm::InstCombiner::visitAllocSite(), llvm::InstCombiner::visitBitCast(), llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitExtractElementInst(), llvm::InstCombiner::visitFree(), llvm::InstCombiner::visitICmpInst(), llvm::InstCombiner::visitICmpInstWithInstAndIntCst(), llvm::InstCombiner::visitIntToPtr(), llvm::InstCombiner::visitPtrToInt(), llvm::Interpreter::visitReturnInst(), llvm::InstCombiner::visitShuffleVectorInst(), and WriteMDNode().

StringRef Value::getName ( ) const

getName() - Return a constant reference to the value's name. This is cheap and guaranteed to return the same reference as long as the value is not modified.

Definition at line 167 of file Value.cpp.

References llvm::StringMapEntry< ValueTy >::getKey().

Referenced by llvm::ExecutionEngine::addGlobalMapping(), llvm::X86FrameLowering::adjustForHiPEPrologue(), AppendMDNodeToSourcePtr(), assureFPCallStub(), llvm::MDString::begin(), llvm::Interpreter::callExternalFunction(), llvm::canConstantFoldCallTo(), CanPropagatePredecessorsForPHIs(), llvm::CloneBasicBlock(), llvm::CloneFunction(), llvm::InstCombiner::commonShiftTransforms(), ConnectProlog(), llvm::ConstantFoldCall(), ConstructSSAForLoadSet(), copyGVAttributes(), createFPFnStub(), createReplacementInstr(), llvm::DemotePHIToStack(), llvm::DemoteRegToStack(), llvm::DISubprogram::describes(), llvm::InstCombiner::DoOneIteration(), llvm::dumpBlock(), llvm::ARMJITInfo::emitFunctionStub(), llvm::EmitGEPOffset(), llvm::ExecutionEngine::emitGlobals(), llvm::AsmPrinter::EmitSpecialLLVMGlobal(), llvm::MDString::end(), EvaluateStaticConstructor(), llvm::ExtractTypeInfo(), fixupSubprogramName(), llvm::SimplifyFortifiedLibCalls::fold(), llvm::InstCombiner::FoldAndOfICmps(), FoldBlockIntoPredecessor(), llvm::FoldBranchToCommonDest(), FoldCondBranchOnPHI(), llvm::InstCombiner::FoldICmpShrCst(), FoldOperationIntoSelectOperand(), llvm::InstCombiner::FoldOrOfICmps(), llvm::InstCombiner::FoldSelectOpOp(), llvm::InstCombiner::FoldShiftByConstant(), FoldTwoEntryPHINode(), forceRenaming(), GenerateARCAnnotation(), GenerateARCBBEntranceAnnotation(), GenerateARCBBTerminatorAnnotation(), getAllocationData(), llvm::DOTGraphTraits< const Function * >::getCompleteNodeLabel(), llvm::TargetLoweringObjectFileMachO::getExplicitSectionGlobal(), llvm::MachineBasicBlock::getFullName(), llvm::objcarc::GetFunctionClass(), llvm::LibCallInfo::getFunctionInfo(), llvm::DOTGraphTraits< const Function * >::getGraphName(), llvm::DOTGraphTraits< BlockFrequencyInfo * >::getGraphName(), llvm::InlineCostAnalysis::getInlineCost(), llvm::getInst(), getIntrinsicIDForCall(), llvm::MDString::getLength(), llvm::MachineFunction::getName(), llvm::Region::getNameStr(), llvm::Mangler::getNameWithPrefix(), llvm::DOTGraphTraits< BlockFrequencyInfo * >::getNodeLabel(), llvm::JIT::getOrEmitGlobalVariable(), llvm::JIT::getPointerToFunction(), llvm::MCJIT::getPointerToFunction(), llvm::getSamplerName(), llvm::DOTGraphTraits< const Function * >::getSimpleNodeLabel(), llvm::MDString::getString(), llvm::getSurfaceName(), llvm::getTextureName(), GlobalWasGeneratedByAsan(), HandleByValArgument(), HandleCallsInBlockInlinedThroughInvoke(), hasMemoryWrite(), HoistThenElseCodeToIf(), INITIALIZE_PASS(), llvm::InlineFunction(), llvm::InsertPreheaderForLoop(), InstCombineLoadCast(), InstCombineStoreToCast(), llvm::isFreeCall(), llvm::SpecialCaseList::isIn(), llvm::Function::isIntrinsic(), isIntrinsicInline(), llvm::LoadAndStorePromoter::LoadAndStorePromoter(), lookupFunction(), llvm::LibCallSimplifierImpl::lookupOptimization(), llvm::IntrinsicLowering::LowerIntrinsicCall(), llvm::IntrinsicLowering::LowerToByteSwap(), NegateValue(), OptimizeGlobalAddressOfMalloc(), llvm::OptLevelChanger::OptLevelChanger(), PerformHeapAllocSRoA(), llvm::ValueEnumerator::print(), llvm::Trace::print(), llvm::SparseSolver::Print(), llvm::CallGraph::print(), llvm::ARMConstantPoolConstant::print(), llvm::CallGraphNode::print(), llvm::AssemblyWriter::printBasicBlock(), llvm::BranchProbabilityInfo::printEdgeProbability(), PrintLLVMName(), ProcessUGT_ADDCST_ADD(), RecognizePersonality(), ReplaceCallWith(), ReplaceUsesOfMallocWithGlobal(), RewriteHeapSROALoadUser(), RewriteUsesOfClonedInstructions(), llvm::DOTGraphTraitsViewer< Analysis, Simple >::runOnFunction(), llvm::DOTGraphTraitsPrinter< Analysis, Simple >::runOnFunction(), llvm::RGPassManager::runOnFunction(), llvm::FPPassManager::runOnFunction(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::MipsOs16::runOnModule(), llvm::Inliner::runOnSCC(), llvm::VLIWMachineScheduler::schedule(), llvm::FastISel::SelectInstruction(), llvm::BranchProbabilityInfo::setEdgeWeight(), setName(), shouldInternalize(), SimplifyCondBranchToCondBranch(), SinkThenElseCodeToEnd(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), speculatePHINodeLoads(), speculateSelectInstLoads(), SpeculativelyExecuteBB(), llvm::SplitBlock(), llvm::SplitBlockPredecessors(), llvm::SplitCriticalEdge(), llvm::SplitLandingPadPredecessors(), SRAGlobal(), StripSymtab(), tryToMakeAllocaBePromotable(), TryToOptimizeStoreOfMallocToGlobal(), TryToShrinkGlobalToBoolean(), TurnSwitchRangeIntoICmp(), llvm::UnrollLoop(), UpdatePHINodes(), llvm::UpgradeIntrinsicCall(), UpgradeIntrinsicFunction1(), UpgradeSSE41Function(), usedInGlobalVarDef(), llvm::ValueHandleBase::ValueIsDeleted(), llvm::ValueHandleBase::ValueIsRAUWd(), llvm::InstCombiner::visitAdd(), llvm::InstCombiner::visitAllocaInst(), llvm::InstCombiner::visitAnd(), llvm::InstCombiner::visitExtractElementInst(), llvm::InstCombiner::visitFCmpInst(), llvm::InstCombiner::visitFPTrunc(), llvm::InstCombiner::visitGetElementPtrInst(), llvm::InstCombiner::visitICmpInst(), llvm::InstCombiner::visitICmpInstWithCastAndCast(), llvm::InstCombiner::visitICmpInstWithInstAndIntCst(), llvm::InstCombiner::visitMul(), llvm::InstCombiner::visitOr(), llvm::InstCombiner::visitSDiv(), llvm::InstCombiner::visitSelectInst(), llvm::InstCombiner::visitSExt(), llvm::InstCombiner::visitSRem(), llvm::InstCombiner::visitTrunc(), llvm::InstCombiner::visitXor(), llvm::InstCombiner::visitZExt(), llvm::OptLevelChanger::~OptLevelChanger(), and ~Value().

unsigned Value::getNumUses ( ) const

getNumUses - This method computes the number of uses of this Value. This is a linear time operation. Use hasOneUse, hasNUses, or hasNUsesOrMore to check for specific values.

getNumUses - This method computes the number of uses of this Value. This is a linear time operation. Use hasOneUse or hasNUses to check for specific values.

Definition at line 139 of file Value.cpp.

References use_begin(), and use_end().

unsigned llvm::Value::getRawSubclassOptionalData ( ) const
inline

getRawSubclassOptionalData - Return the raw optional flags value contained in this value. This should only be used when testing two Values for equivalence.

Definition at line 240 of file Value.h.

References SubclassOptionalData.

Referenced by llvm::ConstantKeyData< ConstantExpr >::getValType().

unsigned short llvm::Value::getSubclassDataFromValue ( ) const
inlineprotected
Type* llvm::Value::getType ( ) const
inline

All values are typed, get the type of this value.

Definition at line 111 of file Value.h.

Referenced by llvm::AliasSetTracker::add(), llvm::SSAUpdater::AddAvailableValue(), llvm::PHINode::addIncoming(), AddOne(), llvm::IVUsers::AddUsersImpl(), AddWithOverflow(), AnalyzeLoadFromClobberingLoad(), AnalyzeLoadFromClobberingStore(), llvm::SelectInst::areInvalidOperands(), BitCastConstantVector(), BreakUpSubtract(), BuildConstantFromSCEV(), BuildNew(), BuildSubAggregate(), CanCoerceMustAliasedValueToLoad(), CanEvaluateSExtd(), CanEvaluateShifted(), CanEvaluateTruncated(), CanEvaluateZExtd(), llvm::FastISel::canFoldAddIntoGEP(), CanShareConstantPoolEntry(), canTrapImpl(), llvm::CastInst::castIsValid(), CheapToScalarize(), checkBinaryFloatSignature(), checkUnaryFloatSignature(), llvm::FPMathOperator::classof(), llvm::VAArgInst::clone_impl(), llvm::TruncInst::clone_impl(), llvm::ZExtInst::clone_impl(), llvm::SExtInst::clone_impl(), llvm::FPTruncInst::clone_impl(), llvm::FPExtInst::clone_impl(), llvm::UIToFPInst::clone_impl(), llvm::SIToFPInst::clone_impl(), llvm::FPToUIInst::clone_impl(), llvm::FPToSIInst::clone_impl(), llvm::IntToPtrInst::clone_impl(), llvm::PtrToIntInst::clone_impl(), llvm::BitCastInst::clone_impl(), llvm::AddrSpaceCastInst::clone_impl(), llvm::CloneAndPruneFunctionInto(), CoerceAvailableValueToLoadType(), CollectBSwapParts(), CollectInsertionElements(), CollectShuffleElements(), CollectSingleShuffleElements(), llvm::InstCombiner::commonCastTransforms(), llvm::InstCombiner::commonIDivTransforms(), llvm::InstCombiner::commonPointerCastTransforms(), llvm::InstCombiner::commonShiftTransforms(), llvm::ComputeMaskedBits(), llvm::ComputeMultiple(), llvm::ComputeNumSignBits(), llvm::FunctionLoweringInfo::ComputePHILiveOutRegInfo(), computePointerICmp(), llvm::ComputeSignBit(), llvm::ComputeUsesVAFloatArgument(), ConnectProlog(), ConstantFold(), llvm::ConstantFoldBinaryInstruction(), llvm::ConstantFoldCastInstruction(), llvm::ConstantFoldCompareInstOperands(), llvm::ConstantFoldCompareInstruction(), ConstantFoldConstantExpressionImpl(), llvm::ConstantFoldExtractElementInstruction(), ConstantFoldGetElementPtrImpl(), llvm::ConstantFoldInsertElementInstruction(), llvm::ConstantFoldInsertValueInstruction(), llvm::ConstantFoldInstOperands(), llvm::ConstantFoldInstruction(), llvm::ConstantFoldLoadFromConstPtr(), llvm::ConstantFoldSelectInstruction(), llvm::ConstantFoldShuffleVectorInstruction(), ConstructSSAForLoadSet(), convertMemSetToLoop(), ConvertShiftToMul(), convertTransferToLoop(), convertValue(), llvm::SelectionDAGBuilder::CopyToExportRegsIfNeeded(), llvm::SelectionDAGBuilder::CopyValueToVirtualRegister(), llvm::BinaryOperator::Create(), llvm::IRBuilder< true, TargetFolder >::CreateAnd(), createAndInstr(), llvm::IRBuilder< true, TargetFolder >::CreateAShr(), llvm::TargetFolder::CreateCast(), createCast(), llvm::IRBuilder< true, TargetFolder >::CreateCast(), llvm::BinaryOperator::CreateFNeg(), llvm::TargetFolder::CreateFPCast(), llvm::CastInst::CreateFPCast(), createFree(), llvm::IRBuilderBase::CreateGlobalString(), llvm::CompileUnit::createGlobalVariableDIE(), llvm::TargetFolder::CreateIntCast(), llvm::IRBuilder< true, TargetFolder >::CreateIntCast(), llvm::CastInst::CreateIntegerCast(), llvm::IRBuilder< true, TargetFolder >::CreateIsNotNull(), llvm::IRBuilder< true, TargetFolder >::CreateIsNull(), llvm::IRBuilderBase::CreateLifetimeEnd(), llvm::IRBuilderBase::CreateLifetimeStart(), llvm::IRBuilder< true, TargetFolder >::CreateLShr(), createMalloc(), llvm::IRBuilderBase::CreateMemCpy(), llvm::IRBuilderBase::CreateMemMove(), llvm::IRBuilderBase::CreateMemSet(), llvm::BinaryOperator::CreateNeg(), llvm::BinaryOperator::CreateNot(), llvm::BinaryOperator::CreateNSWNeg(), llvm::BinaryOperator::CreateNUWNeg(), llvm::IRBuilder< true, TargetFolder >::CreateOr(), createPHIsForSplitLoopExit(), llvm::TargetFolder::CreatePointerCast(), llvm::CastInst::CreatePointerCast(), llvm::IRBuilder< true, TargetFolder >::CreatePointerCast(), createPrivateGlobalForString(), createPrivateNonConstGlobalForString(), llvm::IRBuilder< true, TargetFolder >::CreatePtrDiff(), createReplacementInstr(), llvm::TargetFolder::CreateSExtOrBitCast(), llvm::CastInst::CreateSExtOrBitCast(), llvm::IRBuilder< true, TargetFolder >::CreateSExtOrBitCast(), llvm::IRBuilder< true, TargetFolder >::CreateSExtOrTrunc(), llvm::IRBuilder< true, TargetFolder >::CreateShl(), llvm::TargetFolder::CreateTruncOrBitCast(), llvm::CastInst::CreateTruncOrBitCast(), llvm::IRBuilder< true, TargetFolder >::CreateTruncOrBitCast(), llvm::IRBuilder< true, TargetFolder >::CreateVectorSplat(), llvm::IRBuilder< true, TargetFolder >::CreateXor(), llvm::TargetFolder::CreateZExtOrBitCast(), llvm::CastInst::CreateZExtOrBitCast(), llvm::IRBuilder< true, TargetFolder >::CreateZExtOrBitCast(), llvm::IRBuilder< true, TargetFolder >::CreateZExtOrTrunc(), CvtFDivConstToReciprocal(), decomposeBitTestICmp(), DecomposeGEPExpression(), DecomposeSimpleLinearExpr(), llvm::DeleteDeadBlock(), DeleteInstructionInBlock(), llvm::DemotePHIToStack(), llvm::DemoteRegToStack(), llvm::ConstantAggregateZero::destroyConstant(), llvm::ConstantExpr::destroyConstant(), llvm::UndefValue::destroyConstant(), llvm::InstCombiner::DoOneIteration(), dyn_castFoldableMul(), EliminateDeadSwitchCases(), emitDebugValueComment(), llvm::EmitFPutC(), llvm::EmitFPutS(), llvm::EmitFWrite(), llvm::EmitGEPOffset(), llvm::AsmPrinter::EmitGlobalConstant(), emitGlobalConstantFP(), emitGlobalConstantImpl(), emitGlobalConstantStruct(), llvm::EmitStrNCpy(), llvm::EmitUnaryFloatFnCall(), llvm::ARMAsmPrinter::EmitXXStructor(), EvaluateExpression(), evaluateFCmpRelation(), EvaluateGEPOffsetExpression(), evaluateICmpRelation(), EvaluateStoreInto(), llvm::expandDivision(), llvm::expandDivisionUpTo32Bits(), llvm::ARMTargetLowering::ExpandInlineAsm(), llvm::X86TargetLowering::ExpandInlineAsm(), llvm::expandRemainderUpTo32Bits(), ExtractConstantBytes(), extractInteger(), extractVector(), llvm::FCmpInst::FCmpInst(), llvm::FindAvailableLoadedValue(), findCommonType(), llvm::FindInsertedValue(), FindLIVLoopCondition(), FindLoopCounter(), FindScalarElement(), fixupFPReturnAndCall(), llvm::InstCombiner::FoldAndOfFCmps(), llvm::InstCombiner::FoldAndOfICmps(), FoldBitCast(), llvm::InstCombiner::FoldCmpLoadFromIndexedGlobal(), foldConstantCastPair(), llvm::InstCombiner::FoldFCmp_IntToFP_Cst(), llvm::InstCombiner::FoldGEPICmp(), llvm::InstCombiner::FoldICmpAddOpCst(), llvm::InstCombiner::FoldICmpShrCst(), foldLogOpOfMaskedICmps(), foldLogOpOfMaskedICmpsHelper(), FoldOperationIntoSelectOperand(), llvm::InstCombiner::FoldOrOfFCmps(), FoldReinterpretLoadFromConstPtr(), foldSelectICmpAnd(), foldSelectICmpAndOr(), llvm::InstCombiner::FoldSelectOpOp(), llvm::InstCombiner::FoldShiftByConstant(), FoldTwoEntryPHINode(), foldUDivNegCst(), foldUDivPow2Cst(), foldUDivShl(), genLoopLimit(), llvm::gep_type_begin(), llvm::ConstantArray::get(), llvm::ConstantVector::get(), llvm::ConstantExpr::get(), getAccessType(), llvm::IntToPtrInst::getAddressSpace(), getAdjustedPtr(), llvm::Constant::getAggregateElement(), getAISize(), llvm::MemIntrinsic::getAlignmentType(), getArrayElements(), llvm::ConstantExpr::getAsInstruction(), llvm::ConstantExpr::getBitCast(), llvm::CastInst::getCastOpcode(), getCodeAddrSpace(), llvm::ConstantExpr::getCompare(), GetCompareTy(), GetConstantInt(), llvm::SelectionDAG::getConstantPool(), llvm::ExecutionEngine::getConstantValue(), llvm::BasicBlock::getContext(), llvm::MemIntrinsic::getDestAddressSpace(), getEdgeValueLocal(), llvm::ConstantAggregateZero::getElementValue(), llvm::UndefValue::getElementValue(), llvm::ConstantExpr::getExtractElement(), llvm::ConstantExpr::getExtractValue(), llvm::ConstantExpr::getFCmp(), llvm::ConstantExpr::getFNeg(), llvm::ConstantExpr::getFPCast(), llvm::ConstantExpr::getFPExtend(), llvm::ConstantExpr::getFPToSI(), llvm::ConstantExpr::getFPToUI(), llvm::ConstantExpr::getFPTrunc(), llvm::objcarc::GetFunctionClass(), llvm::GetElementPtrInst::getGEPReturnType(), llvm::ConstantExpr::getGetElementPtr(), llvm::ConstantExpr::getICmp(), llvm::getICmpValue(), llvm::ConstantExpr::getInsertElement(), llvm::ConstantExpr::getInsertValue(), llvm::ConstantExpr::getIntegerCast(), llvm::ConstantExpr::getIntToPtr(), llvm::SCEVExpander::getIVIncOperand(), llvm::TargetLoweringObjectFile::getKindForGlobal(), GetLinearExpression(), llvm::MemoryDependenceAnalysis::getLoadLoadClobberFullWidthSize(), GetLoadValueForLoad(), llvm::AliasAnalysis::getLocation(), getLogBase2Vector(), llvm::getMallocType(), GetMemInstValueForLoad(), getMemSetPatternValue(), getMergedGlobalExpr(), llvm::AliasAnalysis::getModRefInfo(), getNaturalGEPWithOffset(), llvm::ConstantExpr::getNeg(), llvm::MemoryDependenceAnalysis::getNonLocalPointerDependency(), getNoopInput(), llvm::ConstantExpr::getNot(), getOne(), llvm::getOrEnforceKnownAlignment(), llvm::Argument::getParamAlignment(), llvm::LoadInst::getPointerAddressSpace(), llvm::StoreInst::getPointerAddressSpace(), llvm::AtomicCmpXchgInst::getPointerAddressSpace(), llvm::AtomicRMWInst::getPointerAddressSpace(), llvm::PtrToIntInst::getPointerAddressSpace(), llvm::GetPointerBaseWithConstantOffset(), llvm::ConstantExpr::getPointerCast(), llvm::GetElementPtrInst::getPointerOperandType(), llvm::ConstantExpr::getPtrToInt(), llvm::FastISel::getRegForGEPIndex(), llvm::FastISel::getRegForValue(), llvm::ScalarEvolution::getSCEV(), llvm::ConstantExpr::getSelect(), GetSelectFoldableConstant(), llvm::ConstantAggregateZero::getSequentialElement(), llvm::UndefValue::getSequentialElement(), llvm::ConstantExpr::getSExt(), llvm::ConstantExpr::getSExtOrBitCast(), GetShiftedValue(), llvm::ShuffleVectorInst::getShuffleMask(), llvm::ConstantExpr::getShuffleVector(), llvm::SystemZTargetLowering::getSingleConstraintMatchWeight(), llvm::ARMTargetLowering::getSingleConstraintMatchWeight(), llvm::PPCTargetLowering::getSingleConstraintMatchWeight(), llvm::X86TargetLowering::getSingleConstraintMatchWeight(), llvm::TargetLowering::getSingleConstraintMatchWeight(), llvm::ConstantExpr::getSIToFP(), llvm::MemTransferInst::getSourceAddressSpace(), llvm::ConstantVector::getSplat(), llvm::ConstantDataVector::getSplat(), llvm::Constant::getSplatValue(), llvm::SelectionDAG::getSrcValue(), GetStoreValueForLoad(), llvm::GetStringLength(), llvm::ConstantAggregateZero::getStructElement(), llvm::UndefValue::getStructElement(), llvm::NVPTXTargetLowering::getTgtMemIntrinsic(), llvm::AArch64TargetLowering::getTgtMemIntrinsic(), llvm::ARMTargetLowering::getTgtMemIntrinsic(), llvm::ConstantExpr::getTrunc(), llvm::ConstantExpr::getTruncOrBitCast(), llvm::InlineAsm::getType(), llvm::AllocaInst::getType(), llvm::GlobalValue::getType(), llvm::ConstantInt::getType(), llvm::ConstantArray::getType(), llvm::ConstantStruct::getType(), llvm::SCEVUnknown::getType(), llvm::ConstantVector::getType(), llvm::ConstantPointerNull::getType(), llvm::ConstantDataSequential::getType(), llvm::ConstantDataArray::getType(), llvm::ConstantDataVector::getType(), llvm::GetElementPtrInst::getType(), llvm::InsertElementInst::getType(), llvm::ShuffleVectorInst::getType(), llvm::ConstantExpr::getUIToFP(), llvm::GetUnderlyingObject(), getUnderlyingObjectFromInt(), getUnderlyingObjects(), llvm::SelectionDAGBuilder::getValue(), llvm::SelectionDAGBuilder::getValueImpl(), llvm::ExtractElementInst::getVectorOperandType(), llvm::ConstantExpr::getWithOperandReplaced(), llvm::ConstantExpr::getWithOperands(), llvm::ConstantExpr::getZExt(), llvm::ConstantExpr::getZExtOrBitCast(), llvm::GlobalAlias::GlobalAlias(), llvm::GlobalVariable::GlobalVariable(), HandleByValArgument(), llvm::Argument::hasByValAttr(), llvm::PHINode::hasConstantValue(), llvm::Argument::hasNestAttr(), llvm::Argument::hasNoAliasAttr(), llvm::Argument::hasNoCaptureAttr(), llvm::Argument::hasStructRetAttr(), HoistThenElseCodeToIf(), IdxCompare(), llvm::CompositeType::indexValid(), llvm::BinaryOperator::init(), INITIALIZE_PASS(), llvm::ExecutionEngine::InitializeMemory(), llvm::FunctionLoweringInfo::InitializeRegForValue(), llvm::InlineFunction(), insertFastDiv(), insertInteger(), insertVector(), InstallGlobalCtors(), InstCombineLoadCast(), InstCombineStoreToCast(), llvm::MemoryDependenceAnalysis::invalidateCachedPointerInfo(), llvm::isBytewiseValue(), isCompatibleIVType(), IsConstantOffsetFromGlobal(), isEliminableCastPair(), isExistingPhi(), isGEPKnownNonNull(), isHighCostExpansion(), llvm::Instruction::isIdenticalToWhenDefined(), llvm::isImageOrSamplerVal(), llvm::CastInst::isIntegerCast(), isIntegerWideningViableForSlice(), isInterestingPointer(), llvm::isKnownNonZero(), llvm::isKnownToBeAPowerOfTwo(), llvm::CastInst::isLosslessCast(), llvm::Constant::isNegativeZeroValue(), llvm::CastInst::isNoopCast(), IsNullTerminatedString(), isOverwrite(), llvm::objcarc::IsPotentialRetainableObjPtr(), isRepeatedByteSequence(), isSafeToEliminateVarargsCast(), llvm::isSafeToLoadUnconditionally(), llvm::isSafeToSpeculativelyExecute(), llvm::Instruction::isSameOperationAs(), isSimpleEnoughPointerToCommit(), isSimpleEnoughValueToCommitHelper(), isSimpleIVUser(), isStridedPtr(), llvm::ExtractElementInst::isValidOperands(), llvm::InsertElementInst::isValidOperands(), llvm::ShuffleVectorInst::isValidOperands(), isVectorPromotionViableForSlice(), isZero(), LinearizeExprTree(), llvm::LoadAndStorePromoter::LoadAndStorePromoter(), LowerBSWAP(), llvm::SelectionDAGBuilder::LowerCallOperands(), llvm::SelectionDAGBuilder::LowerCallTo(), nvptx::LowerConstant(), lowerConstant(), LowerCTLZ(), LowerCTPOP(), llvm::IntrinsicLowering::LowerIntrinsicCall(), LowerNegateToMultiply(), llvm::IntrinsicLowering::LowerToByteSwap(), llvm::MapValue(), matchPairwiseReduction(), matchPairwiseReductionAtLevel(), MatchSelectFromAndOr(), matchVectorSplittingReduction(), llvm::MergeBasicBlockIntoOnlyPred(), mergeEmptyReturnBlocks(), OptimizeAndOrXor(), OptimizeAwayTrappingUsesOfValue(), OptimizeGlobalAddressOfMalloc(), OptimizeIntegerToVectorInsertions(), OptimizeIntToFloatBitCast(), OptimizeNoopCopyExpression(), OptimizeOnceStoredGlobal(), OptimizeVectorResize(), llvm::TargetLowering::ParseConstraints(), PerformHeapAllocSRoA(), llvm::PointerMayBeCaptured(), llvm::AssemblyWriter::printArgument(), llvm::AssemblyWriter::printInstruction(), ProcessUAddIdiom(), ProcessUGT_ADDCST_ADD(), promoteSingleBlockAlloca(), PushValueAndType(), ReadDataFromGlobal(), llvm::RemapInstruction(), llvm::AliasSetTracker::remove(), RemoveDeadConstant(), llvm::PHINode::removeIncomingValue(), llvm::MemoryDependenceAnalysis::removeInstruction(), removeLifetimeIntrinsicUsers(), replaceAllUsesWith(), llvm::SCEVExpander::replaceCongruentIVs(), ReplaceFPIntrinsicWithCall(), llvm::InstCombiner::ReplaceInstUsesWith(), llvm::returnTypeIsEligibleForTailCall(), RewriteHeapSROALoadUser(), rewriteSingleStoreAlloca(), RewriteUsesOfClonedInstructions(), llvm::TypeFinder::run(), llvm::Interpreter::run(), llvm::LoadAndStorePromoter::run(), llvm::JIT::runFunction(), llvm::NVPTXLowerAggrCopies::runOnFunction(), llvm::FindUsedTypes::runOnModule(), llvm::FastISel::SelectOperator(), llvm::FunctionLoweringInfo::set(), llvm::GlobalAlias::setAliasee(), llvm::MemIntrinsic::setDest(), llvm::GlobalVariable::setInitializer(), llvm::MemIntrinsic::setLength(), setName(), llvm::MemTransferInst::setSource(), llvm::MemSetInst::setValue(), shorter_filter(), SimplifyAddInst(), SimplifyAndInst(), SimplifyAShrInst(), SimplifyBinOp(), SimplifyBranchOnICmpChain(), SimplifyCall(), SimplifyDiv(), SimplifyFAddInst(), SimplifyFSubInst(), SimplifyICmpInst(), SimplifyInsertValueInst(), llvm::SimplifyInstruction(), SimplifyLShrInst(), SimplifyMulInst(), SimplifyOrInst(), SimplifyPHINode(), SimplifyRem(), SimplifyShift(), SimplifyShlInst(), SimplifySubInst(), SimplifyWithOpReplaced(), SimplifyXorInst(), SinkThenElseCodeToEnd(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), speculatePHINodeLoads(), llvm::SplitLandingPadPredecessors(), stripAndAccumulateInBoundsConstantOffsets(), stripAndComputeConstantOffsets(), StripPtrCastKeepAS(), SubOne(), SubWithOverflow(), swapMayExposeCSEOpportunities(), SwitchToLookupTable(), SymbolicallyEvaluateBinop(), SymbolicallyEvaluateGEP(), ThreadCmpOverSelect(), tryToMakeAllocaBePromotable(), TryToOptimizeStoreOfMallocToGlobal(), TryToShrinkGlobalToBoolean(), TurnSwitchRangeIntoICmp(), underlyingObjectsAlias(), llvm::UnrollRuntimeLoopProlog(), UpdatePHINodes(), llvm::UpgradeBitCastExpr(), llvm::UpgradeBitCastInst(), llvm::UpgradeIntrinsicCall(), llvm::ValueHandleBase::ValueIsDeleted(), llvm::ValueHandleBase::ValueIsRAUWd(), llvm::InstCombiner::visitAdd(), llvm::InstCombiner::visitAllocaInst(), llvm::InstCombiner::visitAllocSite(), llvm::InstCombiner::visitAnd(), llvm::ObjectSizeOffsetVisitor::visitArgument(), llvm::InstCombiner::visitAShr(), llvm::Interpreter::visitAShr(), llvm::Interpreter::visitBinaryOperator(), llvm::InstCombiner::visitBitCast(), llvm::Interpreter::visitBitCastInst(), llvm::InstCombiner::visitCallInst(), llvm::Interpreter::visitExtractElementInst(), llvm::InstCombiner::visitExtractElementInst(), llvm::Interpreter::visitExtractValueInst(), llvm::InstCombiner::visitFAdd(), llvm::Interpreter::visitFCmpInst(), llvm::InstCombiner::visitFCmpInst(), llvm::InstCombiner::visitFMul(), llvm::Interpreter::visitFPExtInst(), llvm::InstCombiner::visitFPToSI(), llvm::Interpreter::visitFPToSIInst(), llvm::InstCombiner::visitFPToUI(), llvm::Interpreter::visitFPToUIInst(), llvm::InstCombiner::visitFPTrunc(), llvm::Interpreter::visitFPTruncInst(), llvm::InstCombiner::visitFSub(), llvm::InstCombiner::visitGetElementPtrInst(), llvm::Interpreter::visitICmpInst(), llvm::InstCombiner::visitICmpInst(), llvm::InstCombiner::visitICmpInstWithCastAndCast(), llvm::InstCombiner::visitICmpInstWithInstAndIntCst(), llvm::InstCombiner::visitInsertElementInst(), llvm::Interpreter::visitInsertValueInst(), llvm::InstCombiner::visitIntToPtr(), llvm::Interpreter::visitIntToPtrInst(), llvm::InstCombiner::visitLandingPadInst(), llvm::Interpreter::visitLoadInst(), llvm::InstCombiner::visitLoadInst(), llvm::InstCombiner::visitLShr(), llvm::Interpreter::visitLShr(), llvm::InstCombiner::visitMul(), llvm::InstCombiner::visitOr(), llvm::InstCombiner::visitPHINode(), llvm::PtrUseVisitor< SliceBuilder >::visitPtr(), llvm::InstCombiner::visitPtrToInt(), llvm::Interpreter::visitPtrToIntInst(), llvm::Interpreter::visitReturnInst(), llvm::InstCombiner::visitSDiv(), llvm::Interpreter::visitSelectInst(), llvm::InstCombiner::visitSelectInst(), llvm::InstCombiner::visitSelectInstWithICmp(), llvm::InstCombiner::visitSExt(), llvm::Interpreter::visitSExtInst(), llvm::Interpreter::visitShl(), llvm::InstCombiner::visitShuffleVectorInst(), llvm::Interpreter::visitSIToFPInst(), llvm::SelectionDAGBuilder::visitSPDescriptorParent(), llvm::InstCombiner::visitSRem(), llvm::Interpreter::visitStoreInst(), llvm::InstCombiner::visitStoreInst(), llvm::InstCombiner::visitSub(), llvm::Interpreter::visitSwitchInst(), llvm::InstCombiner::visitTrunc(), llvm::Interpreter::visitTruncInst(), llvm::InstCombiner::visitUDiv(), llvm::Interpreter::visitUIToFPInst(), llvm::InstCombiner::visitURem(), llvm::Interpreter::visitVAArgInst(), llvm::InstCombiner::visitXor(), llvm::InstCombiner::visitZExt(), llvm::Interpreter::visitZExtInst(), width_descending(), llvm::WriteAsOperand(), llvm::WriteConstantInternal(), WriteConstants(), WriteInstruction(), WriteMDNode(), llvm::AssemblyWriter::writeOperand(), llvm::AssemblyWriter::writeParamOperand(), and llvm::BasicBlock::~BasicBlock().

unsigned llvm::Value::getValueID ( ) const
inline

getValueID - Return an ID for the concrete type of this object. This is used to implement the classof checks. This should not be used for any other purpose, as the values may change as LLVM evolves. Also, note that for instructions, the Instruction's opcode is added to InstructionVal. So this means three things:

there is no value with code InstructionVal (no opcode==0).

there are more possible values for the value type than in ValueTy enum.

the InstructionVal enumerator must be the highest valued enumerator in

the ValueTy enum.

Definition at line 233 of file Value.h.

Referenced by llvm::PseudoSourceValue::classof(), llvm::MDString::classof(), llvm::GlobalAlias::classof(), llvm::FixedStackPseudoSourceValue::classof(), llvm::Argument::classof(), llvm::Constant::classof(), llvm::MDNode::classof(), llvm::InlineAsm::classof(), llvm::GlobalVariable::classof(), llvm::ConstantInt::classof(), llvm::BasicBlock::classof(), llvm::ConstantFP::classof(), llvm::GlobalValue::classof(), llvm::ConstantAggregateZero::classof(), llvm::ConstantArray::classof(), llvm::Instruction::classof(), llvm::ConstantStruct::classof(), llvm::Function::classof(), llvm::ConstantVector::classof(), llvm::ConstantPointerNull::classof(), llvm::ConstantDataSequential::classof(), llvm::ConstantDataArray::classof(), llvm::ConstantDataVector::classof(), llvm::BlockAddress::classof(), llvm::ConstantExpr::classof(), llvm::UndefValue::classof(), llvm::isa_impl< Constant, Value >::doit(), llvm::isa_impl< Argument, Value >::doit(), llvm::isa_impl< InlineAsm, Value >::doit(), llvm::isa_impl< Instruction, Value >::doit(), llvm::isa_impl< BasicBlock, Value >::doit(), llvm::isa_impl< Function, Value >::doit(), llvm::isa_impl< GlobalVariable, Value >::doit(), llvm::isa_impl< GlobalAlias, Value >::doit(), llvm::isa_impl< MDNode, Value >::doit(), and llvm::Instruction::getOpcode().

ValueName* llvm::Value::getValueName ( ) const
inline
bool llvm::Value::hasName ( ) const
inline
bool Value::hasNUses ( unsigned  N) const

hasNUses - Return true if this Value has exactly N users.

Definition at line 92 of file Value.cpp.

References N, use_begin(), and use_end().

Referenced by WriteUseList().

bool Value::hasNUsesOrMore ( unsigned  N) const

hasNUsesOrMore - Return true if this value has N users or more. This is logically equivalent to getNumUses() >= N.

Definition at line 103 of file Value.cpp.

References N, use_begin(), and use_end().

Referenced by hasMoreThanOneUseOtherThanLLVMUsed(), llvm::BasicBlock::removePredecessor(), replaceConstantExprOp(), and SRAGlobal().

bool llvm::Value::hasOneUse ( ) const
inline

hasOneUse - Return true if there is exactly one user of this value. This is specialized because it is a common request and does not require traversing the whole use list.

Definition at line 161 of file Value.h.

References I, use_begin(), and use_end().

Referenced by CanEvaluateSExtd(), CanEvaluateShifted(), CanEvaluateShuffled(), CanEvaluateTruncated(), CanEvaluateZExtd(), CheapToScalarize(), CollectInsertionElements(), DeadPHICycle(), detectLog2OfHalf(), llvm::InstCombiner::DoOneIteration(), dyn_castFoldableMul(), FindInitTrampolineFromAlloca(), llvm::SelectionDAGBuilder::FindMergedConditions(), FindSingleUseIdentifiedObject(), llvm::InstCombiner::FoldAndOfICmps(), llvm::FoldBranchToCommonDest(), FoldCondBranchOnPHI(), llvm::InstCombiner::foldFMulConst(), llvm::InstCombiner::FoldGEPICmp(), llvm::InstCombiner::FoldICmpShrCst(), llvm::InstCombiner::FoldOrOfICmps(), llvm::InstCombiner::FoldShiftByConstant(), hasUseOtherThanLLVMUsed(), isFormingBranchFromSelectProfitable(), isReassociableOp(), IsSafeComputationToRemove(), LinearizeExprTree(), ProcessUGT_ADDCST_ADD(), ShouldBreakUpSubtract(), shouldMergeGEPs(), llvm::InstCombiner::SimplifyDivRemOfSelect(), simplifyValueKnownNonZero(), SinkThenElseCodeToEnd(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), llvm::FastISel::tryToFoldLoad(), TryToSimplifyUncondBranchWithICmpInIt(), TryToSinkInstruction(), llvm::InstCombiner::visitAdd(), llvm::InstCombiner::visitAnd(), llvm::InstCombiner::visitBranchInst(), llvm::InstCombiner::visitExtractElementInst(), llvm::InstCombiner::visitFDiv(), llvm::InstCombiner::visitFMul(), llvm::InstCombiner::visitFPTrunc(), llvm::InstCombiner::visitICmpInst(), llvm::InstCombiner::visitICmpInstWithInstAndIntCst(), llvm::InstCombiner::visitInsertElementInst(), llvm::InstCombiner::visitLoadInst(), llvm::InstCombiner::visitMul(), llvm::InstCombiner::visitOr(), llvm::InstCombiner::visitPHINode(), llvm::InstCombiner::visitSelectInstWithICmp(), llvm::InstCombiner::visitSExt(), llvm::InstCombiner::visitStoreInst(), llvm::InstCombiner::visitTrunc(), llvm::InstCombiner::visitXor(), and llvm::InstCombiner::visitZExt().

bool llvm::Value::hasSameSubclassOptionalData ( const Value V) const
inline

hasSameSubclassOptionalData - Test whether the optional flags contained in this value are equal to the optional flags in the given value.

Definition at line 252 of file Value.h.

References SubclassOptionalData.

bool llvm::Value::hasValueHandle ( ) const
inline

hasValueHandle - Return true if there is a value handle associated with this value.

Definition at line 264 of file Value.h.

void llvm::Value::intersectOptionalDataWith ( const Value V)
inline

intersectOptionalDataWith - Clear any optional flags in this value that are not also set in the given value.

Definition at line 258 of file Value.h.

References SubclassOptionalData.

Referenced by HoistThenElseCodeToIf(), and SinkThenElseCodeToEnd().

bool Value::isDereferenceablePointer ( ) const

isDereferenceablePointer - Test if this value is always a pointer to allocated and suitably aligned memory for a simple load or store.

Definition at line 500 of file Value.cpp.

References isDereferenceablePointer().

Referenced by AllCallersPassInValidPointerForArgument(), isSafePHIToSpeculate(), isSafeSelectToSpeculate(), and llvm::isSafeToSpeculativelyExecute().

bool Value::isUsedInBasicBlock ( const BasicBlock BB) const

isUsedInBasicBlock - Return true if this value is used in the specified basic block.

Definition at line 114 of file Value.cpp.

References llvm::BasicBlock::begin(), llvm::dyn_cast(), llvm::BasicBlock::end(), llvm::Instruction::getParent(), use_begin(), and use_end().

void llvm::Value::mutateType ( Type Ty)
inline

mutateType - Mutate the type of this Value to be of the specified type. Note that this is an extremely dangerous operation which can create completely invalid IR very easily. It is strongly recommended that you recreate IR objects with the right types instead of mutating them in place.

Definition at line 342 of file Value.h.

Referenced by llvm::RemapInstruction().

void Value::print ( raw_ostream O,
AssemblyAnnotationWriter AAW = 0 
) const
void Value::printCustom ( raw_ostream O) const
protectedvirtual

printCustom - Value subclasses can override this to implement custom printing behavior.

Reimplemented in llvm::FixedStackPseudoSourceValue.

Definition at line 2207 of file AsmWriter.cpp.

References llvm_unreachable.

Referenced by print().

void Value::replaceAllUsesWith ( Value V)

replaceAllUsesWith - Go through the uses list for this definition and make each use point to "V" instead of "this". After this completes, 'this's use list is guaranteed to be empty.

Definition at line 303 of file Value.cpp.

References llvm::CallingConv::C, getType(), llvm::Use::getUser(), llvm::Use::set(), use_empty(), and llvm::ValueHandleBase::ValueIsRAUWd().

Referenced by AddReachableCodeToWorklist(), BreakUpSubtract(), changeToCall(), checkCSEInPredecessor(), llvm::CloneAndPruneFunctionInto(), ConvertShiftToMul(), cse(), llvm::DeleteDeadBlock(), DeleteInstructionInBlock(), llvm::DemotePHIToStack(), llvm::InstCombiner::DoOneIteration(), llvm::EliminateDuplicatePHINodes(), llvm::objcarc::EraseInstruction(), llvm::expandDivision(), llvm::expandDivisionUpTo32Bits(), llvm::expandRemainder(), llvm::expandRemainderUpTo32Bits(), FindPHIToPartitionLoops(), FoldBlockIntoPredecessor(), FoldTwoEntryPHINode(), GetLoadValueForLoad(), HandleCallsInBlockInlinedThroughInvoke(), HoistThenElseCodeToIf(), INITIALIZE_PASS(), InlineCallIfPossible(), llvm::InlineFunction(), insertFastDiv(), InstallGlobalCtors(), LowerAtomicCmpXchgInst(), LowerAtomicRMWInst(), llvm::IntrinsicLowering::LowerIntrinsicCall(), LowerNegateToMultiply(), llvm::IntrinsicLowering::LowerToByteSwap(), llvm::MapValue(), llvm::BitcodeReader::MaterializeModule(), llvm::MergeBasicBlockIntoOnlyPred(), llvm::MergeBlockIntoPredecessor(), mergeEmptyReturnBlocks(), OptimizeGlobalAddressOfMalloc(), patchAndReplaceAllUsesWith(), promoteSingleBlockAlloca(), llvm::PHINode::removeIncomingValue(), llvm::BasicBlock::removePredecessor(), llvm::LibCallSimplifier::replaceAllUsesWith(), llvm::DIType::replaceAllUsesWith(), replaceAndRecursivelySimplifyImpl(), ReplaceCallWith(), llvm::SCEVExpander::replaceCongruentIVs(), llvm::InstCombiner::ReplaceInstUsesWith(), llvm::ReplaceInstWithValue(), ReplaceUsesOfWith(), llvm::ConstantArray::replaceUsesOfWithOnConstant(), llvm::ConstantStruct::replaceUsesOfWithOnConstant(), llvm::ConstantVector::replaceUsesOfWithOnConstant(), llvm::BlockAddress::replaceUsesOfWithOnConstant(), llvm::ConstantExpr::replaceUsesOfWithOnConstant(), llvm::BitcodeReaderValueList::ResolveConstantForwardRefs(), RewriteHeapSROALoadUser(), rewriteSingleStoreAlloca(), llvm::LoadAndStorePromoter::run(), SinkThenElseCodeToEnd(), speculatePHINodeLoads(), speculateSelectInstLoads(), llvm::SplitLandingPadPredecessors(), SRAGlobal(), tryToMakeAllocaBePromotable(), TryToOptimizeStoreOfMallocToGlobal(), TryToShrinkGlobalToBoolean(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), TryToSimplifyUncondBranchWithICmpInIt(), llvm::UnrollLoop(), llvm::UpgradeIntrinsicCall(), llvm::ObjectSizeOffsetEvaluator::visitPHINode(), and llvm::BasicBlock::~BasicBlock().

void Value::setName ( const Twine Name)

setName() - Change the name of the value, choosing a new unique name if the provided name is taken.

Parameters
NameThe new name; or "" if the value's name should be removed.

Definition at line 175 of file Value.cpp.

References llvm::StringRef::begin(), llvm::StringMapEntry< ValueTy >::Create(), llvm::StringMapEntry< ValueTy >::Destroy(), llvm::StringRef::empty(), llvm::StringRef::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::erase(), F(), getContext(), getName(), getSymTab(), getType(), hasName(), llvm::LLVMContextImpl::IntrinsicIDCache, llvm::Twine::isTriviallyEmpty(), MDStringVal, llvm::LLVMContext::pImpl, llvm::StringMapEntry< ValueTy >::setValue(), llvm::A64DB::ST, and llvm::Twine::toStringRef().

Referenced by llvm::AllocaInst::AllocaInst(), llvm::Argument::Argument(), llvm::BinaryOperator::BinaryOperator(), llvm::CloneBasicBlock(), llvm::CmpInst::CmpInst(), llvm::IRBuilderBase::CreateGlobalString(), FoldBlockIntoPredecessor(), llvm::FoldBranchToCommonDest(), FoldCondBranchOnPHI(), forceRenaming(), generateUnsignedDivisionCode(), llvm::Module::getOrInsertFunction(), llvm::GlobalValue::GlobalValue(), INITIALIZE_PASS(), llvm::IRBuilderDefaultInserter< true >::InsertHelper(), llvm::LoadInst::LoadInst(), llvm::IntrinsicLowering::LowerIntrinsicCall(), NegateValue(), ReplaceCallWith(), llvm::ShuffleVectorInst::ShuffleVectorInst(), llvm::SplitLandingPadPredecessors(), StripSymtab(), takeName(), llvm::UpgradeIntrinsicCall(), UpgradeIntrinsicFunction1(), and UpgradeSSE41Function().

void llvm::Value::setValueName ( ValueName VN)
inline

Definition at line 119 of file Value.h.

Referenced by llvm::MDString::get().

void llvm::Value::setValueSubclassData ( unsigned short  D)
inlineprotected

Definition at line 348 of file Value.h.

Value * Value::stripAndAccumulateInBoundsConstantOffsets ( const DataLayout DL,
APInt Offset 
)

Strips like stripInBoundsConstantOffsets but also accumulates the constant offset stripped.

Stores the resulting constant offset stripped into the APInt provided. The provided APInt will be extended or truncated as needed to be the correct bitwidth for an offset of this pointer type.

If this is called on a non-pointer value, it returns 'this'.

Definition at line 397 of file Value.cpp.

References llvm::APInt::getBitWidth(), llvm::Operator::getOpcode(), llvm::DataLayout::getPointerSizeInBits(), getType(), llvm::SmallPtrSet< PtrType, SmallSize >::insert(), and llvm::Type::isPointerTy().

Referenced by stripAndAccumulateInBoundsConstantOffsets().

const Value* llvm::Value::stripAndAccumulateInBoundsConstantOffsets ( const DataLayout DL,
APInt Offset 
) const
inline

Definition at line 303 of file Value.h.

References stripAndAccumulateInBoundsConstantOffsets().

Value * Value::stripInBoundsConstantOffsets ( )

Strips off unneeded pointer casts and all-constant GEPs from the specified value, returning the original pointer value.

If this is called on a non-pointer value, it returns 'this'.

Definition at line 393 of file Value.cpp.

Referenced by stripInBoundsConstantOffsets().

const Value* llvm::Value::stripInBoundsConstantOffsets ( ) const
inline

Definition at line 289 of file Value.h.

References stripInBoundsConstantOffsets().

Value * Value::stripInBoundsOffsets ( )

Strips off unneeded pointer casts and any in-bounds offsets from the specified value, returning the original pointer value.

If this is called on a non-pointer value, it returns 'this'.

Definition at line 433 of file Value.cpp.

Referenced by stripInBoundsOffsets().

const Value* llvm::Value::stripInBoundsOffsets ( ) const
inline

Definition at line 314 of file Value.h.

References stripInBoundsOffsets().

Value * Value::stripPointerCasts ( )
const Value* llvm::Value::stripPointerCasts ( ) const
inline

Definition at line 271 of file Value.h.

References stripPointerCasts().

Value * Value::stripPointerCastsNoFollowAliases ( )

Strips off any unneeded pointer casts and all-zero GEPs from the specified value, returning the original uncasted value.

If this is called on a non-pointer value, it returns 'this'.

Definition at line 389 of file Value.cpp.

Referenced by llvm::collectUsedGlobalVariables(), FindUsedValues(), and stripPointerCastsNoFollowAliases().

const Value* llvm::Value::stripPointerCastsNoFollowAliases ( ) const
inline

Definition at line 280 of file Value.h.

References stripPointerCastsNoFollowAliases().

void Value::takeName ( Value V)
User* llvm::Value::use_back ( )
inline
const User* llvm::Value::use_back ( ) const
inline

Definition at line 155 of file Value.h.

References use_begin().

use_iterator llvm::Value::use_begin ( )
inline

Definition at line 150 of file Value.h.

Referenced by AddressIsTaken(), llvm::IVUsers::AddUsersImpl(), llvm::InstCombineWorklist::AddUsersToWorkList(), AllCallersPassInValidPointerForArgument(), AllGlobalLoadUsesSimpleEnoughForHeapSRA(), AllUsesOfLoadedValueWillTrapIfNull(), AllUsesOfValueWillTrapIfNull(), AlmostDeadIV(), analyzeGlobalAux(), areAllUsesEqual(), ChangeCalleesToFastCall(), llvm::GraphTraits< const Value * >::child_begin(), llvm::GraphTraits< Value * >::child_begin(), CleanupConstantGlobalUsers(), CleanupPointerRootUsers(), ConstantPropUsersOf(), determinePointerReadAttrs(), llvm::InstCombiner::DoOneIteration(), llvm::detail::PtrUseVisitorBase::enqueueUsers(), enqueueUsersInWorklist(), FindInitTrampolineFromAlloca(), FindPhiPredForUseInBlock(), FindSingleUseIdentifiedObject(), llvm::FoldBranchToCommonDest(), llvm::getMallocType(), getNumUses(), GlobalUsersSafeToSRA(), llvm::Function::hasAddressTaken(), hasLifetimeMarkers(), hasNUses(), hasNUsesOrMore(), hasOneUse(), hasOutsideLoopUser(), hasUsesOutsideLoop(), INITIALIZE_PASS(), llvm::isAllocaPromotable(), isAllocSiteRemovable(), llvm::Constant::isConstantUsed(), llvm::Function::isDefTriviallyDead(), isHighCostExpansion(), isOnlyCopiedFromConstantGlobal(), isOnlyUsedInEntryBlock(), IsOnlyUsedInZeroEqualityComparison(), isSafePHIToSpeculate(), isSafeSelectToSpeculate(), isSafeSROAElementUse(), llvm::isSafeToDestroyConstant(), IsStoredObjCPointer(), isUsedByLifetimeMarker(), isUsedInBasicBlock(), llvm::Instruction::isUsedOutsideOfBlock(), isUsedOutsideOfDefiningBlock(), IsUserOfGlobalSafeForSRA(), LLVMGetFirstUse(), LoadUsesSimpleEnoughForHeapSRA(), llvm::LowerDbgDeclare(), llvm::BitcodeReader::Materialize(), llvm::BitcodeReader::MaterializeModule(), NegateValue(), OnlyUsedBy(), llvm::onlyUsedByLifetimeMarkers(), OptimizeAwayTrappingUsesOfLoads(), OptimizeAwayTrappingUsesOfValue(), OptimizeCmpExpression(), OptimizeGlobalAddressOfMalloc(), OptimizeNoopCopyExpression(), passingValueIsAlwaysUndefined(), PerformHeapAllocSRoA(), llvm::PointerMayBeCaptured(), llvm::ValueEnumerator::print(), ProcessUGT_ADDCST_ADD(), promoteSingleBlockAlloca(), PushDefUseChildren(), pushIVUsers(), llvm::Constant::removeDeadConstantUsers(), removeLifetimeIntrinsicUsers(), RemoveNestAttribute(), replaceAndRecursivelySimplifyImpl(), replaceConstantExprOp(), ReplaceUsesOfMallocWithGlobal(), ReplaceUsesOfWith(), RewriteHeapSROALoadUser(), rewriteNonInstructionUses(), rewriteSingleStoreAlloca(), RewriteUsesOfClonedInstructions(), RewriteUsesOfLoadForHeapSRoA(), llvm::NVPTXLowerAggrCopies::runOnFunction(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), llvm::SparseSolver::Solve(), speculatePHINodeLoads(), speculateSelectInstLoads(), swapMayExposeCSEOpportunities(), tryToMakeAllocaBePromotable(), TryToShrinkGlobalToBoolean(), llvm::UpgradeCallsToIntrinsic(), llvm::Instruction::use_back(), use_back(), usedInGlobalVarDef(), usedInOneFunc(), useFuncSeen(), ValueIsOnlyUsedLocallyOrStoredToOneGlobal(), llvm::InstCombiner::visitICmpInst(), WriteUseList(), and ~Value().

const_use_iterator llvm::Value::use_begin ( ) const
inline

Definition at line 151 of file Value.h.

bool llvm::Value::use_empty ( ) const
inline

Definition at line 149 of file Value.h.

Referenced by AddReachableCodeToWorklist(), llvm::SelectionDAGBuilder::CopyToExportRegsIfNeeded(), DeadPHICycle(), llvm::DeleteDeadBlock(), DeleteDeadInstruction(), deleteDeadInstruction(), DeleteInstructionInBlock(), llvm::MDNode::deleteTemporary(), llvm::DemotePHIToStack(), llvm::DemoteRegToStack(), llvm::Constant::destroyConstantImpl(), llvm::AsmPrinter::doFinalization(), llvm::InstCombiner::DoOneIteration(), llvm::InstCombiner::EraseInstFromFunction(), llvm::objcarc::EraseInstruction(), FindSingleUseIdentifiedObject(), getAdjustedPtr(), hasAddressTakenAndUsed(), hasUseOtherThanLLVMUsed(), INITIALIZE_PASS(), llvm::InlineFunction(), InstallGlobalCtors(), llvm::isInstructionTriviallyDead(), isOnlyUsedInEntryBlock(), isUsedOutsideOfDefiningBlock(), LinearizeExprTree(), llvm::SelectionDAGBuilder::LowerCallOperands(), llvm::IntrinsicLowering::LowerIntrinsicCall(), llvm::BitcodeReader::MaterializeModule(), OptimizeAwayTrappingUsesOfLoads(), OptimizeCmpExpression(), OptimizeGlobalAddressOfMalloc(), OptimizeNoopCopyExpression(), passingValueIsAlwaysUndefined(), llvm::AssemblyWriter::printBasicBlock(), promoteSingleBlockAlloca(), llvm::RecursivelyDeleteTriviallyDeadInstructions(), RemoveDeadConstant(), removeDeadUsersOfConstant(), replaceAllUsesWith(), ReplaceCallWith(), ReplaceUsesOfMallocWithGlobal(), RewriteUsesOfClonedInstructions(), RewriteUsesOfLoadForHeapSRoA(), llvm::LoadAndStorePromoter::run(), llvm::Inliner::runOnSCC(), llvm::FunctionLoweringInfo::set(), llvm::InstCombiner::SimplifyDivRemOfSelect(), SinkThenElseCodeToEnd(), speculatePHINodeLoads(), speculateSelectInstLoads(), SRAGlobal(), tryToMakeAllocaBePromotable(), TryToShrinkGlobalToBoolean(), llvm::PtrUseVisitor< SliceBuilder >::visitGetElementPtrInst(), WriteUseList(), llvm::BasicBlock::~BasicBlock(), and ~Value().

use_iterator llvm::Value::use_end ( )
inline

Definition at line 152 of file Value.h.

Referenced by AddressIsTaken(), llvm::IVUsers::AddUsersImpl(), llvm::InstCombineWorklist::AddUsersToWorkList(), AllCallersPassInValidPointerForArgument(), AllGlobalLoadUsesSimpleEnoughForHeapSRA(), AllUsesOfLoadedValueWillTrapIfNull(), AllUsesOfValueWillTrapIfNull(), AlmostDeadIV(), analyzeGlobalAux(), areAllUsesEqual(), ChangeCalleesToFastCall(), llvm::GraphTraits< const Value * >::child_end(), llvm::GraphTraits< Value * >::child_end(), CleanupConstantGlobalUsers(), CleanupPointerRootUsers(), ConstantPropUsersOf(), determinePointerReadAttrs(), llvm::detail::PtrUseVisitorBase::enqueueUsers(), enqueueUsersInWorklist(), FindInitTrampolineFromAlloca(), FindPhiPredForUseInBlock(), FindSingleUseIdentifiedObject(), llvm::getMallocType(), getNumUses(), GlobalUsersSafeToSRA(), llvm::Function::hasAddressTaken(), hasLifetimeMarkers(), hasNUses(), hasNUsesOrMore(), hasOneUse(), hasOutsideLoopUser(), hasUsesOutsideLoop(), INITIALIZE_PASS(), llvm::isAllocaPromotable(), isAllocSiteRemovable(), llvm::Constant::isConstantUsed(), llvm::Function::isDefTriviallyDead(), isHighCostExpansion(), isOnlyCopiedFromConstantGlobal(), isOnlyUsedInEntryBlock(), IsOnlyUsedInZeroEqualityComparison(), isSafePHIToSpeculate(), isSafeSelectToSpeculate(), isSafeSROAElementUse(), llvm::isSafeToDestroyConstant(), IsStoredObjCPointer(), isUsedByLifetimeMarker(), isUsedInBasicBlock(), llvm::Instruction::isUsedOutsideOfBlock(), isUsedOutsideOfDefiningBlock(), IsUserOfGlobalSafeForSRA(), LLVMGetFirstUse(), LoadUsesSimpleEnoughForHeapSRA(), llvm::LowerDbgDeclare(), llvm::BitcodeReader::Materialize(), llvm::BitcodeReader::MaterializeModule(), NegateValue(), OnlyUsedBy(), llvm::onlyUsedByLifetimeMarkers(), OptimizeAwayTrappingUsesOfLoads(), OptimizeAwayTrappingUsesOfValue(), OptimizeCmpExpression(), OptimizeNoopCopyExpression(), PerformHeapAllocSRoA(), llvm::PointerMayBeCaptured(), llvm::ValueEnumerator::print(), ProcessUGT_ADDCST_ADD(), promoteSingleBlockAlloca(), PushDefUseChildren(), pushIVUsers(), llvm::Constant::removeDeadConstantUsers(), removeLifetimeIntrinsicUsers(), RemoveNestAttribute(), replaceAndRecursivelySimplifyImpl(), replaceConstantExprOp(), ReplaceUsesOfWith(), RewriteHeapSROALoadUser(), rewriteNonInstructionUses(), rewriteSingleStoreAlloca(), RewriteUsesOfClonedInstructions(), RewriteUsesOfLoadForHeapSRoA(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), llvm::SparseSolver::Solve(), swapMayExposeCSEOpportunities(), tryToMakeAllocaBePromotable(), TryToShrinkGlobalToBoolean(), llvm::UpgradeCallsToIntrinsic(), usedInGlobalVarDef(), usedInOneFunc(), useFuncSeen(), ValueIsOnlyUsedLocallyOrStoredToOneGlobal(), WriteUseList(), and ~Value().

const_use_iterator llvm::Value::use_end ( ) const
inline

Definition at line 153 of file Value.h.

Friends And Related Function Documentation

friend class ValueHandleBase
friend

Definition at line 86 of file Value.h.

friend class ValueSymbolTable
friend

Definition at line 85 of file Value.h.

Member Data Documentation

const unsigned llvm::Value::MaximumAlignment = 1u << 29
static

MaximumAlignment - This is the greatest alignment value supported by load, store, and alloca instructions, and global values.

Definition at line 335 of file Value.h.

Referenced by llvm::getOrEnforceKnownAlignment().

unsigned char llvm::Value::SubclassOptionalData
protected

The documentation for this class was generated from the following files: