LLVM  4.0.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Friends | List of all members
llvm::User Class Reference

#include <User.h>

Inheritance diagram for llvm::User:
[legend]
Collaboration diagram for llvm::User:
[legend]

Classes

struct  const_value_op_iterator
 
struct  value_op_iterator
 Iterator for directly iterating over the operand Values. More...
 

Public Types

typedef Useop_iterator
 
typedef const Useconst_op_iterator
 
typedef iterator_range
< op_iterator
op_range
 
typedef iterator_range
< const_op_iterator
const_op_range
 
- Public Types inherited from llvm::Value
enum  ValueTy
 Concrete subclass of this. More...
 
typedef use_iterator_impl< Useuse_iterator
 
typedef use_iterator_impl
< const Use
const_use_iterator
 
typedef user_iterator_impl< Useruser_iterator
 
typedef user_iterator_impl
< const User
const_user_iterator
 

Public Member Functions

 User (const User &)=delete
 
 ~User () override=default
 
void operator delete (void *Usr)
 Free memory allocated for User and Use objects. More...
 
void operator delete (void *, unsigned)
 Placement delete - required by std, but never called. More...
 
void operator delete (void *, unsigned, bool)
 Placement delete - required by std, but never called. More...
 
UsegetOperandList ()
 
const UsegetOperandList () const
 
ValuegetOperand (unsigned i) const
 
void setOperand (unsigned i, Value *Val)
 
const UsegetOperandUse (unsigned i) const
 
UsegetOperandUse (unsigned i)
 
unsigned getNumOperands () const
 
ArrayRef< const uint8_t > getDescriptor () const
 Returns the descriptor co-allocated with this User instance. More...
 
MutableArrayRef< uint8_t > getDescriptor ()
 Returns the descriptor co-allocated with this User instance. More...
 
void setGlobalVariableNumOperands (unsigned NumOps)
 Set the number of operands on a GlobalVariable. More...
 
void setNumHungOffUseOperands (unsigned NumOps)
 Subclasses with hung off uses need to manage the operand count themselves. More...
 
op_iterator op_begin ()
 
const_op_iterator op_begin () const
 
op_iterator op_end ()
 
const_op_iterator op_end () const
 
op_range operands ()
 
const_op_range operands () const
 
value_op_iterator value_op_begin ()
 
value_op_iterator value_op_end ()
 
iterator_range< value_op_iteratoroperand_values ()
 
const_value_op_iterator value_op_begin () const
 
const_value_op_iterator value_op_end () const
 
iterator_range
< const_value_op_iterator
operand_values () const
 
void dropAllReferences ()
 Drop all references to operands. More...
 
void replaceUsesOfWith (Value *From, Value *To)
 Replace uses of one Value with another. More...
 
- Public Member Functions inherited from llvm::Value
 Value (const Value &)=delete
 
void operator= (const Value &)=delete
 
virtual ~Value ()
 
void dump () const
 Support for debugging, callable in GDB: V->dump() More...
 
TypegetType () const
 All values are typed, get the type of this value. More...
 
LLVMContextgetContext () const
 All values hold a context through their type. More...
 
bool hasName () const
 
ValueNamegetValueName () const
 
void setValueName (ValueName *VN)
 
StringRef getName () const
 Return a constant reference to the value's name. More...
 
void setName (const Twine &Name)
 Change the name of the value. More...
 
void takeName (Value *V)
 Transfer the name from V to this value. More...
 
void replaceAllUsesWith (Value *V)
 Change all uses of this to point to a new Value. More...
 
void replaceNonMetadataUsesWith (Value *V)
 Change non-metadata uses of this to point to a new Value. More...
 
void replaceUsesOutsideBlock (Value *V, BasicBlock *BB)
 replaceUsesOutsideBlock - Go through the uses list for this definition and make each use point to "V" instead of "this" when the use is outside the block. More...
 
void assertModuleIsMaterialized () const
 
bool use_empty () const
 
use_iterator materialized_use_begin ()
 
const_use_iterator materialized_use_begin () const
 
use_iterator use_begin ()
 
const_use_iterator use_begin () const
 
use_iterator use_end ()
 
const_use_iterator use_end () const
 
iterator_range< use_iteratormaterialized_uses ()
 
iterator_range
< const_use_iterator
materialized_uses () const
 
iterator_range< use_iteratoruses ()
 
iterator_range
< const_use_iterator
uses () const
 
bool user_empty () const
 
user_iterator materialized_user_begin ()
 
const_user_iterator materialized_user_begin () const
 
user_iterator user_begin ()
 
const_user_iterator user_begin () const
 
user_iterator user_end ()
 
const_user_iterator user_end () const
 
Useruser_back ()
 
const Useruser_back () const
 
iterator_range< user_iteratormaterialized_users ()
 
iterator_range
< const_user_iterator
materialized_users () const
 
iterator_range< user_iteratorusers ()
 
iterator_range
< const_user_iterator
users () const
 
bool hasOneUse () const
 Return true if there is exactly one user of this value. More...
 
bool hasNUses (unsigned N) const
 Return true if this Value has exactly N users. More...
 
bool hasNUsesOrMore (unsigned N) const
 Return true if this value has N users or more. More...
 
bool isUsedInBasicBlock (const BasicBlock *BB) const
 Check if this value is used in the specified basic block. More...
 
unsigned getNumUses () const
 This method computes the number of uses of this Value. More...
 
void addUse (Use &U)
 This method should only be used by the Use class. More...
 
unsigned getValueID () const
 Return an ID for the concrete type of this object. More...
 
unsigned getRawSubclassOptionalData () const
 Return the raw optional flags value contained in this value. More...
 
void clearSubclassOptionalData ()
 Clear the optional flags contained in this value. More...
 
bool hasSameSubclassOptionalData (const Value *V) const
 Check the optional flags for equality. More...
 
bool hasValueHandle () const
 Return true if there is a value handle associated with this value. More...
 
bool isUsedByMetadata () const
 Return true if there is metadata referencing this value. More...
 
bool isSwiftError () const
 Return true if this value is a swifterror value. More...
 
ValuestripPointerCasts ()
 Strip off pointer casts, all-zero GEPs, and aliases. More...
 
const ValuestripPointerCasts () const
 
ValuestripPointerCastsNoFollowAliases ()
 Strip off pointer casts and all-zero GEPs. More...
 
const ValuestripPointerCastsNoFollowAliases () const
 
ValuestripInBoundsConstantOffsets ()
 Strip off pointer casts and all-constant inbounds GEPs. More...
 
const ValuestripInBoundsConstantOffsets () const
 
ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset)
 Accumulate offsets from stripInBoundsConstantOffsets(). More...
 
const ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const
 
ValuestripInBoundsOffsets ()
 Strip off pointer casts and inbounds GEPs. More...
 
const ValuestripInBoundsOffsets () const
 
unsigned getPointerDereferenceableBytes (const DataLayout &DL, bool &CanBeNull) const
 Returns the number of bytes known to be dereferenceable for the pointer value. More...
 
unsigned getPointerAlignment (const DataLayout &DL) const
 Returns an alignment of the pointer value. More...
 
ValueDoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB)
 Translate PHI node to its predecessor from the given basic block. More...
 
const ValueDoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const
 
void mutateType (Type *Ty)
 Mutate the type of this Value to be of the specified type. More...
 
template<class Compare >
void sortUseList (Compare Cmp)
 Sort the use-list. More...
 
void reverseUseList ()
 Reverse the use-list. More...
 
void print (raw_ostream &O, bool IsForDebug=false) const
 Implement operator<< on Value. More...
 
void print (raw_ostream &O, ModuleSlotTracker &MST, bool IsForDebug=false) const
 
void printAsOperand (raw_ostream &O, bool PrintType=true, const Module *M=nullptr) const
 Print the name of this Value out to the specified raw_ostream. More...
 
void printAsOperand (raw_ostream &O, bool PrintType, ModuleSlotTracker &MST) const
 

Static Public Member Functions

static bool classof (const Value *V)
 

Protected Member Functions

void * operator new (size_t Size)
 Allocate a User with an operand pointer co-allocated. More...
 
void * operator new (size_t Size, unsigned Us)
 Allocate a User with the operands co-allocated. More...
 
void * operator new (size_t Size, unsigned Us, unsigned DescBytes)
 Allocate a User with the operands co-allocated. More...
 
 User (Type *ty, unsigned vty, Use *, unsigned NumOps)
 
void allocHungoffUses (unsigned N, bool IsPhi=false)
 Allocate the array of Uses, followed by a pointer (with bottom bit set) to the User. More...
 
void growHungoffUses (unsigned N, bool IsPhi=false)
 Grow the number of hung off uses. More...
 
template<int Idx>
UseOp ()
 
template<int Idx>
const UseOp () const
 
- Protected Member Functions inherited from llvm::Value
 Value (Type *Ty, unsigned scid)
 
unsigned short getSubclassDataFromValue () const
 
void setValueSubclassData (unsigned short D)
 

Static Protected Member Functions

template<int Idx, typename U >
static UseOpFrom (const U *that)
 

Friends

template<unsigned >
struct HungoffOperandTraits
 

Additional Inherited Members

- Static Public Attributes inherited from llvm::Value
static const unsigned MaxAlignmentExponent = 29
 The maximum alignment for instructions. More...
 
static const unsigned MaximumAlignment = 1u << MaxAlignmentExponent
 
- Protected Types inherited from llvm::Value
enum  : unsigned { NumUserOperandsBits = 28 }
 The number of operands in the subclass. More...
 
- Protected Attributes inherited from llvm::Value
unsigned char SubclassOptionalData: 7
 Hold subclass data that can be dropped. More...
 
unsigned NumUserOperands: NumUserOperandsBits
 
unsigned IsUsedByMD: 1
 
unsigned HasName: 1
 
unsigned HasHungOffUses: 1
 
unsigned HasDescriptor: 1
 

Detailed Description

Definition at line 45 of file User.h.

Member Typedef Documentation

Definition at line 201 of file User.h.

Definition at line 203 of file User.h.

Definition at line 200 of file User.h.

Definition at line 202 of file User.h.

Constructor & Destructor Documentation

llvm::User::User ( Type ty,
unsigned  vty,
Use ,
unsigned  NumOps 
)
inlineprotected
llvm::User::User ( const User )
delete
llvm::User::~User ( )
overridedefault

Member Function Documentation

void llvm::User::allocHungoffUses ( unsigned  N,
bool  IsPhi = false 
)
protected

Allocate the array of Uses, followed by a pointer (with bottom bit set) to the User.

Parameters
IsPhiidentifies callers which are phi nodes and which need N BasicBlock* allocated along with N

Definition at line 43 of file User.cpp.

References assert(), llvm::WebAssembly::End, llvm::Value::HasHungOffUses, llvm::Use::initTags(), and N.

Referenced by llvm::MemoryPhi::allocHungoffUses(), llvm::PHINode::allocHungoffUses(), and growHungoffUses().

static bool llvm::User::classof ( const Value V)
inlinestatic

Definition at line 281 of file User.h.

void llvm::User::dropAllReferences ( )
inline

Drop all references to operands.

This function is in charge of "letting go" of all objects that this User refers to. This allows one to 'delete' a whole class at a time, even though there may be circular references... First all references are dropped, and all use counts go to zero. Then everything is deleted for real. Note that no operations are valid on an object that has "dropped all references", except operator delete.

Definition at line 269 of file User.h.

References operands().

Referenced by llvm::GlobalVariable::dropAllReferences(), llvm::BasicBlock::dropAllReferences(), llvm::Function::dropAllReferences(), llvm::expandDivision(), llvm::expandDivisionUpTo32Bits(), llvm::expandDivisionUpTo64Bits(), llvm::expandRemainder(), llvm::expandRemainderUpTo32Bits(), llvm::expandRemainderUpTo64Bits(), and llvm::MemorySSA::~MemorySSA().

ArrayRef< const uint8_t > llvm::User::getDescriptor ( ) const

Returns the descriptor co-allocated with this User instance.

Definition at line 96 of file User.cpp.

MutableArrayRef< uint8_t > llvm::User::getDescriptor ( )

Returns the descriptor co-allocated with this User instance.

Definition at line 101 of file User.cpp.

References assert(), llvm::Value::HasDescriptor, and llvm::Value::HasHungOffUses.

unsigned llvm::User::getNumOperands ( ) const
inline

Definition at line 167 of file User.h.

References llvm::Value::NumUserOperands.

Referenced by llvm::SwitchInst::addCase(), llvm::LandingPadInst::addClause(), llvm::IndirectBrInst::addDestination(), llvm::CatchSwitchInst::addHandler(), AddReachableCodeToWorklist(), aliasSameBasePointerGEPs(), canReplaceGEPIdxWithZero(), canSinkInstructions(), canTransformAccumulatorRecursion(), canTrapImpl(), cloneConstantExprWithNewAddressSpace(), llvm::GetElementPtrInst::cloneImpl(), llvm::FuncletPadInst::cloneImpl(), llvm::CallInst::cloneImpl(), llvm::ReturnInst::cloneImpl(), llvm::BranchInst::cloneImpl(), llvm::InvokeInst::cloneImpl(), llvm::CatchReturnInst::cloneImpl(), llvm::CleanupReturnInst::cloneImpl(), llvm::FunctionComparator::cmpConstants(), llvm::FunctionComparator::cmpOperations(), computeKnownBitsFromOperator(), llvm::ConstantExprKeyType::ConstantExprKeyType(), ConstantFold(), llvm::ConstantFoldLoadThroughGEPConstantExpr(), llvm::CallInst::dataOperandHasImpliedAttr(), llvm::InvokeInst::dataOperandHasImpliedAttr(), DCEInstruction(), deleteDeadInstruction(), llvm::DependenceInfo::depends(), DoPromotion(), llvm::Function::dropAllReferences(), llvm::JumpThreadingPass::DuplicateCondBranchOnPHIIntoPred(), eliminateRecursiveTailCall(), emitGlobalConstantArray(), emitGlobalConstantStruct(), llvm::InstCombiner::eraseInstFromFunction(), EvaluateExpression(), llvm::Evaluator::EvaluateFunction(), evaluateGEPOffsetExpression(), evaluateICmpRelation(), EvaluateStoreInto(), FindUsedValues(), findUsedValues(), GEPToVectorIndex(), getAddressAccessSCEV(), getAllocationSize(), llvm::ConstantExpr::getAsInstruction(), llvm::getGEPInductionOperand(), getGEPSmallConstantIntOffsetV(), llvm::SCEVExpander::getIVIncOperand(), getLoopPhiForCounter(), getNoopInput(), llvm::CallInst::getNumArgOperands(), llvm::GEPOperator::getNumIndices(), llvm::GetElementPtrInst::getNumIndices(), GetOffsetFromIndex(), llvm::Function::getPersonalityFn(), llvm::Function::getPrefixData(), llvm::Function::getPrologueData(), getScalarizationOverhead(), llvm::ConstantVector::getSplatValue(), llvm::DependenceInfo::getSplitIteration(), llvm::TargetTransformInfoImplCRTPBase< AMDGPUTTIImpl >::getUserCost(), llvm::DbgInfoIntrinsic::getVariableLocation(), llvm::ConstantExpr::getWithOperandReplaced(), llvm::ConstantExpr::getWithOperands(), growHungoffUses(), llvm::GetElementPtrInst::hasAllConstantIndices(), llvm::GetElementPtrInst::hasAllZeroIndices(), llvm::GEPOperator::hasIndices(), llvm::GetElementPtrInst::hasIndices(), isEmptyXXStructor(), llvm::isGEPBasedOnPointerToString(), llvm::Instruction::isIdenticalToWhenDefined(), IsPointerOffset(), IsSafeComputationToRemove(), isSafeSROAElementUse(), llvm::isSafeToSpeculativelyExecute(), llvm::Instruction::isSameOperationAs(), isSimpleEnoughValueToCommitHelper(), IsUserOfGlobalSafeForSRA(), mergeEmptyReturnBlocks(), llvm::Constant::needsRelocation(), llvm::HungoffOperandTraits< 3 >::op_end(), llvm::OptionalOperandTraits< GlobalVariable >::operands(), llvm::VariadicOperandTraits< CallInst, 1 >::operands(), llvm::HungoffOperandTraits< 3 >::operands(), llvm::ConstantExprKeyType::operator==(), llvm::RecursivelyDeleteTriviallyDeadInstructions(), remapInstruction(), llvm::SwitchInst::removeCase(), llvm::IndirectBrInst::removeDestination(), llvm::CatchSwitchInst::removeHandler(), llvm::PHINode::removeIncomingValue(), RemoveInstInputs(), replaceUsesOfWith(), ReplaceUsesOfWith(), llvm::returnTypeIsEligibleForTailCall(), llvm::InstCombiner::run(), llvm::ExecutionEngine::runStaticConstructorsDestructors(), simplifyAndDCEInstruction(), sinkLastInstruction(), SRAGlobal(), llvm::stripGetElementPtr(), llvm::JumpThreadingPass::ThreadEdge(), ValueIsOnlyUsedLocallyOrStoredToOneGlobal(), llvm::MemorySSA::verifyDefUses(), VerifySubExpr(), llvm::InstCombiner::visitGetElementPtrInst(), VisitGlobalVariableForEmission(), llvm::Interpreter::visitReturnInst(), and llvm::InstCombiner::visitReturnInst().

Value* llvm::User::getOperand ( unsigned  i) const
inline

Definition at line 145 of file User.h.

References assert(), getOperandList(), i, and llvm::Value::NumUserOperands.

Referenced by llvm::AliasSetTracker::add(), AddReachableCodeToWorklist(), llvm::RecurrenceDescriptor::AddReductionVar(), AddressIsTaken(), aliasSameBasePointerGEPs(), BreakUpSubtract(), canEvaluateSExtd(), CanEvaluateShifted(), canEvaluateShiftedShift(), CanEvaluateShuffled(), canEvaluateTruncated(), canEvaluateZExtd(), llvm::CannotBeNegativeZero(), cannotBeOrderedLessThanZeroImpl(), canonicalizeBitCastExtElt(), canonicalizeCmpWithConstant(), CanPHITrans(), canReplaceGEPIdxWithZero(), canReplaceOperandWithVariable(), canRewriteGEPAsOffset(), canSinkInstructions(), canTransformAccumulatorRecursion(), cheapToScalarize(), checkForNegativeOperand(), CleanupPointerRootUsers(), cloneConstantExprWithNewAddressSpace(), llvm::AllocaInst::cloneImpl(), llvm::LoadInst::cloneImpl(), llvm::StoreInst::cloneImpl(), llvm::AtomicCmpXchgInst::cloneImpl(), llvm::AtomicRMWInst::cloneImpl(), llvm::SelectInst::cloneImpl(), llvm::VAArgInst::cloneImpl(), llvm::ExtractElementInst::cloneImpl(), llvm::InsertElementInst::cloneImpl(), llvm::ShuffleVectorInst::cloneImpl(), llvm::TruncInst::cloneImpl(), llvm::ZExtInst::cloneImpl(), llvm::SExtInst::cloneImpl(), llvm::FPTruncInst::cloneImpl(), llvm::FPExtInst::cloneImpl(), llvm::UIToFPInst::cloneImpl(), llvm::SIToFPInst::cloneImpl(), llvm::FPToUIInst::cloneImpl(), llvm::FPToSIInst::cloneImpl(), llvm::IntToPtrInst::cloneImpl(), llvm::PtrToIntInst::cloneImpl(), llvm::BitCastInst::cloneImpl(), llvm::AddrSpaceCastInst::cloneImpl(), cloneInstructionWithNewAddressSpace(), llvm::FunctionComparator::cmpConstants(), llvm::FunctionComparator::cmpOperations(), collectInsertionElements(), collectShuffleElements(), collectSingleShuffleElements(), collectValuesToDemote(), CommitValueTo(), llvm::InstCombiner::commonCastTransforms(), llvm::InstCombiner::commonIDivTransforms(), llvm::InstCombiner::commonIRemTransforms(), llvm::InstCombiner::commonPointerCastTransforms(), llvm::InstCombiner::commonShiftTransforms(), computeKnownBitsFromOperator(), computeKnownBitsFromShiftOperator(), llvm::ComputeMultiple(), ComputeNumSignBits(), llvm::computeOverflowForSignedAdd(), llvm::JumpThreadingPass::ComputeValueKnownInPredecessors(), llvm::ConstantExprKeyType::ConstantExprKeyType(), ConstantFold(), llvm::ConstantFoldCastOperand(), llvm::ConstantFoldCompareInstOperands(), llvm::ConstantFoldCompareInstruction(), llvm::ConstantFoldLoadFromConstPtr(), llvm::ConstantFoldLoadThroughGEPConstantExpr(), llvm::ConstantFoldSelectInstruction(), llvm::ConvertDebugDeclareToDebugValue(), ConvertShiftToMul(), createReplacementInstr(), DCEInstruction(), llvm::decomposeBitTestICmp(), deleteDeadInstruction(), despeculateCountZeros(), detectLog2OfHalf(), detectPopcountIdiom(), llvm::JumpThreadingPass::DuplicateCondBranchOnPHIIntoPred(), eliminateRecursiveTailCall(), emitGlobalConstantArray(), emitGlobalConstantStruct(), emitGlobalConstantVector(), llvm::X86AsmPrinter::EmitInstruction(), EvaluateExpression(), llvm::Evaluator::EvaluateFunction(), evaluateGEPOffsetExpression(), evaluateICmpRelation(), EvaluateStoreInto(), llvm::expandDivision(), llvm::expandDivisionUpTo32Bits(), llvm::expandDivisionUpTo64Bits(), llvm::expandRemainder(), llvm::expandRemainderUpTo32Bits(), llvm::expandRemainderUpTo64Bits(), llvm::AlignmentFromAssumptionsPass::extractAlignmentInfo(), ExtractConstantBytes(), ExtractEquivalentCondition(), llvm::FCmpInst::FCmpInst(), findBuildVector(), findCommonAlignment(), findInitTrampoline(), findInitTrampolineFromAlloca(), findInitTrampolineFromBB(), llvm::SelectionDAGBuilder::FindMergedConditions(), FindSingleUseMultiplyFactors(), FindUsedValues(), findUsedValues(), llvm::InstCombiner::FoldAndOfFCmps(), llvm::InstCombiner::FoldAndOfICmps(), foldBitCastBitwiseLogic(), foldBitCastSelect(), foldBoolSextMaskToSelect(), llvm::FoldBranchToCommonDest(), foldConstantCastPair(), foldConstantInsEltIntoShuffle(), llvm::InstCombiner::foldFMulConst(), foldICmpWithMinMax(), foldInsSequenceIntoBroadcast(), llvm::InstCombiner::FoldItoFPtoI(), foldLogicCastConstant(), foldLogOpOfMaskedICmpsHelper(), foldOperationIntoSelectOperand(), llvm::InstCombiner::FoldOrOfFCmps(), llvm::InstCombiner::FoldOrOfICmps(), foldSelectICmpAndOr(), foldSelectInst(), llvm::InstCombiner::FoldShiftByConstant(), foldShiftByConstOfShiftByConst(), foldVecTruncToExtElt(), GEPToVectorIndex(), getAddressAccessSCEV(), llvm::InsertValueInst::getAggregateOperand(), llvm::CallInst::getArgOperand(), llvm::AllocaInst::getArraySize(), getAsConstantIndexedAddress(), getBinOpsForFactorization(), llvm::SwitchInst::CaseIteratorT< SwitchInst, ConstantInt, BasicBlock >::getCaseValue(), getCommonReturnValue(), llvm::AtomicCmpXchgInst::getCompareOperand(), llvm::MemoryUseOrDef::getDefiningAccess(), getDemandedBitsLHSMask(), llvm::BinaryOperator::getFNegArgument(), llvm::getGEPInductionOperand(), getGEPSmallConstantIntOffsetV(), llvm::getGuaranteedNonFullPoisonOp(), llvm::GlobalIndirectSymbol::getIndirectSymbol(), llvm::InsertValueInst::getInsertedValueOperand(), llvm::SCEVExpander::getIVIncOperand(), getLoopPhiForCounter(), llvm::BinaryOperator::getNegArgument(), llvm::AtomicCmpXchgInst::getNewValOperand(), getNoopInput(), llvm::BinaryOperator::getNotArgument(), GetOffsetFromIndex(), llvm::LoadInst::getPointerOperand(), llvm::StoreInst::getPointerOperand(), llvm::GEPOperator::getPointerOperand(), llvm::PtrToIntOperator::getPointerOperand(), llvm::AtomicCmpXchgInst::getPointerOperand(), llvm::GetElementPtrInst::getPointerOperand(), llvm::PtrToIntInst::getPointerOperand(), llvm::AddrSpaceCastInst::getPointerOperand(), getPointerOperands(), getScalarizationOverhead(), GetShiftedValue(), getShuffleAndOtherOprd(), llvm::getSplatValue(), llvm::ConstantVector::getSplatValue(), llvm::BitCastOperator::getSrcTy(), llvm::BasicBlock::getTerminatingMustTailCall(), llvm::SITargetLowering::getTgtMemIntrinsic(), llvm::TargetTransformInfoImplCRTPBase< AMDGPUTTIImpl >::getUserCost(), getValueFromConditionImpl(), getValueFromICmpCondition(), llvm::StoreInst::getValueOperand(), llvm::ConstantExpr::getWithOperandReplaced(), llvm::ConstantExpr::getWithOperands(), handleBrSelExpect(), handleFree(), handleIndirectSymViaGOTPCRel(), llvm::GetElementPtrInst::hasAllConstantIndices(), llvm::GetElementPtrInst::hasAllZeroIndices(), llvm::BinaryOperator::init(), insertFastDiv(), isAddOfNonZero(), isAllocSiteRemovable(), llvm::AllocaInst::isArrayAllocation(), isChainSelectCmpBranch(), llvm::TargetLoweringBase::isExtFree(), isExtractBitsCandidateUse(), isFMulOrFDivWithConstant(), llvm::SystemZTargetLowering::isFoldableMemAccessOffset(), llvm::InductionDescriptor::isFPInductionPHI(), llvm::isGEPBasedOnPointerToString(), isGOTEquivalentCandidate(), llvm::CastInst::isIntegerCast(), isInterestingPointerComparisonOrSubtraction(), isIntExtFree(), llvm::CastInst::isLosslessCast(), llvm::RecurrenceDescriptor::isMinMaxSelectCmpPattern(), llvm::CastInst::isNoopCast(), IsPointerOffset(), isProfitableToFoldUnconditional(), llvm::AArch64TargetLowering::isProfitableToHoist(), isRepeatedByteSequence(), isReturnNonNull(), isSafeAndProfitableToSinkLoad(), IsSafeComputationToRemove(), isSafeSROAElementUse(), isSafeToEliminateVarargsCast(), llvm::isSafeToSpeculativelyExecute(), isSameCompare(), llvm::Instruction::isSameOperationAs(), isShuffleEquivalentToSelect(), isShuffleExtractingFromLHS(), isSimpleEnoughValueToCommitHelper(), isStrideMul(), IsUserOfGlobalSafeForSRA(), LdStHasDebugValue(), LinearizeExprTree(), lookThroughFPExtensions(), llvm::FastISel::lowerCallTo(), llvm::AsmPrinter::lowerConstant(), llvm::AArch64TargetLowering::lowerInterleavedStore(), llvm::ARMTargetLowering::lowerInterleavedStore(), llvm::IntrinsicLowering::LowerIntrinsicCall(), LowerNegateToMultiply(), MatchBinaryOp(), matchCondition(), matchDeMorgansLaws(), matchExtractIndex(), matchPairwiseReduction(), matchPairwiseReductionAtLevel(), llvm::matchSelectPattern(), matchVectorSplittingReduction(), mayDivideByZero(), mergeEmptyReturnBlocks(), needsLFTR(), llvm::Constant::needsRelocation(), NegateValue(), llvm::orc::CtorDtorIterator::operator*(), llvm::ConstantExprKeyType::operator==(), OptimizeAwayTrappingUsesOfLoads(), llvm::FastISel::optimizeCmpPredicate(), OptimizeExtractBits(), llvm::slpvectorizer::BoUpSLP::optimizeGatherSequence(), optimizeIntegerToVectorInsertions(), OptimizeNoopCopyExpression(), PerformHeapAllocSRoA(), llvm::PointerMayBeCaptured(), processAdd(), processAShr(), llvm::JumpThreadingPass::ProcessBranchOnXOR(), processCmp(), processSDiv(), processSelect(), processSRem(), processUGT_ADDCST_ADD(), processUMulZExtIdiom(), llvm::promoteLoopAccessesToScalars(), llvm::RecursivelyDeleteTriviallyDeadInstructions(), remapInstruction(), llvm::safestack::StackColoring::removeAllMarkers(), RemoveInstInputs(), llvm::InstCombiner::replacedSelectWithOperand(), replaceExtractElements(), replaceUsesOfWith(), ReplaceUsesOfWith(), llvm::returnTypeIsEligibleForTailCall(), reuseOrInsertFastDiv(), reuseTableCompare(), rewriteGEPAsOffset(), rewriteSingleStoreAlloca(), llvm::InstCombiner::run(), llvm::ExecutionEngine::runStaticConstructorsDestructors(), llvm::FastISel::selectBinaryOp(), llvm::FastISel::selectBitCast(), llvm::FastISel::selectCast(), llvm::FastISel::selectExtractValue(), llvm::FastISel::selectGetElementPtr(), llvm::FastISel::selectOperator(), llvm::FastISel::selectPatchpoint(), llvm::FastISel::selectStackmap(), ShouldBreakUpSubtract(), shouldReorderOperands(), ShrinkDemandedConstant(), simplifyAndDCEInstruction(), SimplifyAndOfICmps(), simplifyAssocCastAssoc(), SimplifyAssociativeBinOp(), llvm::InstCombiner::SimplifyDivRemOfSelect(), SimplifyICmpInst(), simplifyICmpWithBinOp(), llvm::SimplifyInstruction(), SimplifyOrOfICmps(), llvm::JumpThreadingPass::SimplifyPartiallyRedundantLoad(), llvm::InstCombiner::simplifyRangeCheck(), SimplifyRelativeLoad(), simplifyValueKnownNonZero(), simplifyX86MaskedLoad(), simplifyX86MaskedStore(), SinkCast(), SinkCmpExpression(), sinkLastInstruction(), SinkShiftAndTruncate(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), SRAGlobal(), llvm::stripGetElementPtr(), swapMayExposeCSEOpportunities(), ThreadBinOpOverSelect(), llvm::JumpThreadingPass::ThreadEdge(), tryFactorization(), tryPromoteAllocaToVector(), TryToShrinkGlobalToBoolean(), TryToSimplifyUncondBranchWithICmpInIt(), llvm::JumpThreadingPass::TryToUnfoldSelect(), VerifySubExpr(), llvm::InstCombiner::visitAdd(), llvm::InstCombiner::visitAddrSpaceCast(), llvm::Interpreter::visitAllocaInst(), llvm::InstCombiner::visitAnd(), llvm::Interpreter::visitAShr(), llvm::InstCombiner::visitAShr(), llvm::Interpreter::visitBinaryOperator(), llvm::InstCombiner::visitBitCast(), llvm::Interpreter::visitBitCastInst(), llvm::Interpreter::visitExtractElementInst(), llvm::InstCombiner::visitExtractElementInst(), llvm::InstCombiner::visitFAdd(), llvm::Interpreter::visitFCmpInst(), llvm::InstCombiner::visitFCmpInst(), llvm::InstCombiner::visitFDiv(), 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::visitFRem(), llvm::InstCombiner::visitFSub(), llvm::InstCombiner::visitGetElementPtrInst(), VisitGlobalVariableForEmission(), llvm::Interpreter::visitICmpInst(), llvm::InstCombiner::visitICmpInst(), llvm::Interpreter::visitInsertElementInst(), llvm::InstCombiner::visitInsertElementInst(), llvm::Interpreter::visitInsertValueInst(), llvm::InstCombiner::visitInsertValueInst(), llvm::InstCombiner::visitIntToPtr(), llvm::Interpreter::visitIntToPtrInst(), visitIVCast(), llvm::InstCombiner::visitLandingPadInst(), llvm::InstCombiner::visitLoadInst(), llvm::Interpreter::visitLShr(), llvm::InstCombiner::visitLShr(), llvm::InstCombiner::visitMul(), llvm::InstCombiner::visitOr(), llvm::InstCombiner::visitPHINode(), llvm::InstCombiner::visitPtrToInt(), llvm::Interpreter::visitPtrToIntInst(), llvm::InstCombiner::visitReturnInst(), llvm::InstCombiner::visitSDiv(), llvm::Interpreter::visitSelectInst(), llvm::InstCombiner::visitSExt(), llvm::Interpreter::visitSExtInst(), llvm::Interpreter::visitShl(), llvm::InstCombiner::visitShl(), llvm::Interpreter::visitShuffleVectorInst(), llvm::InstCombiner::visitShuffleVectorInst(), llvm::Interpreter::visitSIToFPInst(), llvm::InstCombiner::visitSRem(), llvm::Interpreter::visitStoreInst(), llvm::InstCombiner::visitStoreInst(), llvm::InstCombiner::visitSub(), 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(), and llvm::reassociate::XorOpnd::XorOpnd().

Use* llvm::User::getOperandList ( )
inline
const Use* llvm::User::getOperandList ( ) const
inline

Definition at line 141 of file User.h.

References getOperandList().

const Use& llvm::User::getOperandUse ( unsigned  i) const
inline
Use& llvm::User::getOperandUse ( unsigned  i)
inline

Definition at line 162 of file User.h.

References assert(), getOperandList(), i, and llvm::Value::NumUserOperands.

void llvm::User::growHungoffUses ( unsigned  N,
bool  IsPhi = false 
)
protected

Grow the number of hung off uses.

Note that allocHungoffUses should be called if there are no uses.

Definition at line 62 of file User.cpp.

References allocHungoffUses(), assert(), getNumOperands(), getOperandList(), llvm::Value::HasHungOffUses, and llvm::Use::zap().

template<int Idx>
Use& llvm::User::Op ( )
inlineprotected
template<int Idx>
const Use& llvm::User::Op ( ) const
inlineprotected

Definition at line 120 of file User.h.

op_iterator llvm::User::op_begin ( )
inline
const_op_iterator llvm::User::op_begin ( ) const
inline

Definition at line 206 of file User.h.

References getOperandList().

op_iterator llvm::User::op_end ( )
inline
const_op_iterator llvm::User::op_end ( ) const
inline

Definition at line 210 of file User.h.

References getOperandList(), and llvm::Value::NumUserOperands.

iterator_range<value_op_iterator> llvm::User::operand_values ( )
inline
iterator_range<const_value_op_iterator> llvm::User::operand_values ( ) const
inline

Definition at line 257 of file User.h.

References llvm::make_range(), value_op_begin(), and value_op_end().

op_range llvm::User::operands ( )
inline
const_op_range llvm::User::operands ( ) const
inline

Definition at line 216 of file User.h.

References op_begin(), and op_end().

void llvm::User::operator delete ( void *  Usr)

Free memory allocated for User and Use objects.

Definition at line 169 of file User.cpp.

References assert(), llvm::Value::HasDescriptor, llvm::Value::HasHungOffUses, llvm::Value::NumUserOperands, and llvm::Use::zap().

void llvm::User::operator delete ( void *  ,
unsigned   
)
inline

Placement delete - required by std, but never called.

Definition at line 103 of file User.h.

References llvm_unreachable.

void llvm::User::operator delete ( void *  ,
unsigned  ,
bool   
)
inline

Placement delete - required by std, but never called.

Definition at line 107 of file User.h.

References llvm_unreachable.

void * llvm::User::operator new ( size_t  Size)
protected

Allocate a User with an operand pointer co-allocated.

This is used for subclasses which need to allocate a variable number of operands, ie, 'hung off uses'.

Definition at line 153 of file User.cpp.

References llvm::Value::HasDescriptor, llvm::Value::HasHungOffUses, and llvm::Value::NumUserOperands.

void * llvm::User::operator new ( size_t  Size,
unsigned  Us 
)
protected

Allocate a User with the operands co-allocated.

This is used for subclasses which have a fixed number of operands.

Definition at line 145 of file User.cpp.

void * llvm::User::operator new ( size_t  Size,
unsigned  Us,
unsigned  DescBytes 
)
protected

Allocate a User with the operands co-allocated.

If DescBytes is non-zero then allocate an additional DescBytes bytes before the operands. These bytes can be accessed by calling getDescriptor.

DescBytes needs to be divisible by sizeof(void *). The allocated descriptor, if any, is aligned to sizeof(void *) bytes.

This is used for subclasses which have a fixed number of operands.

Definition at line 149 of file User.cpp.

template<int Idx, typename U >
static Use& llvm::User::OpFrom ( const U *  that)
inlinestaticprotected

Definition at line 112 of file User.h.

void llvm::User::replaceUsesOfWith ( Value From,
Value To 
)
void llvm::User::setGlobalVariableNumOperands ( unsigned  NumOps)
inline

Set the number of operands on a GlobalVariable.

GlobalVariable always allocates space for a single operands, but doesn't always use it.

FIXME: As that the number of operands is used to find the start of the allocated memory in operator delete, we need to always think we have 1 operand before delete.

Definition at line 183 of file User.h.

References assert(), and llvm::Value::NumUserOperands.

Referenced by llvm::GlobalVariable::setInitializer(), and llvm::GlobalVariable::~GlobalVariable().

void llvm::User::setNumHungOffUseOperands ( unsigned  NumOps)
inline

Subclasses with hung off uses need to manage the operand count themselves.

In these instances, the operand count isn't used to find the OperandList, so there's no issue in having the operand count change.

Definition at line 191 of file User.h.

References assert(), llvm::Value::HasHungOffUses, llvm::Value::NumUserOperands, and llvm::Value::NumUserOperandsBits.

Referenced by llvm::SwitchInst::addCase(), llvm::LandingPadInst::addClause(), llvm::IndirectBrInst::addDestination(), llvm::CatchSwitchInst::addHandler(), llvm::Function::dropAllReferences(), llvm::SwitchInst::removeCase(), llvm::IndirectBrInst::removeDestination(), llvm::CatchSwitchInst::removeHandler(), and llvm::PHINode::removeIncomingValue().

void llvm::User::setOperand ( unsigned  i,
Value Val 
)
inline

Definition at line 150 of file User.h.

References assert(), getOperandList(), i, and llvm::Value::NumUserOperands.

Referenced by BreakUpSubtract(), llvm::InstCombiner::commonIDivTransforms(), llvm::InstCombiner::commonIRemTransforms(), llvm::InstCombiner::commonPointerCastTransforms(), llvm::InstCombiner::commonShiftTransforms(), ConvertShiftToMul(), DCEInstruction(), deleteDeadInstruction(), llvm::JumpThreadingPass::DuplicateCondBranchOnPHIIntoPred(), eliminateRecursiveTailCall(), foldCttzCtlz(), llvm::FoldReturnIntoUncondBranch(), GetShiftedValue(), handleBrSelExpect(), INITIALIZE_PASS(), llvm::InlineFunction(), LinearizeExprTree(), LowerNegateToMultiply(), mergeEmptyReturnBlocks(), NegateValue(), llvm::JumpThreadingPass::ProcessBranchOnXOR(), processUMulZExtIdiom(), llvm::RecursivelyDeleteTriviallyDeadInstructions(), remapInstruction(), replaceGEPIdxWithZero(), replaceUsesOfWith(), llvm::CallInst::setArgOperand(), llvm::MemoryUseOrDef::setDefiningAccess(), llvm::GlobalIndirectSymbol::setIndirectSymbol(), llvm::SwitchInst::CaseIt::setValue(), ShrinkDemandedConstant(), simplifyAllocaArraySize(), simplifyAndDCEInstruction(), simplifyAssocCastAssoc(), llvm::InstCombiner::SimplifyDivRemOfSelect(), simplifyValueKnownNonZero(), SpeculativelyExecuteBB(), llvm::JumpThreadingPass::ThreadEdge(), TryToSimplifyUncondBranchWithICmpInIt(), updateOperand(), llvm::slpvectorizer::BoUpSLP::vectorizeTree(), llvm::InstCombiner::visitAllocaInst(), llvm::InstCombiner::visitExtractElementInst(), llvm::InstCombiner::visitFCmpInst(), llvm::InstCombiner::visitFDiv(), llvm::InstCombiner::visitGetElementPtrInst(), llvm::InstCombiner::visitLoadInst(), llvm::InstCombiner::visitReturnInst(), llvm::InstCombiner::visitShuffleVectorInst(), llvm::InstCombiner::visitSRem(), llvm::InstCombiner::visitStoreInst(), and llvm::InstCombiner::visitXor().

value_op_iterator llvm::User::value_op_begin ( )
inline

Definition at line 231 of file User.h.

References op_begin().

Referenced by llvm::EliminateDuplicatePHINodes(), markAliveBlocks(), and operand_values().

const_value_op_iterator llvm::User::value_op_begin ( ) const
inline

Definition at line 251 of file User.h.

References op_begin().

value_op_iterator llvm::User::value_op_end ( )
inline

Definition at line 234 of file User.h.

References op_end().

Referenced by llvm::EliminateDuplicatePHINodes(), markAliveBlocks(), and operand_values().

const_value_op_iterator llvm::User::value_op_end ( ) const
inline

Definition at line 254 of file User.h.

References op_end().

Friends And Related Function Documentation

template<unsigned >
friend struct HungoffOperandTraits
friend

Definition at line 47 of file User.h.


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