LLVM API Documentation
#include <Instructions.h>
Definition at line 2090 of file Instructions.h.
typedef BasicBlock** llvm::PHINode::block_iterator |
Definition at line 2143 of file Instructions.h.
Definition at line 2144 of file Instructions.h.
Definition at line 96 of file Instructions.cpp.
References llvm::User::dropHungoffUses().
void llvm::PHINode::addIncoming | ( | Value * | V, |
BasicBlock * | BB | ||
) | [inline] |
addIncoming - Add an incoming value to the end of the PHI list
Definition at line 2212 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(), insertUniqueBackedgeBlock(), LLVMAddIncoming(), mergeEmptyReturnBlocks(), PerformHeapAllocSRoA(), processInstruction(), redirectValuesFromPredecessorsToPhi(), SimplifyBranchOnICmpChain(), SimplifyCondBranchToCondBranch(), SinkThenElseCodeToEnd(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), speculatePHINodeLoads(), llvm::SplitLandingPadPredecessors(), tryToMakeAllocaBePromotable(), TryToSimplifyUncondBranchWithICmpInIt(), llvm::UnrollLoop(), UpdatePHINodes(), llvm::InstCombiner::visitGetElementPtrInst(), and llvm::ObjectSizeOffsetEvaluator::visitPHINode().
Use * PHINode::allocHungoffUses | ( | unsigned | N | ) | const [protected] |
Reimplemented from llvm::User.
Definition at line 100 of file Instructions.cpp.
References llvm::Use::initTags().
block_iterator llvm::PHINode::block_begin | ( | ) | [inline] |
Definition at line 2146 of file Instructions.h.
Referenced by llvm::EliminateDuplicatePHINodes(), llvm::Instruction::isIdenticalToWhenDefined(), and removeIncomingValue().
const_block_iterator llvm::PHINode::block_begin | ( | ) | const [inline] |
Definition at line 2152 of file Instructions.h.
block_iterator llvm::PHINode::block_end | ( | ) | [inline] |
Definition at line 2158 of file Instructions.h.
Referenced by llvm::EliminateDuplicatePHINodes(), and removeIncomingValue().
const_block_iterator llvm::PHINode::block_end | ( | ) | const [inline] |
Definition at line 2162 of file Instructions.h.
static bool llvm::PHINode::classof | ( | const Instruction * | I | ) | [inline, static] |
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition at line 2262 of file Instructions.h.
References llvm::Instruction::getOpcode(), and llvm::TargetOpcode::PHI.
static bool llvm::PHINode::classof | ( | const Value * | V | ) | [inline, static] |
Methods for support type inquiry through isa, cast, and dyn_cast:
Reimplemented from llvm::Instruction.
Definition at line 2265 of file Instructions.h.
PHINode * PHINode::clone_impl | ( | ) | const [override, protected, virtual] |
Implements llvm::Instruction.
Definition at line 3753 of file Instructions.cpp.
static PHINode* llvm::PHINode::Create | ( | Type * | Ty, |
unsigned | NumReservedValues, | ||
const Twine & | NameStr = "" , |
||
Instruction * | InsertBefore = nullptr |
||
) | [inline, static] |
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 2126 of file Instructions.h.
Referenced by ConnectProlog(), llvm::SSAUpdaterTraits< SSAUpdater >::CreateEmptyPHI(), llvm::IRBuilder< true, TargetFolder >::CreatePHI(), createPHIsForSplitLoopExit(), GetHeapSROAValue(), llvm::SSAUpdater::GetValueInMiddleOfBlock(), llvm::InlineFunction(), insertUniqueBackedgeBlock(), mergeEmptyReturnBlocks(), processInstruction(), llvm::UnifyFunctionExitNodes::runOnFunction(), SimplifyCondBranchToCondBranch(), SinkThenElseCodeToEnd(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), llvm::SplitLandingPadPredecessors(), tryToMakeAllocaBePromotable(), and UpdatePHINodes().
static PHINode* llvm::PHINode::Create | ( | Type * | Ty, |
unsigned | NumReservedValues, | ||
const Twine & | NameStr, | ||
BasicBlock * | InsertAtEnd | ||
) | [inline, static] |
Definition at line 2131 of file Instructions.h.
Provide fast operand accessors.
int llvm::PHINode::getBasicBlockIndex | ( | const BasicBlock * | BB | ) | const [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 2244 of file Instructions.h.
Referenced by AlmostDeadIV(), CloneLoopBlocks(), ConnectProlog(), createPHIsForSplitLoopExit(), FindLoopCounter(), needsLFTR(), llvm::BasicBlock::replaceSuccessorsPhiUsesWith(), RewriteUsesOfClonedInstructions(), SimplifyCondBranchToCondBranch(), SpeculativelyExecuteBB(), llvm::BasicBlock::splitBasicBlock(), llvm::SplitCriticalEdge(), and llvm::InstCombiner::visitPHINode().
BasicBlock* llvm::PHINode::getIncomingBlock | ( | unsigned | i | ) | const [inline] |
getIncomingBlock - Return incoming basic block number i
.
Definition at line 2187 of file Instructions.h.
Referenced by CanPropagatePredecessorsForPHIs(), llvm::CloneAndPruneFunctionInto(), llvm::DemotePHIToStack(), llvm::InstCombiner::DoOneIteration(), llvm::CodeExtractor::extractCodeRegion(), FindPhiPredForUseInBlock(), findPHIToPartitionLoops(), fixPhis(), FoldCondBranchOnPHI(), FoldTwoEntryPHINode(), gatherIncomingValuesToPhi(), llvm::GetIfCondition(), getInsertPointForUses(), HoistThenElseCodeToIf(), insertUniqueBackedgeBlock(), IsEquivalentPHI(), isSafePHIToSpeculate(), IVUseShouldUsePostIncValue(), PerformHeapAllocSRoA(), redirectValuesFromPredecessorsToPhi(), llvm::BasicBlock::removePredecessor(), removeUndefIntroducingPredecessor(), replaceUndefValuesInPhi(), SinkCast(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), speculatePHINodeLoads(), llvm::SplitCriticalEdge(), SplitCriticalSideEffectEdges(), tryToMakeAllocaBePromotable(), UpdatePHINodes(), llvm::InstCombiner::visitGetElementPtrInst(), llvm::InstCombiner::visitPHINode(), llvm::ObjectSizeOffsetEvaluator::visitPHINode(), and WriteInstruction().
BasicBlock* llvm::PHINode::getIncomingBlock | ( | const Use & | U | ) | const [inline] |
getIncomingBlock - Return incoming basic block corresponding to an operand of the PHI.
Definition at line 2194 of file Instructions.h.
References llvm::Use::getUser().
BasicBlock* llvm::PHINode::getIncomingBlock | ( | Value::const_user_iterator | I | ) | const [inline] |
getIncomingBlock - Return incoming basic block corresponding to value use iterator.
Definition at line 2202 of file Instructions.h.
Value* llvm::PHINode::getIncomingValue | ( | unsigned | i | ) | const [inline] |
getIncomingValue - Return incoming value number x
Definition at line 2172 of file Instructions.h.
Referenced by AlmostDeadIV(), CanEvaluateSExtd(), CanEvaluateShifted(), CanEvaluateTruncated(), CanEvaluateZExtd(), canIfConvertPHINodes(), CanPropagatePredecessorsForPHIs(), llvm::CloneAndPruneFunctionInto(), CloneLoopBlocks(), computeKnownBits(), ComputeNumSignBits(), llvm::FunctionLoweringInfo::ComputePHILiveOutRegInfo(), createPHIsForSplitLoopExit(), llvm::DemotePHIToStack(), FindLoopCounter(), findPHIToPartitionLoops(), FoldCondBranchOnPHI(), FoldTwoEntryPHINode(), gatherIncomingValuesToPhi(), getInsertPointForUses(), GetShiftedValue(), hasConstantValue(), insertUniqueBackedgeBlock(), IsEquivalentPHI(), isSafePHIToSpeculate(), isTriviallyReplacablePHI(), IVUseShouldUsePostIncValue(), needsLFTR(), PerformHeapAllocSRoA(), PHIsEqualValue(), redirectValuesFromPredecessorsToPhi(), removeIncomingValue(), removeUndefIntroducingPredecessor(), replaceUndefValuesInPhi(), SimplifyCondBranchToCondBranch(), SimplifyPHINode(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), speculatePHINodeLoads(), SpeculativelyExecuteBB(), SplitCriticalSideEffectEdges(), ThreadBinOpOverPHI(), ThreadCmpOverPHI(), tryToMakeAllocaBePromotable(), UpdatePHINodes(), llvm::InstCombiner::visitPHINode(), llvm::ObjectSizeOffsetEvaluator::visitPHINode(), and WriteInstruction().
Value* llvm::PHINode::getIncomingValueForBlock | ( | const BasicBlock * | BB | ) | const [inline] |
Definition at line 2251 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().
static unsigned llvm::PHINode::getIncomingValueNumForOperand | ( | unsigned | i | ) | [inline, static] |
Definition at line 2181 of file Instructions.h.
Referenced by llvm::IVUsers::AddUsersImpl().
unsigned llvm::PHINode::getNumIncomingValues | ( | ) | const [inline] |
getNumIncomingValues - Return the number of incoming edges
Definition at line 2168 of file Instructions.h.
Referenced by CanEvaluateSExtd(), CanEvaluateShifted(), CanEvaluateTruncated(), CanEvaluateZExtd(), canIfConvertPHINodes(), CanPropagatePredecessorsForPHIs(), llvm::CloneAndPruneFunctionInto(), computeKnownBits(), ComputeNumSignBits(), llvm::FunctionLoweringInfo::ComputePHILiveOutRegInfo(), ConstructSSAForLoadSet(), llvm::DemotePHIToStack(), llvm::CodeExtractor::extractCodeRegion(), findPHIToPartitionLoops(), fixPhis(), FoldCondBranchOnPHI(), gatherIncomingValuesToPhi(), llvm::GetIfCondition(), getInsertPointForUses(), GetShiftedValue(), hasConstantValue(), HoistThenElseCodeToIf(), insertUniqueBackedgeBlock(), IsEquivalentPHI(), isSafePHIToSpeculate(), isTriviallyReplacablePHI(), IVUseShouldUsePostIncValue(), PerformHeapAllocSRoA(), PHIsEqualValue(), processInstruction(), redirectValuesFromPredecessorsToPhi(), llvm::BasicBlock::removePredecessor(), removeUndefIntroducingPredecessor(), replaceUndefValuesInPhi(), SimplifyPHINode(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), speculatePHINodeLoads(), SplitCriticalSideEffectEdges(), ThreadBinOpOverPHI(), ThreadCmpOverPHI(), tryToMakeAllocaBePromotable(), UpdatePHINodes(), llvm::SSAUpdaterTraits< SSAUpdater >::ValueIsNewPHI(), llvm::InstCombiner::visitPHINode(), llvm::ObjectSizeOffsetEvaluator::visitPHINode(), and WriteInstruction().
static unsigned llvm::PHINode::getOperandNumForIncomingValue | ( | unsigned | i | ) | [inline, static] |
Definition at line 2178 of file Instructions.h.
Referenced by ConstructSSAForLoadSet(), and processInstruction().
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 computeKnownBits(), llvm::BasicBlock::removePredecessor(), and llvm::ObjectSizeOffsetEvaluator::visitPHINode().
Value * PHINode::removeIncomingValue | ( | unsigned | Idx, |
bool | DeletePHIIfEmpty = true |
||
) |
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(), insertUniqueBackedgeBlock(), redirectValuesFromPredecessorsToPhi(), llvm::BasicBlock::removePredecessor(), RewriteUsesOfClonedInstructions(), llvm::UnrollLoop(), and UpdatePHINodes().
Value* llvm::PHINode::removeIncomingValue | ( | const BasicBlock * | BB, |
bool | DeletePHIIfEmpty = true |
||
) | [inline] |
Definition at line 2235 of file Instructions.h.
void llvm::PHINode::setIncomingBlock | ( | unsigned | i, |
BasicBlock * | BB | ||
) | [inline] |
Definition at line 2206 of file Instructions.h.
Referenced by llvm::CloneAndPruneFunctionInto(), CloneLoopBlocks(), llvm::CodeExtractor::extractCodeRegion(), fixPhis(), insertUniqueBackedgeBlock(), llvm::BasicBlock::replaceSuccessorsPhiUsesWith(), llvm::BasicBlock::splitBasicBlock(), llvm::SplitCriticalEdge(), and llvm::InstCombiner::visitPHINode().
void llvm::PHINode::setIncomingValue | ( | unsigned | i, |
Value * | V | ||
) | [inline] |
Definition at line 2175 of file Instructions.h.
Referenced by llvm::CloneAndPruneFunctionInto(), CloneLoopBlocks(), ConnectProlog(), createPHIsForSplitLoopExit(), ForwardSwitchConditionToPHI(), GetShiftedValue(), HoistThenElseCodeToIf(), insertUniqueBackedgeBlock(), replaceUndefValuesInPhi(), SpeculativelyExecuteBB(), and llvm::InstCombiner::visitPHINode().