Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.0.0git
Classes |Public Types |Public Member Functions |Static Public Member Functions |List of all members
llvm::sandboxir::PHINode Class Referencefinal

#include "llvm/SandboxIR/Instruction.h"

Inheritance diagram for llvm::sandboxir::PHINode:
Inheritance graph
[legend]

Public Types

using const_block_iterator =mapped_iterator<llvm::PHINode::const_block_iterator, LLVMBBToBB >
 
- Public Types inherited fromllvm::sandboxir::Instruction
enum class  Opcode {OP,OPCODES,DEF_INSTR }
 
- Public Types inherited fromllvm::sandboxir::User
using op_iterator =OperandUseIterator
 
using const_op_iterator =OperandUseIterator
 
using op_range =iterator_range<op_iterator >
 
using const_op_range =iterator_range<const_op_iterator >
 
- Public Types inherited fromllvm::sandboxir::Value
enum class  ClassID : unsigned {DEF_VALUE,DEF_USER,DEF_CONST,DEF_INSTR }
 
using use_iterator =UserUseIterator
 
using const_use_iterator =UserUseIterator
 
using user_iterator =mapped_iterator<sandboxir::UserUseIterator,UseToUser >
 
using const_user_iterator =user_iterator
 

Public Member Functions

const_block_iterator block_begin ()const
 
const_block_iterator block_end ()const
 
iterator_range<const_block_iteratorblocks ()const
 
op_range incoming_values ()
 
const_op_range incoming_values ()const
 
unsigned getNumIncomingValues ()const
 
ValuegetIncomingValue (unsignedIdx)const
 
void setIncomingValue (unsignedIdx,Value *V)
 
BasicBlockgetIncomingBlock (unsignedIdx)const
 
BasicBlockgetIncomingBlock (constUse &U)const
 
void setIncomingBlock (unsignedIdx,BasicBlock *BB)
 
void addIncoming (Value *V,BasicBlock *BB)
 
ValueremoveIncomingValue (unsignedIdx)
 
ValueremoveIncomingValue (BasicBlock *BB)
 
int getBasicBlockIndex (constBasicBlock *BB)const
 
ValuegetIncomingValueForBlock (constBasicBlock *BB)const
 
ValuehasConstantValue ()const
 
bool hasConstantOrUndefValue ()const
 
bool isComplete ()const
 
void replaceIncomingBlockWith (constBasicBlock *Old,BasicBlock *New)
 
void removeIncomingValueIf (function_ref<bool(unsigned)>Predicate)
 
- Public Member Functions inherited fromllvm::sandboxir::SingleLLVMInstructionImpl< llvm::PHINode >
unsigned getUseOperandNo (constUse &Use)const final
 \Returns the operand index ofUse.
 
unsigned getNumOfIRInstrs ()const final
 This is used byBasicBlock::iterator.
 
void verify ()const final
 Should crash if there is something wrong with the instruction.
 
void dumpOS (raw_ostream &OS)const override
 
- Public Member Functions inherited fromllvm::sandboxir::Instruction
virtualunsigned getNumOfIRInstrs ()const =0
 This is used byBasicBlock::iterator.
 
BBIterator getIterator ()const
 \Returns aBasicBlock::iterator for thisInstruction.
 
InstructiongetNextNode ()const
 \Returns the nextsandboxir::Instruction in the block, or nullptr if at the end of the block.
 
InstructiongetPrevNode ()const
 \Returns the previoussandboxir::Instruction in the block, or nullptr if at the beginning of the block.
 
Opcode getOpcode ()const
 \Returns thisInstruction's opcode.
 
constchargetOpcodeName ()const
 
constDataLayoutgetDataLayout ()const
 
bool isTerminator ()const
 
bool isUnaryOp ()const
 
bool isBinaryOp ()const
 
bool isIntDivRem ()const
 
bool isShift ()const
 
bool isCast ()const
 
bool isFuncletPad ()const
 
bool isSpecialTerminator ()const
 
bool isOnlyUserOfAnyOperand ()const
 
bool isLogicalShift ()const
 
bool hasMetadata ()const
 Return true if the instruction has any metadata attached to it.
 
bool hasMetadataOtherThanDebugLoc ()const
 Return true if this instruction has metadata attached to it other than a debug location.
 
bool hasMetadata (unsigned KindID)const
 Return true if this instruction has the given type of metadata attached.
 
void removeFromParent ()
 Detach this from its parentBasicBlock without deleting it.
 
void eraseFromParent ()
 Detach thisValue from its parent and delete it.
 
void insertBefore (Instruction *BeforeI)
 Insert this detached instruction beforeBeforeI.
 
void insertAfter (Instruction *AfterI)
 Insert this detached instruction afterAfterI.
 
void insertInto (BasicBlock *BB,constBBIterator &WhereIt)
 Insert this detached instruction intoBB atWhereIt.
 
void moveBefore (BasicBlock &BB,constBBIterator &WhereIt)
 Move this instruction toWhereIt.
 
void moveBefore (Instruction *Before)
 Move this instruction beforeBefore.
 
void moveAfter (Instruction *After)
 Move this instruction afterAfter.
 
bool comesBefore (constInstruction *Other)const
 Given an instruction Other in the same basic block as this instruction, return true if this instruction comes before Other.
 
BasicBlockgetParent ()const
 \Returns theBasicBlock containing thisInstruction, or null if it is detached.
 
bool hasNoUnsignedWrap ()const
 Determine whether the no signed wrap flag is set.
 
void setHasNoUnsignedWrap (boolB=true)
 Set or clear the nuw flag on this instruction, which must be an operator which supports this flag.
 
bool hasNoSignedWrap ()const
 Determine whether the no signed wrap flag is set.
 
void setHasNoSignedWrap (boolB=true)
 Set or clear the nsw flag on this instruction, which must be an operator which supports this flag.
 
bool isFast ()const
 Determine whether all fast-math-flags are set.
 
void setFast (boolB)
 Set or clear all fast-math-flags on this instruction, which must be an operator which supports this flag.
 
bool hasAllowReassoc ()const
 Determine whether the allow-reassociation flag is set.
 
void setHasAllowReassoc (boolB)
 Set or clear the reassociation flag on this instruction, which must be an operator which supports this flag.
 
bool isExact ()const
 Determine whether the exact flag is set.
 
void setIsExact (boolB=true)
 Set or clear the exact flag on this instruction, which must be an operator which supports this flag.
 
bool hasNoNaNs ()const
 Determine whether the no-NaNs flag is set.
 
void setHasNoNaNs (boolB)
 Set or clear the no-nans flag on this instruction, which must be an operator which supports this flag.
 
bool hasNoInfs ()const
 Determine whether the no-infs flag is set.
 
void setHasNoInfs (boolB)
 Set or clear the no-infs flag on this instruction, which must be an operator which supports this flag.
 
bool hasNoSignedZeros ()const
 Determine whether the no-signed-zeros flag is set.
 
void setHasNoSignedZeros (boolB)
 Set or clear the no-signed-zeros flag on this instruction, which must be an operator which supports this flag.
 
bool hasAllowReciprocal ()const
 Determine whether the allow-reciprocal flag is set.
 
void setHasAllowReciprocal (boolB)
 Set or clear the allow-reciprocal flag on this instruction, which must be an operator which supports this flag.
 
bool hasAllowContract ()const
 Determine whether the allow-contract flag is set.
 
void setHasAllowContract (boolB)
 Set or clear the allow-contract flag on this instruction, which must be an operator which supports this flag.
 
bool hasApproxFunc ()const
 Determine whether the approximate-math-functions flag is set.
 
void setHasApproxFunc (boolB)
 Set or clear the approximate-math-functions flag on this instruction, which must be an operator which supports this flag.
 
FastMathFlags getFastMathFlags ()const
 Convenience function for getting all the fast-math flags, which must be an operator which supports these flags.
 
void setFastMathFlags (FastMathFlags FMF)
 Convenience function for setting multiple fast-math flags on this instruction, which must be an operator which supports these flags.
 
void copyFastMathFlags (FastMathFlags FMF)
 Convenience function for transferring all fast-math flag values to this instruction, which must be an operator which supports these flags.
 
bool isAssociative ()const
 
bool isCommutative ()const
 
bool isIdempotent ()const
 
bool isNilpotent ()const
 
bool mayWriteToMemory ()const
 
bool mayReadFromMemory ()const
 
bool mayReadOrWriteMemory ()const
 
bool isAtomic ()const
 
bool hasAtomicLoad ()const
 
bool hasAtomicStore ()const
 
bool isVolatile ()const
 
TypegetAccessType ()const
 
bool mayThrow (bool IncludePhaseOneUnwind=false)const
 
bool isFenceLike ()const
 
bool mayHaveSideEffects ()const
 
void dumpOS (raw_ostream &OS)const override
 
- Public Member Functions inherited fromllvm::sandboxir::User
virtualop_iterator op_begin ()
 
virtualop_iterator op_end ()
 
virtualconst_op_iterator op_begin ()const
 
virtualconst_op_iterator op_end ()const
 
op_range operands ()
 
const_op_range operands ()const
 
ValuegetOperand (unsigned OpIdx)const
 
Use getOperandUse (unsigned OpIdx)const
 \Returns the operand edge forOpIdx.
 
virtualunsigned getNumOperands ()const
 
virtual void setOperand (unsigned OperandIdx,Value *Operand)
 
bool replaceUsesOfWith (Value *FromV,Value *ToV)
 Replaces any operands that matchFromV withToV.
 
void verify ()const override
 Should crash if there is something wrong with the instruction.
 
void dumpCommonHeader (raw_ostream &OS)const final
 
void dumpOS (raw_ostream &OS)const override
 
- Public Member Functions inherited fromllvm::sandboxir::Value
virtual ~Value ()=default
 
ClassID getSubclassID ()const
 
use_iterator use_begin ()
 
const_use_iterator use_begin ()const
 
use_iterator use_end ()
 
const_use_iterator use_end ()const
 
iterator_range<use_iteratoruses ()
 
iterator_range<const_use_iteratoruses ()const
 
user_iterator user_begin ()
 
user_iterator user_end ()
 
const_user_iterator user_begin ()const
 
const_user_iterator user_end ()const
 
iterator_range<user_iteratorusers ()
 
iterator_range<const_user_iteratorusers ()const
 
unsigned getNumUses ()const
 \Returns the number of user edges (not necessarily to unique users).
 
bool hasNUsesOrMore (unsigned Num)const
 Return true if this value has N uses or more.
 
bool hasNUses (unsigned Num)const
 Return true if thisValue has exactly N uses.
 
TypegetType ()const
 
ContextgetContext ()const
 
void replaceUsesWithIf (Value *OtherV,llvm::function_ref<bool(constUse &)> ShouldReplace)
 
void replaceAllUsesWith (Value *Other)
 
StringRef getName ()const
 \Returns the LLVM IR name of the bottom-most LLVM value.
 
virtual void verify ()const =0
 Should crash if there is something wrong with the instruction.
 
std::string getUid ()const
 Returns the unique id in the form 'SB<number>.' like 'SB1.'.
 
virtual void dumpCommonHeader (raw_ostream &OS)const
 
void dumpCommonFooter (raw_ostream &OS)const
 
void dumpCommonPrefix (raw_ostream &OS)const
 
void dumpCommonSuffix (raw_ostream &OS)const
 
void printAsOperandCommon (raw_ostream &OS)const
 
virtual void dumpOS (raw_ostream &OS)const =0
 
LLVM_DUMP_METHOD void dump ()const
 

Static Public Member Functions

staticPHINodecreate (Type *Ty,unsigned NumReservedValues,InsertPosition Pos,Context &Ctx,constTwine &Name="")
 
staticbool classof (constValue *From)
 For isa/dyn_cast.
 
staticunsigned getOperandNumForIncomingValue (unsignedIdx)
 
staticunsigned getIncomingValueNumForOperand (unsignedIdx)
 
- Static Public Member Functions inherited fromllvm::sandboxir::Instruction
staticconstchargetOpcodeName (OpcodeOpc)
 
staticbool classof (constsandboxir::Value *From)
 For isa/dyn_cast.
 
- Static Public Member Functions inherited fromllvm::sandboxir::User
staticbool classof (constValue *From)
 For isa/dyn_cast.
 

Additional Inherited Members

- Protected Member Functions inherited fromllvm::sandboxir::Instruction
 Instruction (ClassIDID,OpcodeOpc,llvm::Instruction *I,sandboxir::Context &SBCtx)
 
llvm::InstructiongetTopmostLLVMInstruction ()const
 A SandboxIRInstruction may map to multiple LLVM IRInstruction.
 
virtualSmallVector<llvm::Instruction *, 1 > getLLVMInstrs ()const =0
 \Returns the LLVM IR Instructions that this SandboxIR maps to in program order.
 
- Protected Member Functions inherited fromllvm::sandboxir::User
 User (ClassIDID,llvm::Value *V,Context &Ctx)
 
Use getOperandUseDefault (unsigned OpIdx,boolVerify)const
 \Returns theUse edge that corresponds toOpIdx.
 
virtualUse getOperandUseInternal (unsigned OpIdx,boolVerify)const =0
 \Returns theUse for theOpIdx'th operand.
 
unsigned getUseOperandNoDefault (constUse &Use)const
 The default implementation works only for single-LLVMIR-instruction Users and only if they match exactly the LLVM instruction.
 
virtualunsigned getUseOperandNo (constUse &Use)const =0
 \Returns the operand index ofUse.
 
void swapOperandsInternal (unsigned OpIdxA,unsigned OpIdxB)
 
void verifyUserOfLLVMUse (constllvm::Use &Use)const
 
- Protected Member Functions inherited fromllvm::sandboxir::Value
void clearValue ()
 
 Value (ClassIDSubclassID,llvm::Value *Val,Context &Ctx)
 
 Value (constValue &)=delete
 Disable copies.
 
Valueoperator= (constValue &)=delete
 
- Static Protected Member Functions inherited fromllvm::sandboxir::Instruction
staticIRBuildersetInsertPos (InsertPosition Pos)
 Helper function for create().
 
- Static Protected Member Functions inherited fromllvm::sandboxir::Value
staticconstchargetSubclassIDStr (ClassIDID)
 
- Protected Attributes inherited fromllvm::sandboxir::Instruction
Opcode Opc
 
- Protected Attributes inherited fromllvm::sandboxir::Value
ClassID SubclassID
 For isa/dyn_cast.
 
unsigned UID
 A unique ID used for forming the name (used for debugging).
 
llvm::ValueVal = nullptr
 The LLVMValue that corresponds to this SandboxIRValue.
 
ContextCtx
 All values point to the context.
 

Detailed Description

Definition at line2377 of fileInstruction.h.

Member Typedef Documentation

◆ const_block_iterator

usingllvm::sandboxir::PHINode::const_block_iterator =mapped_iterator<llvm::PHINode::const_block_iterator, LLVMBBToBB>

Definition at line2396 of fileInstruction.h.

Member Function Documentation

◆ addIncoming()

void llvm::sandboxir::PHINode::addIncoming(ValueV,
BasicBlockBB 
)

Definition at line868 of fileInstruction.cpp.

Referencesllvm::sandboxir::Value::Ctx,llvm::sandboxir::Tracker::emplaceIfTracking(),llvm::sandboxir::Context::getTracker(), andllvm::sandboxir::Value::Val.

Referenced byllvm::sandboxir::PHIRemoveIncoming::revert().

◆ block_begin()

const_block_iterator llvm::sandboxir::PHINode::block_begin() const
inline

Definition at line2399 of fileInstruction.h.

Referencesblock_begin(),llvm::sandboxir::Value::Ctx, andllvm::sandboxir::Value::Val.

Referenced byblock_begin(), andblocks().

◆ block_end()

const_block_iterator llvm::sandboxir::PHINode::block_end() const
inline

Definition at line2404 of fileInstruction.h.

Referencesblock_end(),llvm::sandboxir::Value::Ctx, andllvm::sandboxir::Value::Val.

Referenced byblock_end(), andblocks().

◆ blocks()

iterator_range<const_block_iterator > llvm::sandboxir::PHINode::blocks() const
inline

Definition at line2409 of fileInstruction.h.

Referencesblock_begin(),block_end(), andllvm::make_range().

◆ classof()

bool llvm::sandboxir::PHINode::classof(constValueFrom)
static

For isa/dyn_cast.

Definition at line834 of fileInstruction.cpp.

ReferencesFrom.

◆ create()

PHINode * llvm::sandboxir::PHINode::create(TypeTy,
unsigned NumReservedValues,
InsertPosition Pos,
ContextCtx,
constTwineName ="" 
)
static

Definition at line826 of fileInstruction.cpp.

Referencesllvm::IRBuilderBase::CreatePHI(),llvm::sandboxir::Context::createPHINode(),llvm::sandboxir::Value::Ctx,llvm::sandboxir::Type::LLVMTy,Name, andllvm::sandboxir::Instruction::setInsertPos().

◆ getBasicBlockIndex()

int llvm::sandboxir::PHINode::getBasicBlockIndex(constBasicBlockBB) const

Definition at line893 of fileInstruction.cpp.

Referencesllvm::sandboxir::Value::Val.

Referenced byremoveIncomingValue().

◆ getIncomingBlock()[1/2]

BasicBlock * llvm::sandboxir::PHINode::getIncomingBlock(constUseU) const

Definition at line852 of fileInstruction.cpp.

Referencesllvm::sandboxir::Value::Ctx,llvm::sandboxir::Context::getValue(), andllvm::sandboxir::Value::Val.

◆ getIncomingBlock()[2/2]

BasicBlock * llvm::sandboxir::PHINode::getIncomingBlock(unsigned Idx) const

Definition at line848 of fileInstruction.cpp.

Referencesllvm::sandboxir::Value::Ctx,llvm::sandboxir::Context::getValue(),Idx, andllvm::sandboxir::Value::Val.

Referenced byreplaceIncomingBlockWith(),llvm::sandboxir::PHIRemoveIncoming::revert(), andsetIncomingBlock().

◆ getIncomingValue()

Value * llvm::sandboxir::PHINode::getIncomingValue(unsigned Idx) const

Definition at line838 of fileInstruction.cpp.

Referencesllvm::sandboxir::Value::Ctx,getIncomingValue(),llvm::sandboxir::Context::getValue(),Idx, andllvm::sandboxir::Value::Val.

Referenced bygetIncomingValue(),llvm::sandboxir::PHIRemoveIncoming::revert(), andsetIncomingValue().

◆ getIncomingValueForBlock()

Value * llvm::sandboxir::PHINode::getIncomingValueForBlock(constBasicBlockBB) const

Definition at line897 of fileInstruction.cpp.

Referencesllvm::sandboxir::Value::Ctx,llvm::sandboxir::Context::getValue(), andllvm::sandboxir::Value::Val.

◆ getIncomingValueNumForOperand()

staticunsigned llvm::sandboxir::PHINode::getIncomingValueNumForOperand(unsigned Idx)
inlinestatic

Definition at line2425 of fileInstruction.h.

Referencesllvm::PHINode::getIncomingValueNumForOperand(), andIdx.

◆ getNumIncomingValues()

unsigned llvm::sandboxir::PHINode::getNumIncomingValues() const
inline

Definition at line2417 of fileInstruction.h.

Referencesllvm::sandboxir::Value::Val.

Referenced byllvm::sandboxir::PHIRemoveIncoming::revert().

◆ getOperandNumForIncomingValue()

staticunsigned llvm::sandboxir::PHINode::getOperandNumForIncomingValue(unsigned Idx)
inlinestatic

Definition at line2422 of fileInstruction.h.

Referencesllvm::PHINode::getOperandNumForIncomingValue(), andIdx.

◆ hasConstantOrUndefValue()

bool llvm::sandboxir::PHINode::hasConstantOrUndefValue() const
inline

Definition at line2443 of fileInstruction.h.

Referencesllvm::sandboxir::Value::Val.

◆ hasConstantValue()

Value * llvm::sandboxir::PHINode::hasConstantValue() const

Definition at line903 of fileInstruction.cpp.

Referencesllvm::sandboxir::Value::Ctx,llvm::sandboxir::Context::getValue(), andllvm::sandboxir::Value::Val.

◆ incoming_values()[1/2]

op_range llvm::sandboxir::PHINode::incoming_values()
inline

Definition at line2413 of fileInstruction.h.

Referencesllvm::sandboxir::User::operands().

◆ incoming_values()[2/2]

const_op_range llvm::sandboxir::PHINode::incoming_values() const
inline

Definition at line2415 of fileInstruction.h.

Referencesllvm::sandboxir::User::operands().

◆ isComplete()

bool llvm::sandboxir::PHINode::isComplete() const
inline

Definition at line2446 of fileInstruction.h.

Referencesllvm::sandboxir::Value::Val.

◆ removeIncomingValue()[1/2]

Value * llvm::sandboxir::PHINode::removeIncomingValue(BasicBlockBB)

Definition at line883 of fileInstruction.cpp.

Referencesllvm::sandboxir::Value::Ctx,llvm::sandboxir::Tracker::emplaceIfTracking(),getBasicBlockIndex(),llvm::sandboxir::Context::getTracker(),llvm::sandboxir::Context::getValue(), andllvm::sandboxir::Value::Val.

◆ removeIncomingValue()[2/2]

Value * llvm::sandboxir::PHINode::removeIncomingValue(unsigned Idx)

Definition at line875 of fileInstruction.cpp.

Referencesllvm::sandboxir::Value::Ctx,llvm::sandboxir::Tracker::emplaceIfTracking(),llvm::sandboxir::Context::getTracker(),llvm::sandboxir::Context::getValue(),Idx, andllvm::sandboxir::Value::Val.

Referenced byllvm::sandboxir::PHIAddIncoming::revert().

◆ removeIncomingValueIf()

void llvm::sandboxir::PHINode::removeIncomingValueIf(function_ref<bool(unsigned)> Predicate)

Definition at line914 of fileInstruction.cpp.

◆ replaceIncomingBlockWith()

void llvm::sandboxir::PHINode::replaceIncomingBlockWith(constBasicBlockOld,
BasicBlockNew 
)

Definition at line907 of fileInstruction.cpp.

Referencesassert(),getIncomingBlock(),llvm::sandboxir::User::getNumOperands(),Idx,setIncomingBlock(), andllvm::sandboxir::Value::Val.

◆ setIncomingBlock()

void llvm::sandboxir::PHINode::setIncomingBlock(unsigned Idx,
BasicBlockBB 
)

Definition at line857 of fileInstruction.cpp.

Referencesllvm::sandboxir::Value::Ctx,llvm::sandboxir::Tracker::emplaceIfTracking(),getIncomingBlock(),llvm::sandboxir::Context::getTracker(),Idx, andllvm::sandboxir::Value::Val.

Referenced byreplaceIncomingBlockWith(), andllvm::sandboxir::PHIRemoveIncoming::revert().

◆ setIncomingValue()

void llvm::sandboxir::PHINode::setIncomingValue(unsigned Idx,
ValueV 
)

Definition at line841 of fileInstruction.cpp.

Referencesllvm::sandboxir::Value::Ctx,llvm::sandboxir::Tracker::emplaceIfTracking(),getIncomingValue(),llvm::sandboxir::Context::getTracker(),Idx,setIncomingValue(), andllvm::sandboxir::Value::Val.

Referenced byllvm::sandboxir::PHIRemoveIncoming::revert(), andsetIncomingValue().


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

Generated on Sun Jul 20 2025 22:36:19 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp