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
void setGlobalVariableNumOperands (unsigned NumOps)
 Set the number of operands on a GlobalVariable.
void setFunctionNumOperands (unsigned NumOps)
 Set the number of operands on a Function.
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.
 User (Type *ty, unsigned vty, Use *OpList, 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 36 of file User.h.


Member Typedef Documentation

Definition at line 179 of file User.h.

Definition at line 181 of file User.h.

Definition at line 178 of file User.h.

Definition at line 180 of file User.h.


Constructor & Destructor Documentation

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

Definition at line 75 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(), size, 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::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::GetElementPtrInst, llvm::CmpInst, llvm::BlockAddress, llvm::ConstantDataVector, llvm::AtomicRMWInst, llvm::ConstantDataArray, llvm::ConstantDataSequential, llvm::CastInst, llvm::AtomicCmpXchgInst, llvm::ConstantPointerNull, llvm::Function, llvm::ConstantVector, llvm::FenceInst, llvm::ConstantStruct, llvm::Instruction, llvm::StoreInst, llvm::ConstantArray, llvm::GlobalValue, llvm::BinaryOperator, llvm::InstrProfIncrementInst, llvm::ConstantAggregateZero, llvm::VACopyInst, llvm::VAEndInst, 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::VAStartInst, llvm::FPMathOperator, llvm::MemMoveInst, llvm::ConstantFP, llvm::LoadInst, llvm::MemCpyInst, llvm::MemTransferInst, llvm::MemSetInst, llvm::ConstantInt, llvm::MemIntrinsic, llvm::GlobalVariable, llvm::PossiblyExactOperator, llvm::AllocaInst, llvm::Constant, llvm::DbgValueInst, llvm::UnaryInstruction, llvm::OverflowingBinaryOperator, llvm::GlobalAlias, llvm::DbgDeclareInst, llvm::TerminatorInst, llvm::DbgInfoIntrinsic, llvm::GlobalObject, llvm::Operator, and llvm::IntrinsicInst.

Definition at line 239 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 227 of file User.h.

References operands().

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

Definition at line 138 of file User.h.

References llvm::Value::NumUserOperands.

Referenced by llvm::SwitchInst::addCase(), llvm::LandingPadInst::addClause(), llvm::IndirectBrInst::addDestination(), AddReachableCodeToWorklist(), aliasSameBasePointerGEPs(), CanEvaluateShuffled(), canReplaceGEPIdxWithZero(), canTrapImpl(), llvm::GetElementPtrInst::clone_impl(), llvm::CallInst::clone_impl(), llvm::ReturnInst::clone_impl(), llvm::BranchInst::clone_impl(), llvm::InvokeInst::clone_impl(), llvm::collectUsedGlobalVariables(), computeKnownBitsFromOperator(), llvm::ConstantExprKeyType::ConstantExprKeyType(), ConstantFold(), llvm::ConstantFoldLoadThroughGEPConstantExpr(), llvm::DecodeVPERMILPMask(), DeleteDeadInstruction(), llvm::DependenceAnalysis::depends(), emitGlobalConstantArray(), emitGlobalConstantStruct(), llvm::InstCombiner::EraseInstFromFunction(), EvaluateExpression(), EvaluateGEPOffsetExpression(), evaluateICmpRelation(), EvaluateStoreInto(), FindUsedValues(), findUsedValues(), llvm::InstCombiner::FoldCmpLoadFromIndexedGlobal(), llvm::InstCombiner::FoldGEPICmp(), llvm::InstCombiner::FoldSelectOpOp(), GEPToVectorIndex(), llvm::ConstantExpr::getAsInstruction(), getGEPInductionOperand(), getGEPSmallConstantIntOffsetV(), llvm::SCEVExpander::getIVIncOperand(), getLoopPhiForCounter(), llvm::getMergedGlobalExpr(), getNoopInput(), llvm::CallInst::getNumArgOperands(), llvm::GEPOperator::getNumIndices(), llvm::GetElementPtrInst::getNumIndices(), GetOffsetFromIndex(), llvm::Constant::getRelocationInfo(), 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::Function::hasPersonalityFn(), llvm::Instruction::isIdenticalToWhenDefined(), isLikelyComplexAddressComputation(), IsPointerOffset(), IsSafeComputationToRemove(), isSafeSROAElementUse(), llvm::isSafeToSpeculativelyExecute(), llvm::Instruction::isSameOperationAs(), isSimpleEnoughValueToCommitHelper(), IsUserOfGlobalSafeForSRA(), llvm::Loop::makeLoopInvariant(), llvm::MapValue(), mergeEmptyReturnBlocks(), llvm::HungoffOperandTraits< 2 >::op_end(), llvm::OptionalOperandTraits< Function >::operands(), llvm::VariadicOperandTraits< CallInst, 1 >::operands(), llvm::HungoffOperandTraits< 2 >::operands(), llvm::ConstantExprKeyType::operator==(), llvm::RecursivelyDeleteTriviallyDeadInstructions(), RemapInstruction(), llvm::SwitchInst::removeCase(), RemoveDeadConstant(), llvm::IndirectBrInst::removeDestination(), llvm::PHINode::removeIncomingValue(), RemoveInstInputs(), replaceUsesOfWith(), ReplaceUsesOfWith(), llvm::Constant::replaceUsesOfWithOnConstant(), llvm::ConstantArray::replaceUsesOfWithOnConstant(), llvm::ConstantStruct::replaceUsesOfWithOnConstant(), llvm::ConstantVector::replaceUsesOfWithOnConstant(), llvm::ConstantExpr::replaceUsesOfWithOnConstant(), llvm::returnTypeIsEligibleForTailCall(), llvm::InstCombiner::run(), llvm::ExecutionEngine::runStaticConstructorsDestructors(), SinkThenElseCodeToEnd(), SRAGlobal(), stripGetElementPtr(), upgradeGlobalArray(), ValueIsOnlyUsedLocallyOrStoredToOneGlobal(), VerifySubExpr(), llvm::InstCombiner::visitGetElementPtrInst(), llvm::Interpreter::visitReturnInst(), llvm::InstCombiner::visitReturnInst(), WriteConstants(), and WriteInstruction().

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

Definition at line 118 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(), CanPHITrans(), canReplaceGEPIdxWithZero(), CheapToScalarize(), checkForNegativeOperand(), CleanupPointerRootUsers(), llvm::AllocaInst::clone_impl(), llvm::LoadInst::clone_impl(), llvm::StoreInst::clone_impl(), llvm::AtomicCmpXchgInst::clone_impl(), llvm::AtomicRMWInst::clone_impl(), llvm::SelectInst::clone_impl(), llvm::VAArgInst::clone_impl(), llvm::ExtractElementInst::clone_impl(), llvm::InsertElementInst::clone_impl(), llvm::ShuffleVectorInst::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(), CollectBSwapParts(), CollectInsertionElements(), CollectShuffleElements(), CollectSingleShuffleElements(), llvm::collectUsedGlobalVariables(), CommitValueTo(), llvm::InstCombiner::commonCastTransforms(), llvm::InstCombiner::commonIDivTransforms(), llvm::InstCombiner::commonIRemTransforms(), llvm::InstCombiner::commonPointerCastTransforms(), llvm::InstCombiner::commonShiftTransforms(), computeKnownBitsFromOperator(), computeKnownBitsFromTrueCondition(), llvm::ComputeMultiple(), ComputeNumSignBits(), llvm::ConstantExprKeyType::ConstantExprKeyType(), ConstantFold(), llvm::ConstantFoldCompareInstruction(), llvm::ConstantFoldLoadFromConstPtr(), ConstantFoldLoadInst(), ConstantFoldLoadThroughBitcast(), llvm::ConstantFoldLoadThroughGEPConstantExpr(), llvm::ConstantFoldSelectInstruction(), llvm::ConvertDebugDeclareToDebugValue(), ConvertShiftToMul(), createReplacementInstr(), llvm::DecodeVPERMILPMask(), decomposeBitTestICmp(), DecomposeGEPExpression(), DeleteDeadInstruction(), DemandedBitsLHSMask(), detectLog2OfHalf(), 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(), findBeginCatchSplitPoint(), 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(), 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(), getGEPInductionOperand(), getGEPSmallConstantIntOffsetV(), 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(), llvm::Constant::getRelocationInfo(), GetShiftedValue(), getShuffleAndOtherOprd(), llvm::ConstantVector::getSplatValue(), llvm::BitCastOperator::getSrcTy(), llvm::BasicBlock::getTerminatingMustTailCall(), getUniformBase(), llvm::TargetTransformInfoImplCRTPBase< AMDGPUTTIImpl >::getUserCost(), getValueFromFromCondition(), llvm::StoreInst::getValueOperand(), getWideOperand(), llvm::ConstantExpr::getWithOperandReplaced(), handleBranchExpect(), handleIndirectSymViaGOTPCRel(), llvm::GetElementPtrInst::hasAllConstantIndices(), llvm::GetElementPtrInst::hasAllZeroIndices(), hoistBeforePos(), llvm::BinaryOperator::init(), INITIALIZE_PASS(), insertFastDiv(), 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(), isSafeAndProfitableToSinkLoad(), IsSafeComputationToRemove(), isSafeSROAElementUse(), isSafeToEliminateVarargsCast(), llvm::isSafeToSpeculativelyExecute(), isSameCompare(), llvm::Instruction::isSameOperationAs(), isShuffleExtractingFromLHS(), isSimpleEnoughValueToCommitHelper(), isStrideMul(), IsUserOfGlobalSafeForSRA(), LdStHasDebugValue(), LinearizeExprTree(), LookThroughFPExtensions(), llvm::FastISel::lowerCallTo(), llvm::AsmPrinter::lowerConstant(), llvm::IntrinsicLowering::LowerIntrinsicCall(), LowerNegateToMultiply(), llvm::Loop::makeLoopInvariant(), llvm::MapValue(), matchPairwiseReduction(), matchPairwiseReductionAtLevel(), llvm::matchSelectPattern(), matchVectorSplittingReduction(), mergeEmptyReturnBlocks(), needsLFTR(), NegateValue(), llvm::orc::CtorDtorIterator::operator*(), llvm::ConstantExprKeyType::operator==(), OptimizeAwayTrappingUsesOfLoads(), llvm::FastISel::optimizeCmpPredicate(), OptimizeExtractBits(), OptimizeIntegerToVectorInsertions(), OptimizeIntToFloatBitCast(), OptimizeNoopCopyExpression(), PerformHeapAllocSRoA(), llvm::PointerMayBeCaptured(), ProcessUGT_ADDCST_ADD(), ProcessUMulZExtIdiom(), llvm::promoteLoopAccessesToScalars(), llvm::RecursivelyDeleteTriviallyDeadInstructions(), RemapInstruction(), llvm::AliasSetTracker::remove(), RemoveDeadConstant(), RemoveInstInputs(), llvm::InstCombiner::replacedSelectWithOperand(), replaceUsesOfWith(), ReplaceUsesOfWith(), llvm::ConstantStruct::replaceUsesOfWithOnConstant(), llvm::ConstantVector::replaceUsesOfWithOnConstant(), llvm::ConstantExpr::replaceUsesOfWithOnConstant(), 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(), SimplifyAndOfICmps(), SimplifyAssociativeBinOp(), llvm::InstCombiner::SimplifyDivRemOfSelect(), SimplifyICmpInst(), llvm::SimplifyInstruction(), SimplifyOrOfICmps(), llvm::InstCombiner::simplifyRangeCheck(), SinkCast(), SinkCmpExpression(), SinkShiftAndTruncate(), SinkThenElseCodeToEnd(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), SRAGlobal(), stripGetElementPtr(), swapMayExposeCSEOpportunities(), SymbolicallyEvaluateGEP(), ThreadBinOpOverSelect(), tryFactorization(), tryPromoteAllocaToVector(), TryToShrinkGlobalToBoolean(), TryToSimplifyUncondBranchWithICmpInIt(), upgradeGlobalArray(), 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 115 of file User.h.

References getOperandList().

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

Definition at line 133 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 96 of file User.h.

Definition at line 184 of file User.h.

References getOperandList().

Definition at line 188 of file User.h.

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

Definition at line 215 of file User.h.

References value_op_begin(), and value_op_end().

Referenced by findCallees(), and rematerializeLiveValues().

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

References 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 80 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 84 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::ConstantDataVector, llvm::CmpInst, llvm::AtomicRMWInst, llvm::ConstantDataArray, llvm::ConstantDataSequential, llvm::ConstantPointerNull, llvm::AtomicCmpXchgInst, llvm::FenceInst, llvm::ConstantAggregateZero, llvm::StoreInst, llvm::CompareConstantExpr, llvm::ConstantFP, llvm::InsertValueConstantExpr, llvm::ExtractValueConstantExpr, llvm::BinaryOperator, llvm::ShuffleVectorConstantExpr, llvm::InsertElementConstantExpr, llvm::UnaryInstruction, llvm::ExtractElementConstantExpr, llvm::SelectConstantExpr, llvm::ConstantInt, llvm::BinaryConstantExpr, llvm::GlobalVariable, llvm::GlobalAlias, and llvm::UnaryConstantExpr.

Definition at line 106 of file User.cpp.

References 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::UnaryInstruction::operator new(), llvm::InsertElementConstantExpr::operator new(), llvm::ShuffleVectorConstantExpr::operator new(), llvm::ExtractValueConstantExpr::operator new(), llvm::InsertValueConstantExpr::operator new(), llvm::CompareConstantExpr::operator new(), llvm::StoreInst::operator new(), llvm::FenceInst::operator new(), llvm::AtomicCmpXchgInst::operator new(), llvm::ConstantPointerNull::operator new(), llvm::AtomicRMWInst::operator new(), llvm::CmpInst::operator new(), llvm::UndefValue::operator new(), llvm::ShuffleVectorInst::operator new(), llvm::InsertValueInst::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 94 of file User.cpp.

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

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

Definition at line 88 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 getNumOperands(), getOperand(), and setOperand().

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

void llvm::User::setFunctionNumOperands ( unsigned  NumOps) [inline]

Set the number of operands on a Function.

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

References llvm::Value::NumUserOperands.

Referenced by llvm::Function::setPersonalityFn(), and llvm::Function::~Function().

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 148 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 169 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::SwitchInst::removeCase(), llvm::IndirectBrInst::removeDestination(), and llvm::PHINode::removeIncomingValue().

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

Definition at line 122 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(), findBasePointer(), 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::BlockAddress::replaceUsesOfWithOnConstant(), llvm::GlobalAlias::setAliasee(), llvm::CallInst::setArgOperand(), llvm::Function::setPrefixData(), llvm::Function::setPrologueData(), llvm::SwitchInst::CaseIt::setValue(), ShrinkDemandedConstant(), simplifyAllocaArraySize(), 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().

Definition at line 209 of file User.h.

References op_begin().

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

Definition at line 212 of file User.h.

References op_end().

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


Friends And Related Function Documentation

friend struct HungoffOperandTraits [friend]

Definition at line 39 of file User.h.


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