LLVM  mainline
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Friends
llvm::User Class Reference

#include <User.h>

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

List of all members.

Classes

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 Member Functions

 ~User () override
void operator delete (void *Usr)
 Free memory allocated for User and Use objects.
void operator delete (void *, unsigned)
 Placement delete - required by std, but never called.
void operator delete (void *, unsigned, bool)
 Placement delete - required by std, but never called.
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.
MutableArrayRef< uint8_t > getDescriptor ()
 Returns the descriptor co-allocated with this User instance.
void setGlobalVariableNumOperands (unsigned NumOps)
 Set the number of operands on a GlobalVariable.
void setNumHungOffUseOperands (unsigned NumOps)
 Subclasses with hung off uses need to manage the operand count themselves.
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 ()
void dropAllReferences ()
 Drop all references to operands.
void replaceUsesOfWith (Value *From, Value *To)
 Replace uses of one Value with another.

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.
void * operator new (size_t Size, unsigned Us)
 Allocate a User with the operands co-allocated.
void * operator new (size_t Size, unsigned Us, unsigned DescBytes)
 Allocate a User with the operands co-allocated.
 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.
void growHungoffUses (unsigned N, bool IsPhi=false)
 Grow the number of hung off uses.
template<int Idx>
UseOp ()
template<int Idx>
const UseOp () const

Static Protected Member Functions

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

Friends

struct HungoffOperandTraits

Detailed Description

Definition at line 37 of file User.h.


Member Typedef Documentation

Definition at line 186 of file User.h.

Definition at line 188 of file User.h.

Definition at line 185 of file User.h.

Definition at line 187 of file User.h.


Constructor & Destructor Documentation

llvm::User::User ( Type ty,
unsigned  vty,
Use ,
unsigned  NumOps 
) [inline, protected]
llvm::User::~User ( ) [inline, override]

Definition at line 89 of file User.h.


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 llvm::Value::HasHungOffUses, llvm::Use::initTags(), and llvm::static_assert().

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

static bool llvm::User::classof ( const Value V) [inline, static]

Reimplemented in llvm::AddrSpaceCastInst, llvm::BitCastInst, llvm::PtrToIntInst, llvm::IntToPtrInst, llvm::FPToSIInst, llvm::FPToUIInst, llvm::SIToFPInst, llvm::UIToFPInst, llvm::FPExtInst, llvm::FPTruncInst, llvm::SExtInst, llvm::ZExtInst, llvm::TruncInst, llvm::UnreachableInst, llvm::CleanupReturnInst, llvm::CatchReturnInst, llvm::CatchPadInst, llvm::CleanupPadInst, llvm::CatchSwitchInst, llvm::ResumeInst, llvm::InvokeInst, llvm::IndirectBrInst, llvm::SwitchInst, llvm::BranchInst, llvm::ReturnInst, llvm::LandingPadInst, llvm::PHINode, llvm::InsertValueInst, llvm::ExtractValueInst, llvm::ShuffleVectorInst, llvm::InsertElementInst, llvm::ExtractElementInst, llvm::VAArgInst, llvm::SelectInst, llvm::CallInst, llvm::FCmpInst, llvm::UndefValue, llvm::ICmpInst, llvm::ConstantExpr, llvm::FuncletPadInst, llvm::CmpInst, llvm::GetElementPtrInst, llvm::CastInst, llvm::BlockAddress, llvm::ConstantTokenNone, llvm::AtomicRMWInst, llvm::ConstantDataVector, llvm::ConstantDataArray, llvm::ConstantDataSequential, llvm::AtomicCmpXchgInst, llvm::Function, llvm::BinaryOperator, llvm::ConstantPointerNull, llvm::FenceInst, llvm::ConstantVector, llvm::Instruction, llvm::ConstantStruct, llvm::StoreInst, llvm::ConstantArray, llvm::InstrProfValueProfileInst, llvm::GlobalValue, llvm::InstrProfIncrementInst, llvm::ConstantAggregateZero, llvm::VACopyInst, llvm::ConcreteOperator< Operator, Instruction::ZExt >, llvm::ConcreteOperator< PossiblyExactOperator, Instruction::SDiv >, llvm::ConcreteOperator< Operator, Instruction::BitCast >, llvm::ConcreteOperator< OverflowingBinaryOperator, Instruction::Add >, llvm::ConcreteOperator< OverflowingBinaryOperator, Instruction::Sub >, llvm::ConcreteOperator< OverflowingBinaryOperator, Instruction::Shl >, llvm::ConcreteOperator< PossiblyExactOperator, Instruction::UDiv >, llvm::ConcreteOperator< PossiblyExactOperator, Instruction::LShr >, llvm::ConcreteOperator< Operator, Instruction::GetElementPtr >, llvm::ConcreteOperator< PossiblyExactOperator, Instruction::AShr >, llvm::ConcreteOperator< OverflowingBinaryOperator, Instruction::Mul >, llvm::ConcreteOperator< Operator, Instruction::PtrToInt >, llvm::VAEndInst, llvm::GCRelocateInst, llvm::UnaryInstruction, llvm::VAStartInst, llvm::FPMathOperator, llvm::MemMoveInst, llvm::ConstantFP, llvm::LoadInst, llvm::MemCpyInst, llvm::CompareConstantExpr, llvm::MemTransferInst, llvm::GetElementPtrConstantExpr, llvm::MemSetInst, llvm::ConstantInt, llvm::InsertValueConstantExpr, llvm::MemIntrinsic, llvm::ExtractValueConstantExpr, llvm::GlobalVariable, llvm::AllocaInst, llvm::PossiblyExactOperator, llvm::DbgValueInst, llvm::Constant, llvm::OverflowingBinaryOperator, llvm::GlobalAlias, llvm::DbgDeclareInst, llvm::TerminatorInst, llvm::DbgInfoIntrinsic, llvm::GlobalObject, llvm::Operator, and llvm::IntrinsicInst.

Definition at line 246 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.

Reimplemented in llvm::Function.

Definition at line 234 of file User.h.

References operands().

Referenced by llvm::expandDivision(), llvm::expandDivisionUpTo32Bits(), llvm::expandDivisionUpTo64Bits(), llvm::expandRemainder(), llvm::expandRemainderUpTo32Bits(), and llvm::expandRemainderUpTo64Bits().

Returns the descriptor co-allocated with this User instance.

Definition at line 97 of file User.cpp.

Returns the descriptor co-allocated with this User instance.

Definition at line 102 of file User.cpp.

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

Definition at line 152 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(), canTrapImpl(), 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::collectUsedGlobalVariables(), computeKnownBitsFromOperator(), llvm::ConstantExprKeyType::ConstantExprKeyType(), ConstantFold(), llvm::ConstantFoldLoadThroughGEPConstantExpr(), llvm::CallInst::dataOperandHasImpliedAttr(), llvm::InvokeInst::dataOperandHasImpliedAttr(), DeleteDeadInstruction(), llvm::DependenceAnalysis::depends(), llvm::Function::dropAllReferences(), emitGlobalConstantArray(), emitGlobalConstantStruct(), llvm::InstCombiner::EraseInstFromFunction(), EvaluateExpression(), EvaluateGEPOffsetExpression(), evaluateICmpRelation(), EvaluateStoreInto(), FindUsedValues(), findUsedValues(), llvm::InstCombiner::FoldCmpLoadFromIndexedGlobal(), llvm::InstCombiner::FoldGEPICmp(), llvm::InstCombiner::FoldSelectOpOp(), GEPToVectorIndex(), llvm::ConstantExpr::getAsInstruction(), llvm::getGEPInductionOperand(), getGEPSmallConstantIntOffsetV(), llvm::SCEVExpander::getIVIncOperand(), getLoopPhiForCounter(), llvm::getMergedGlobalExpr(), getNoopInput(), llvm::CallInst::getNumArgOperands(), llvm::GEPOperator::getNumIndices(), llvm::GetElementPtrInst::getNumIndices(), GetOffsetFromIndex(), llvm::Function::getPersonalityFn(), llvm::Function::getPrefixData(), llvm::Function::getPrologueData(), llvm::ConstantVector::getSplatValue(), llvm::DependenceAnalysis::getSplitIteration(), llvm::TargetTransformInfoImplCRTPBase< AMDGPUTTIImpl >::getUserCost(), llvm::ConstantExpr::getWithOperandReplaced(), llvm::ConstantExpr::getWithOperands(), growHungoffUses(), llvm::GetElementPtrInst::hasAllConstantIndices(), llvm::GetElementPtrInst::hasAllZeroIndices(), llvm::GEPOperator::hasIndices(), llvm::GetElementPtrInst::hasIndices(), llvm::Instruction::isIdenticalToWhenDefined(), isLikelyComplexAddressComputation(), IsPointerOffset(), IsSafeComputationToRemove(), isSafeSROAElementUse(), llvm::isSafeToSpeculativelyExecute(), llvm::Instruction::isSameOperationAs(), isSimpleEnoughValueToCommitHelper(), IsUserOfGlobalSafeForSRA(), llvm::MapValue(), 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(), SinkThenElseCodeToEnd(), SRAGlobal(), llvm::stripGetElementPtr(), ValueIsOnlyUsedLocallyOrStoredToOneGlobal(), VerifySubExpr(), llvm::InstCombiner::visitGetElementPtrInst(), llvm::Interpreter::visitReturnInst(), llvm::InstCombiner::visitReturnInst(), and WriteInstruction().

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

Definition at line 132 of file User.h.

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

Referenced by llvm::AliasSetTracker::add(), AddReachableCodeToWorklist(), llvm::RecurrenceDescriptor::AddReductionVar(), AddressIsTaken(), aliasSameBasePointerGEPs(), BreakUpSubtract(), canEvaluateSExtd(), CanEvaluateShifted(), CanEvaluateShuffled(), canEvaluateTruncated(), canEvaluateZExtd(), llvm::CannotBeNegativeZero(), llvm::CannotBeOrderedLessThanZero(), canonicalizeBitCastExtElt(), CanPHITrans(), canReplaceGEPIdxWithZero(), cheapToScalarize(), checkForNegativeOperand(), CleanupPointerRootUsers(), 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(), collectInsertionElements(), collectShuffleElements(), collectSingleShuffleElements(), llvm::collectUsedGlobalVariables(), CommitValueTo(), llvm::InstCombiner::commonCastTransforms(), llvm::InstCombiner::commonIDivTransforms(), llvm::InstCombiner::commonIRemTransforms(), llvm::InstCombiner::commonPointerCastTransforms(), llvm::InstCombiner::commonShiftTransforms(), computeKnownBitsFromOperator(), computeKnownBitsFromShiftOperator(), computeKnownBitsFromTrueCondition(), llvm::ComputeMultiple(), ComputeNumSignBits(), llvm::computeOverflowForSignedAdd(), llvm::ConstantExprKeyType::ConstantExprKeyType(), ConstantFold(), llvm::ConstantFoldCompareInstruction(), llvm::ConstantFoldLoadFromConstPtr(), ConstantFoldLoadInst(), ConstantFoldLoadThroughBitcast(), llvm::ConstantFoldLoadThroughGEPConstantExpr(), llvm::ConstantFoldSelectInstruction(), llvm::ConvertDebugDeclareToDebugValue(), ConvertShiftToMul(), createReplacementInstr(), decomposeBitTestICmp(), DeleteDeadInstruction(), DemandedBitsLHSMask(), despeculateCountZeros(), detectLog2OfHalf(), detectPopcountIdiom(), emitGlobalConstantArray(), emitGlobalConstantStruct(), emitGlobalConstantVector(), llvm::X86AsmPrinter::EmitInstruction(), EvaluateExpression(), EvaluateGEPOffsetExpression(), evaluateICmpRelation(), EvaluateStoreInto(), llvm::expandDivision(), llvm::expandDivisionUpTo32Bits(), llvm::expandDivisionUpTo64Bits(), llvm::expandRemainder(), llvm::expandRemainderUpTo32Bits(), llvm::expandRemainderUpTo64Bits(), ExtractConstantBytes(), ExtractEquivalentCondition(), llvm::FCmpInst::FCmpInst(), findBasePointer(), findCommonAlignment(), FindInitTrampoline(), FindInitTrampolineFromAlloca(), llvm::SelectionDAGBuilder::FindMergedConditions(), FindSingleUseMultiplyFactors(), FindUsedValues(), findUsedValues(), llvm::InstCombiner::FoldAndOfFCmps(), llvm::InstCombiner::FoldAndOfICmps(), llvm::FoldBranchToCommonDest(), llvm::InstCombiner::FoldCmpLoadFromIndexedGlobal(), foldConstantCastPair(), llvm::InstCombiner::FoldFCmp_IntToFP_Cst(), llvm::InstCombiner::foldFMulConst(), llvm::InstCombiner::FoldGEPICmp(), llvm::InstCombiner::FoldICmpDivCst(), llvm::InstCombiner::FoldICmpShrCst(), llvm::InstCombiner::FoldItoFPtoI(), foldLogOpOfMaskedICmpsHelper(), FoldOperationIntoSelectOperand(), llvm::InstCombiner::FoldOrOfFCmps(), llvm::InstCombiner::FoldOrOfICmps(), foldSelectICmpAndOr(), foldSelectInst(), llvm::InstCombiner::FoldSelectOpOp(), llvm::InstCombiner::FoldShiftByConstant(), foldUDivShl(), foldVecTruncToExtElt(), GEPToVectorIndex(), llvm::InsertValueInst::getAggregateOperand(), llvm::GlobalAlias::getAliasee(), llvm::CallInst::getArgOperand(), llvm::AllocaInst::getArraySize(), getBinOpsForFactorization(), llvm::SwitchInst::CaseIteratorT< SwitchInst, ConstantInt, BasicBlock >::getCaseValue(), getCommonReturnValue(), llvm::AtomicCmpXchgInst::getCompareOperand(), llvm::BinaryOperator::getFNegArgument(), llvm::getGEPInductionOperand(), getGEPSmallConstantIntOffsetV(), llvm::getGuaranteedNonFullPoisonOp(), llvm::InsertValueInst::getInsertedValueOperand(), llvm::SCEVExpander::getIVIncOperand(), getLoopPhiForCounter(), llvm::getMergedGlobalExpr(), llvm::BinaryOperator::getNegArgument(), llvm::AtomicCmpXchgInst::getNewValOperand(), getNoopInput(), llvm::BinaryOperator::getNotArgument(), GetOffsetFromIndex(), llvm::LoadInst::getPointerOperand(), llvm::GEPOperator::getPointerOperand(), llvm::StoreInst::getPointerOperand(), llvm::PtrToIntOperator::getPointerOperand(), llvm::AtomicCmpXchgInst::getPointerOperand(), llvm::GetElementPtrInst::getPointerOperand(), llvm::PtrToIntInst::getPointerOperand(), GetShiftedValue(), getShuffleAndOtherOprd(), llvm::getSplatValue(), llvm::ConstantVector::getSplatValue(), llvm::BitCastOperator::getSrcTy(), llvm::BasicBlock::getTerminatingMustTailCall(), llvm::TargetTransformInfoImplCRTPBase< AMDGPUTTIImpl >::getUserCost(), getValueFromFromCondition(), llvm::StoreInst::getValueOperand(), getWideOperand(), llvm::ConstantExpr::getWithOperandReplaced(), llvm::ConstantExpr::getWithOperands(), handleBranchExpect(), handleIndirectSymViaGOTPCRel(), llvm::GetElementPtrInst::hasAllConstantIndices(), llvm::GetElementPtrInst::hasAllZeroIndices(), hoistBeforePos(), llvm::BinaryOperator::init(), INITIALIZE_PASS(), insertFastDiv(), isAddOfNonZero(), isAllocSiteRemovable(), llvm::AllocaInst::isArrayAllocation(), isChainSelectCmpBranch(), IsConstantOffsetFromGlobal(), isEliminableCastPair(), llvm::TargetLoweringBase::isExtFree(), isExtractBitsCandidateUse(), isFMulOrFDivWithConstant(), isGOTEquivalentCandidate(), llvm::CastInst::isIntegerCast(), isInterestingPointerComparisonOrSubtraction(), isIntExtFree(), isLikelyComplexAddressComputation(), 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(), isShuffleExtractingFromLHS(), isSimpleEnoughValueToCommitHelper(), isStrideMul(), IsUserOfGlobalSafeForSRA(), LdStHasDebugValue(), LinearizeExprTree(), lookThroughFPExtensions(), llvm::FastISel::lowerCallTo(), llvm::AsmPrinter::lowerConstant(), llvm::AArch64TargetLowering::lowerInterleavedStore(), llvm::ARMTargetLowering::lowerInterleavedStore(), llvm::IntrinsicLowering::LowerIntrinsicCall(), LowerNegateToMultiply(), llvm::MapValue(), matchCondition(), matchDeMorgansLaws(), matchPairwiseReduction(), matchPairwiseReductionAtLevel(), llvm::matchSelectPattern(), matchVectorSplittingReduction(), mergeEmptyReturnBlocks(), needsLFTR(), llvm::Constant::needsRelocation(), NegateValue(), llvm::orc::CtorDtorIterator::operator*(), llvm::ConstantExprKeyType::operator==(), OptimizeAwayTrappingUsesOfLoads(), llvm::FastISel::optimizeCmpPredicate(), OptimizeExtractBits(), optimizeIntegerToVectorInsertions(), OptimizeNoopCopyExpression(), PerformHeapAllocSRoA(), llvm::PointerMayBeCaptured(), ProcessUGT_ADDCST_ADD(), ProcessUMulZExtIdiom(), llvm::promoteLoopAccessesToScalars(), llvm::RecursivelyDeleteTriviallyDeadInstructions(), RemapInstruction(), llvm::AliasSetTracker::remove(), RemoveInstInputs(), llvm::InstCombiner::replacedSelectWithOperand(), replaceExtractElements(), replaceUsesOfWith(), ReplaceUsesOfWith(), llvm::returnTypeIsEligibleForTailCall(), reuseOrInsertFastDiv(), reuseTableCompare(), rewriteSingleStoreAlloca(), llvm::InstCombiner::run(), llvm::UnifyFunctionExitNodes::runOnFunction(), 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(), ShrinkDemandedConstant(), simplifyAndDCEInstruction(), SimplifyAndOfICmps(), SimplifyAssociativeBinOp(), llvm::InstCombiner::SimplifyDivRemOfSelect(), SimplifyICmpInst(), llvm::SimplifyInstruction(), SimplifyOrOfICmps(), llvm::InstCombiner::simplifyRangeCheck(), SinkCast(), SinkCmpExpression(), SinkShiftAndTruncate(), SinkThenElseCodeToEnd(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), SRAGlobal(), llvm::stripGetElementPtr(), swapMayExposeCSEOpportunities(), SymbolicallyEvaluateGEP(), ThreadBinOpOverSelect(), tryFactorization(), tryPromoteAllocaToVector(), TryToShrinkGlobalToBoolean(), TryToSimplifyUncondBranchWithICmpInIt(), 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(), llvm::Interpreter::visitICmpInst(), llvm::InstCombiner::visitICmpInst(), llvm::InstCombiner::visitICmpInstWithCastAndCast(), llvm::InstCombiner::visitICmpInstWithInstAndIntCst(), 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::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::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(), WriteConstants(), and WriteInstruction().

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

Definition at line 129 of file User.h.

References getOperandList().

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

Definition at line 147 of file User.h.

References getOperandList(), 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 63 of file User.cpp.

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

template<int Idx>
Use& llvm::User::Op ( ) [inline, protected]
template<int Idx>
const Use& llvm::User::Op ( ) const [inline, protected]

Definition at line 110 of file User.h.

Definition at line 191 of file User.h.

References getOperandList().

Definition at line 195 of file User.h.

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

Definition at line 222 of file User.h.

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

Referenced by findCallees(), and rematerializeLiveValues().

Definition at line 201 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 170 of file User.cpp.

References llvm::DI, 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 94 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 98 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'.

Reimplemented in llvm::UnreachableInst, llvm::InsertValueInst, llvm::ShuffleVectorInst, llvm::UndefValue, llvm::CmpInst, llvm::ConstantTokenNone, llvm::ConstantDataVector, llvm::AtomicRMWInst, llvm::ConstantDataArray, llvm::ConstantDataSequential, llvm::AtomicCmpXchgInst, llvm::ConstantPointerNull, llvm::FenceInst, llvm::BinaryOperator, llvm::StoreInst, llvm::ConstantAggregateZero, llvm::UnaryInstruction, llvm::CompareConstantExpr, llvm::ConstantFP, llvm::InsertValueConstantExpr, llvm::ExtractValueConstantExpr, llvm::ShuffleVectorConstantExpr, llvm::InsertElementConstantExpr, llvm::ExtractElementConstantExpr, llvm::SelectConstantExpr, llvm::ConstantInt, llvm::BinaryConstantExpr, llvm::GlobalVariable, llvm::GlobalAlias, and llvm::UnaryConstantExpr.

Definition at line 154 of file User.cpp.

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

Referenced by llvm::UnaryConstantExpr::operator new(), llvm::BinaryConstantExpr::operator new(), llvm::SelectConstantExpr::operator new(), llvm::ExtractElementConstantExpr::operator new(), llvm::InsertElementConstantExpr::operator new(), llvm::ShuffleVectorConstantExpr::operator new(), llvm::ExtractValueConstantExpr::operator new(), llvm::InsertValueConstantExpr::operator new(), llvm::CompareConstantExpr::operator new(), llvm::UnaryInstruction::operator new(), llvm::BinaryOperator::operator new(), llvm::FenceInst::operator new(), llvm::ConstantPointerNull::operator new(), llvm::AtomicRMWInst::operator new(), llvm::CmpInst::operator new(), llvm::UndefValue::operator new(), llvm::ShuffleVectorInst::operator new(), and llvm::UnreachableInst::operator new().

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 146 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 150 of file User.cpp.

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

Definition at line 102 of file User.h.

References op_begin(), and op_end().

void llvm::User::replaceUsesOfWith ( Value From,
Value To 
)

Replace uses of one Value with another.

Replaces all references to the "From" definition with references to the "To" definition.

Definition at line 24 of file User.cpp.

References E, getNumOperands(), getOperand(), and setOperand().

Referenced by llvm::DemoteRegToStack(), makeAllConstantUsesInstructions(), OptimizeGlobalAddressOfMalloc(), rematerializeLiveValues(), and ReplaceUsesOfMallocWithGlobal().

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 168 of file User.h.

References llvm::Value::NumUserOperands.

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

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 176 of file User.h.

References 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 136 of file User.h.

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

Referenced by BreakUpSubtract(), llvm::InstCombiner::commonIDivTransforms(), llvm::InstCombiner::commonIRemTransforms(), llvm::InstCombiner::commonPointerCastTransforms(), llvm::InstCombiner::commonShiftTransforms(), ConvertShiftToMul(), DeleteDeadInstruction(), llvm::InstCombiner::FoldICmpDivCst(), llvm::InstCombiner::FoldICmpShrCst(), llvm::FoldReturnIntoUncondBranch(), GetShiftedValue(), handleBranchExpect(), INITIALIZE_PASS(), llvm::InlineFunction(), LinearizeExprTree(), LowerNegateToMultiply(), mergeEmptyReturnBlocks(), NegateValue(), ProcessUMulZExtIdiom(), llvm::RecursivelyDeleteTriviallyDeadInstructions(), RemapInstruction(), replaceGEPIdxWithZero(), replaceUsesOfWith(), llvm::GlobalAlias::setAliasee(), llvm::CallInst::setArgOperand(), llvm::SwitchInst::CaseIt::setValue(), ShrinkDemandedConstant(), simplifyAllocaArraySize(), simplifyAndDCEInstruction(), llvm::InstCombiner::SimplifyDivRemOfSelect(), SinkThenElseCodeToEnd(), SpeculativelyExecuteBB(), TryToSimplifyUncondBranchWithICmpInIt(), updateOperand(), llvm::InstCombiner::visitAllocaInst(), llvm::InstCombiner::visitExtractElementInst(), llvm::InstCombiner::visitFCmpInst(), llvm::InstCombiner::visitGetElementPtrInst(), llvm::InstCombiner::visitICmpInst(), llvm::InstCombiner::visitICmpInstWithInstAndIntCst(), llvm::InstCombiner::visitLoadInst(), llvm::InstCombiner::visitReturnInst(), llvm::InstCombiner::visitShuffleVectorInst(), llvm::InstCombiner::visitSRem(), llvm::InstCombiner::visitStoreInst(), and llvm::InstCombiner::visitXor().


Friends And Related Function Documentation

friend struct HungoffOperandTraits [friend]

Definition at line 40 of file User.h.


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