LLVM API Documentation
#include <Instructions.h>
Public Member Functions | |
~PHINode () | |
DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Value) | |
Provide fast operand accessors. More... | |
block_iterator | block_begin () |
const_block_iterator | block_begin () const |
block_iterator | block_end () |
const_block_iterator | block_end () const |
unsigned | getNumIncomingValues () const |
Value * | getIncomingValue (unsigned i) const |
void | setIncomingValue (unsigned i, Value *V) |
BasicBlock * | getIncomingBlock (unsigned i) const |
BasicBlock * | getIncomingBlock (const Use &U) const |
template<typename U > | |
BasicBlock * | getIncomingBlock (value_use_iterator< U > I) const |
void | setIncomingBlock (unsigned i, BasicBlock *BB) |
void | addIncoming (Value *V, BasicBlock *BB) |
Value * | removeIncomingValue (unsigned Idx, bool DeletePHIIfEmpty=true) |
Value * | removeIncomingValue (const BasicBlock *BB, bool DeletePHIIfEmpty=true) |
int | getBasicBlockIndex (const BasicBlock *BB) const |
Value * | getIncomingValueForBlock (const BasicBlock *BB) const |
Value * | hasConstantValue () const |
![]() | |
~Instruction () | |
Instruction * | use_back () |
const Instruction * | use_back () const |
const BasicBlock * | getParent () const |
BasicBlock * | getParent () |
void | removeFromParent () |
void | eraseFromParent () |
void | insertBefore (Instruction *InsertPos) |
void | insertAfter (Instruction *InsertPos) |
void | moveBefore (Instruction *MovePos) |
unsigned | getOpcode () const |
getOpcode() returns a member of one of the enums like Instruction::Add. More... | |
const char * | getOpcodeName () const |
bool | isTerminator () const |
bool | isBinaryOp () const |
bool | isShift () |
bool | isCast () const |
bool | isLogicalShift () const |
bool | isArithmeticShift () const |
isArithmeticShift - Return true if this is an arithmetic shift right. More... | |
bool | hasMetadata () const |
bool | hasMetadataOtherThanDebugLoc () const |
MDNode * | getMetadata (unsigned KindID) const |
MDNode * | getMetadata (StringRef Kind) const |
void | getAllMetadata (SmallVectorImpl< std::pair< unsigned, MDNode * > > &MDs) const |
void | getAllMetadataOtherThanDebugLoc (SmallVectorImpl< std::pair< unsigned, MDNode * > > &MDs) const |
void | setMetadata (unsigned KindID, MDNode *Node) |
void | setMetadata (StringRef Kind, MDNode *Node) |
void | setDebugLoc (const DebugLoc &Loc) |
setDebugLoc - Set the debug location information for this instruction. More... | |
const DebugLoc & | getDebugLoc () const |
getDebugLoc - Return the debug location for this node as a DebugLoc. More... | |
void | setHasUnsafeAlgebra (bool B) |
void | setHasNoNaNs (bool B) |
void | setHasNoInfs (bool B) |
void | setHasNoSignedZeros (bool B) |
void | setHasAllowReciprocal (bool B) |
void | setFastMathFlags (FastMathFlags FMF) |
bool | hasUnsafeAlgebra () const |
Determine whether the unsafe-algebra flag is set. More... | |
bool | hasNoNaNs () const |
Determine whether the no-NaNs flag is set. More... | |
bool | hasNoInfs () const |
Determine whether the no-infs flag is set. More... | |
bool | hasNoSignedZeros () const |
Determine whether the no-signed-zeros flag is set. More... | |
bool | hasAllowReciprocal () const |
Determine whether the allow-reciprocal flag is set. More... | |
FastMathFlags | getFastMathFlags () const |
void | copyFastMathFlags (const Instruction *I) |
Copy I's fast-math flags. More... | |
bool | isAssociative () const |
bool | isCommutative () const |
bool | isIdempotent () const |
bool | isNilpotent () const |
bool | mayWriteToMemory () const |
bool | mayReadFromMemory () const |
bool | mayReadOrWriteMemory () const |
bool | mayThrow () const |
bool | mayReturn () const |
bool | mayHaveSideEffects () const |
Instruction * | clone () const |
bool | isIdenticalTo (const Instruction *I) const |
bool | isIdenticalToWhenDefined (const Instruction *I) const |
bool | isSameOperationAs (const Instruction *I, unsigned flags=0) const |
Determine if one instruction is the same operation as another. More... | |
bool | isUsedOutsideOfBlock (const BasicBlock *BB) const |
![]() | |
~User () | |
void | operator delete (void *Usr) |
operator delete - 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... | |
Value * | getOperand (unsigned i) const |
void | setOperand (unsigned i, Value *Val) |
const Use & | getOperandUse (unsigned i) const |
Use & | getOperandUse (unsigned i) |
unsigned | getNumOperands () const |
op_iterator | op_begin () |
const_op_iterator | op_begin () const |
op_iterator | op_end () |
const_op_iterator | op_end () const |
value_op_iterator | value_op_begin () |
value_op_iterator | value_op_end () |
void | dropAllReferences () |
void | replaceUsesOfWith (Value *From, Value *To) |
![]() | |
virtual | ~Value () |
void | dump () const |
dump - Support for debugging, callable in GDB: V->dump() More... | |
void | print (raw_ostream &O, AssemblyAnnotationWriter *AAW=0) const |
Type * | getType () const |
LLVMContext & | getContext () const |
All values hold a context through their type. More... | |
bool | hasName () const |
ValueName * | getValueName () const |
void | setValueName (ValueName *VN) |
StringRef | getName () const |
void | setName (const Twine &Name) |
void | takeName (Value *V) |
void | replaceAllUsesWith (Value *V) |
bool | use_empty () const |
use_iterator | use_begin () |
const_use_iterator | use_begin () const |
use_iterator | use_end () |
const_use_iterator | use_end () const |
User * | use_back () |
const User * | use_back () const |
bool | hasOneUse () const |
bool | hasNUses (unsigned N) const |
bool | hasNUsesOrMore (unsigned N) const |
bool | isUsedInBasicBlock (const BasicBlock *BB) const |
unsigned | getNumUses () const |
void | addUse (Use &U) |
unsigned | getValueID () const |
unsigned | getRawSubclassOptionalData () const |
void | clearSubclassOptionalData () |
bool | hasSameSubclassOptionalData (const Value *V) const |
void | intersectOptionalDataWith (const Value *V) |
bool | hasValueHandle () const |
Value * | stripPointerCasts () |
Strips off any unneeded pointer casts, all-zero GEPs and aliases from the specified value, returning the original uncasted value. More... | |
const Value * | stripPointerCasts () const |
Value * | stripPointerCastsNoFollowAliases () |
Strips off any unneeded pointer casts and all-zero GEPs from the specified value, returning the original uncasted value. More... | |
const Value * | stripPointerCastsNoFollowAliases () const |
Value * | stripInBoundsConstantOffsets () |
Strips off unneeded pointer casts and all-constant GEPs from the specified value, returning the original pointer value. More... | |
const Value * | stripInBoundsConstantOffsets () const |
Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) |
Strips like stripInBoundsConstantOffsets but also accumulates the constant offset stripped. More... | |
const Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const |
Value * | stripInBoundsOffsets () |
Strips off unneeded pointer casts and any in-bounds offsets from the specified value, returning the original pointer value. More... | |
const Value * | stripInBoundsOffsets () const |
bool | isDereferenceablePointer () const |
Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) |
const Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const |
void | mutateType (Type *Ty) |
![]() | |
Instruction * | getPrevNode () |
Get the previous node, or 0 for the list head. More... | |
const Instruction * | getPrevNode () const |
Get the previous node, or 0 for the list head. More... | |
Instruction * | getNextNode () |
Get the next node, or 0 for the list tail. More... | |
const Instruction * | getNextNode () const |
Get the next node, or 0 for the list tail. More... | |
Static Public Member Functions | |
static PHINode * | Create (Type *Ty, unsigned NumReservedValues, const Twine &NameStr="", Instruction *InsertBefore=0) |
static PHINode * | Create (Type *Ty, unsigned NumReservedValues, const Twine &NameStr, BasicBlock *InsertAtEnd) |
static unsigned | getOperandNumForIncomingValue (unsigned i) |
static unsigned | getIncomingValueNumForOperand (unsigned i) |
static bool | classof (const Instruction *I) |
Methods for support type inquiry through isa, cast, and dyn_cast: More... | |
static bool | classof (const Value *V) |
![]() | |
static const char * | getOpcodeName (unsigned OpCode) |
static bool | isTerminator (unsigned OpCode) |
static bool | isBinaryOp (unsigned Opcode) |
static bool | isShift (unsigned Opcode) |
Determine if the Opcode is one of the shift instructions. More... | |
static bool | isCast (unsigned OpCode) |
Determine if the OpCode is one of the CastInst instructions. More... | |
static bool | isAssociative (unsigned op) |
static bool | isCommutative (unsigned op) |
static bool | isIdempotent (unsigned op) |
static bool | isNilpotent (unsigned op) |
static bool | classof (const Value *V) |
Methods for support type inquiry through isa, cast, and dyn_cast: More... | |
![]() | |
static bool | classof (const Value *V) |
Protected Member Functions | |
Use * | allocHungoffUses (unsigned) const |
virtual PHINode * | clone_impl () const |
![]() | |
void | setInstructionSubclassData (unsigned short D) |
unsigned | getSubclassDataFromInstruction () const |
Instruction (Type *Ty, unsigned iType, Use *Ops, unsigned NumOps, Instruction *InsertBefore=0) | |
Instruction (Type *Ty, unsigned iType, Use *Ops, unsigned NumOps, BasicBlock *InsertAtEnd) | |
![]() | |
void * | operator new (size_t s, unsigned Us) |
User (Type *ty, unsigned vty, Use *OpList, unsigned NumOps) | |
Use * | allocHungoffUses (unsigned) const |
void | dropHungoffUses () |
template<int Idx> | |
Use & | Op () |
template<int Idx> | |
const Use & | Op () const |
![]() | |
virtual void | printCustom (raw_ostream &O) const |
Value (Type *Ty, unsigned scid) | |
unsigned short | getSubclassDataFromValue () const |
void | setValueSubclassData (unsigned short D) |
![]() | |
ilist_node () | |
Additional Inherited Members | |
![]() | |
static const unsigned | MaximumAlignment = 1u << 29 |
![]() | |
template<int Idx, typename U > | |
static Use & | OpFrom (const U *that) |
![]() | |
Use * | OperandList |
unsigned | NumOperands |
![]() | |
unsigned char | SubclassOptionalData: 7 |
Definition at line 1978 of file Instructions.h.
typedef BasicBlock** llvm::PHINode::block_iterator |
Definition at line 2030 of file Instructions.h.
typedef BasicBlock* const* llvm::PHINode::const_block_iterator |
Definition at line 2031 of file Instructions.h.
PHINode::~PHINode | ( | ) |
Definition at line 96 of file Instructions.cpp.
References llvm::User::dropHungoffUses().
|
inline |
addIncoming - Add an incoming value to the end of the PHI list
Definition at line 2100 of file Instructions.h.
References llvm::Intrinsic::getType(), and llvm::Value::getType().
Referenced by AddPHINodeEntriesForMappedBlock(), llvm::SSAUpdaterTraits< SSAUpdater >::AddPHIOperand(), AddPredecessorToBlock(), ConnectProlog(), convertMemSetToLoop(), convertTransferToLoop(), createPHIsForSplitLoopExit(), generateUnsignedDivisionCode(), llvm::SSAUpdater::GetValueInMiddleOfBlock(), llvm::InlineFunction(), insertFastDiv(), LLVMAddIncoming(), mergeEmptyReturnBlocks(), PerformHeapAllocSRoA(), redirectValuesFromPredecessorsToPhi(), SimplifyBranchOnICmpChain(), SimplifyCondBranchToCondBranch(), SinkThenElseCodeToEnd(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), speculatePHINodeLoads(), llvm::SplitLandingPadPredecessors(), tryToMakeAllocaBePromotable(), TryToSimplifyUncondBranchWithICmpInIt(), llvm::UnrollLoop(), UpdatePHINodes(), and llvm::ObjectSizeOffsetEvaluator::visitPHINode().
Definition at line 100 of file Instructions.cpp.
References llvm::Use::initTags(), and N.
|
inline |
Definition at line 2033 of file Instructions.h.
Referenced by llvm::EliminateDuplicatePHINodes(), and removeIncomingValue().
|
inline |
Definition at line 2039 of file Instructions.h.
|
inline |
Definition at line 2045 of file Instructions.h.
Referenced by llvm::EliminateDuplicatePHINodes(), and removeIncomingValue().
|
inline |
Definition at line 2049 of file Instructions.h.
|
inlinestatic |
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition at line 2150 of file Instructions.h.
References llvm::Instruction::getOpcode(), and llvm::TargetOpcode::PHI.
Definition at line 2153 of file Instructions.h.
|
protectedvirtual |
Implements llvm::Instruction.
Definition at line 3648 of file Instructions.cpp.
|
inlinestatic |
Constructors - NumReservedValues is a hint for the number of incoming edges that this phi node will have (use 0 if you really have no idea).
Definition at line 2013 of file Instructions.h.
Referenced by ConnectProlog(), llvm::SSAUpdaterTraits< SSAUpdater >::CreateEmptyPHI(), llvm::IRBuilder< true, TargetFolder >::CreatePHI(), createPHIsForSplitLoopExit(), GetHeapSROAValue(), llvm::SSAUpdater::GetValueInMiddleOfBlock(), llvm::InlineFunction(), mergeEmptyReturnBlocks(), llvm::UnifyFunctionExitNodes::runOnFunction(), SimplifyCondBranchToCondBranch(), SinkThenElseCodeToEnd(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), llvm::SplitLandingPadPredecessors(), tryToMakeAllocaBePromotable(), and UpdatePHINodes().
|
inlinestatic |
Definition at line 2018 of file Instructions.h.
llvm::PHINode::DECLARE_TRANSPARENT_OPERAND_ACCESSORS | ( | Value | ) |
Provide fast operand accessors.
|
inline |
getBasicBlockIndex - Return the first index of the specified basic block in the value list for this PHI. Returns -1 if no instance.
Definition at line 2132 of file Instructions.h.
Referenced by AlmostDeadIV(), CloneLoopBlocks(), ConnectProlog(), createPHIsForSplitLoopExit(), FindLoopCounter(), needsLFTR(), llvm::BasicBlock::replaceSuccessorsPhiUsesWith(), RewriteUsesOfClonedInstructions(), SpeculativelyExecuteBB(), llvm::BasicBlock::splitBasicBlock(), llvm::SplitCriticalEdge(), UpdatePHINodes(), and llvm::InstCombiner::visitPHINode().
|
inline |
getIncomingBlock - Return incoming basic block number i
.
Definition at line 2074 of file Instructions.h.
Referenced by CanPropagatePredecessorsForPHIs(), llvm::CloneAndPruneFunctionInto(), llvm::DemotePHIToStack(), llvm::InstCombiner::DoOneIteration(), llvm::CodeExtractor::extractCodeRegion(), FindPhiPredForUseInBlock(), FindPHIToPartitionLoops(), FoldCondBranchOnPHI(), FoldTwoEntryPHINode(), gatherIncomingValuesToPhi(), llvm::GetIfCondition(), getInsertPointForUses(), HoistThenElseCodeToIf(), IsEquivalentPHI(), llvm::Instruction::isIdenticalToWhenDefined(), isSafePHIToSpeculate(), llvm::Instruction::isUsedOutsideOfBlock(), IVUseShouldUsePostIncValue(), OptimizeNoopCopyExpression(), PerformHeapAllocSRoA(), redirectValuesFromPredecessorsToPhi(), llvm::BasicBlock::removePredecessor(), removeUndefIntroducingPredecessor(), replaceUndefValuesInPhi(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), speculatePHINodeLoads(), llvm::SplitCriticalEdge(), SplitCriticalSideEffectEdges(), tryToMakeAllocaBePromotable(), llvm::InstCombiner::visitPHINode(), llvm::ObjectSizeOffsetEvaluator::visitPHINode(), and WriteInstruction().
|
inline |
getIncomingBlock - Return incoming basic block corresponding to an operand of the PHI.
Definition at line 2081 of file Instructions.h.
References llvm::Use::getUser().
|
inline |
getIncomingBlock - Return incoming basic block corresponding to value use iterator.
Definition at line 2090 of file Instructions.h.
References llvm::value_use_iterator< UserTy >::getUse().
getIncomingValue - Return incoming value number x
Definition at line 2059 of file Instructions.h.
Referenced by AllGlobalLoadUsesSimpleEnoughForHeapSRA(), AlmostDeadIV(), CanEvaluateSExtd(), CanEvaluateShifted(), CanEvaluateTruncated(), CanEvaluateZExtd(), CanPropagatePredecessorsForPHIs(), llvm::CloneAndPruneFunctionInto(), CloneLoopBlocks(), llvm::ComputeMaskedBits(), llvm::ComputeNumSignBits(), llvm::FunctionLoweringInfo::ComputePHILiveOutRegInfo(), createPHIsForSplitLoopExit(), llvm::DemotePHIToStack(), FindLoopCounter(), FindPHIToPartitionLoops(), FoldCondBranchOnPHI(), FoldTwoEntryPHINode(), gatherIncomingValuesToPhi(), getInsertPointForUses(), GetShiftedValue(), hasConstantValue(), IsEquivalentPHI(), isSafePHIToSpeculate(), IVUseShouldUsePostIncValue(), needsLFTR(), PerformHeapAllocSRoA(), PHIsEqualValue(), redirectValuesFromPredecessorsToPhi(), removeIncomingValue(), removeUndefIntroducingPredecessor(), replaceUndefValuesInPhi(), SimplifyPHINode(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), speculatePHINodeLoads(), SpeculativelyExecuteBB(), SplitCriticalSideEffectEdges(), ThreadBinOpOverPHI(), ThreadCmpOverPHI(), tryToMakeAllocaBePromotable(), llvm::InstCombiner::visitPHINode(), llvm::ObjectSizeOffsetEvaluator::visitPHINode(), and WriteInstruction().
|
inline |
Definition at line 2139 of file Instructions.h.
Referenced by AddPHINodeEntriesForMappedBlock(), AddPredecessorToBlock(), CanPropagatePredecessorsForPHIs(), CloneLoopBlocks(), ConnectProlog(), llvm::Value::DoPHITranslation(), FoldCondBranchOnPHI(), genLoopLimit(), llvm::Loop::getCanonicalInductionVariable(), HoistThenElseCodeToIf(), isProfitableToFoldUnconditional(), isSafeToHoistInvoke(), llvm::SCEVExpander::replaceCongruentIVs(), SafeToMergeTerminators(), SimplifyBranchOnICmpChain(), SimplifyCondBranchToCondBranch(), SpeculativelyExecuteBB(), llvm::UnrollLoop(), and UpdatePHINodes().
Definition at line 2068 of file Instructions.h.
Referenced by llvm::IVUsers::AddUsersImpl().
|
inline |
getNumIncomingValues - Return the number of incoming edges
Definition at line 2055 of file Instructions.h.
Referenced by AllGlobalLoadUsesSimpleEnoughForHeapSRA(), CanEvaluateSExtd(), CanEvaluateShifted(), CanEvaluateTruncated(), CanEvaluateZExtd(), CanPropagatePredecessorsForPHIs(), llvm::CloneAndPruneFunctionInto(), llvm::ComputeMaskedBits(), llvm::ComputeNumSignBits(), llvm::FunctionLoweringInfo::ComputePHILiveOutRegInfo(), ConstructSSAForLoadSet(), llvm::DemotePHIToStack(), llvm::CodeExtractor::extractCodeRegion(), FindPHIToPartitionLoops(), FoldCondBranchOnPHI(), gatherIncomingValuesToPhi(), llvm::GetIfCondition(), getInsertPointForUses(), GetShiftedValue(), hasConstantValue(), HoistThenElseCodeToIf(), IsEquivalentPHI(), isSafePHIToSpeculate(), IVUseShouldUsePostIncValue(), PerformHeapAllocSRoA(), PHIsEqualValue(), redirectValuesFromPredecessorsToPhi(), llvm::BasicBlock::removePredecessor(), removeUndefIntroducingPredecessor(), replaceUndefValuesInPhi(), SimplifyPHINode(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), speculatePHINodeLoads(), SplitCriticalSideEffectEdges(), ThreadBinOpOverPHI(), ThreadCmpOverPHI(), tryToMakeAllocaBePromotable(), llvm::SSAUpdaterTraits< SSAUpdater >::ValueIsNewPHI(), llvm::InstCombiner::visitPHINode(), llvm::ObjectSizeOffsetEvaluator::visitPHINode(), and WriteInstruction().
Definition at line 2065 of file Instructions.h.
Referenced by ConstructSSAForLoadSet().
Value * PHINode::hasConstantValue | ( | ) | const |
hasConstantValue - If the specified PHI node always merges together the same value, return the value, otherwise return null.
Definition at line 161 of file Instructions.cpp.
References llvm::UndefValue::get(), getIncomingValue(), getNumIncomingValues(), and llvm::Value::getType().
Referenced by llvm::ComputeMaskedBits(), llvm::BasicBlock::removePredecessor(), llvm::SCEVExpander::replaceCongruentIVs(), and llvm::ObjectSizeOffsetEvaluator::visitPHINode().
removeIncomingValue - Remove an incoming value. This is useful if a predecessor basic block is deleted. The value removed is returned.
If the last incoming value for a PHI node is removed (and DeletePHIIfEmpty is true), the PHI node is destroyed and any uses of it are replaced with dummy values. The only time there should be zero incoming values to a PHI node is when the block is dead, so this strategy is sound.
Definition at line 114 of file Instructions.cpp.
References block_begin(), block_end(), llvm::Instruction::eraseFromParent(), llvm::UndefValue::get(), getIncomingValue(), llvm::User::getNumOperands(), llvm::Value::getType(), llvm::User::NumOperands, llvm::User::Op(), llvm::User::op_begin(), llvm::User::op_end(), and llvm::Value::replaceAllUsesWith().
Referenced by llvm::CloneAndPruneFunctionInto(), llvm::CodeExtractor::extractCodeRegion(), redirectValuesFromPredecessorsToPhi(), llvm::BasicBlock::removePredecessor(), RewriteUsesOfClonedInstructions(), llvm::UnrollLoop(), and UpdatePHINodes().
|
inline |
Definition at line 2123 of file Instructions.h.
|
inline |
Definition at line 2094 of file Instructions.h.
Referenced by llvm::CloneAndPruneFunctionInto(), CloneLoopBlocks(), llvm::CodeExtractor::extractCodeRegion(), llvm::BasicBlock::replaceSuccessorsPhiUsesWith(), llvm::BasicBlock::splitBasicBlock(), llvm::SplitCriticalEdge(), and llvm::InstCombiner::visitPHINode().
Definition at line 2062 of file Instructions.h.
Referenced by llvm::CloneAndPruneFunctionInto(), CloneLoopBlocks(), ConnectProlog(), createPHIsForSplitLoopExit(), ForwardSwitchConditionToPHI(), GetShiftedValue(), HoistThenElseCodeToIf(), replaceUndefValuesInPhi(), SpeculativelyExecuteBB(), and llvm::InstCombiner::visitPHINode().