MachineOperand class ‐ Representation of each machine instruction operand.

Synopsis

Declared in <llvm/CodeGen/MachineOperand.h>

class MachineOperand;

Description

This class isn't a POD type because it has a private constructor, but its destructor must be trivial. Functions like MachineInstr::addOperand(), MachineRegisterInfo::moveOperands(), and MF::DeleteMachineInstr() depend on not having to call the MachineOperand destructor.

Enums

Name

Description

MachineOperandType

Discriminator for the kind of value stored in a MachineOperand.

Member Functions

Name

Description

ChangeToBA

Replace this operand with a new block address operand.

ChangeToCPI

Replace this operand with a new constant pool index operand.

ChangeToDbgInstrRef

Replace this operand with an instruction reference.

ChangeToES

Replace this operand with a new external symbol operand.

ChangeToFPImmediate

Replace this operand with an FP immediate of value FPImm.

ChangeToFrameIndex

Replace this operand with a frame index.

ChangeToGA

Replace this operand with a new global address operand.

ChangeToImmediate

Replace this operand with an immediate of value ImmVal.

ChangeToMCSymbol

Replace this operand with a new MC symbol operand.

ChangeToRegister

Replace this operand with a register operand of value Reg.

ChangeToTargetIndex

Replace this operand with a target index.

addTargetFlag

Or the given flags into this operand's target‐specific flags.

clearParent

clearParent ‐ Reset the parent pointer.

clobbersPhysReg

Return true if this RegMask operand clobbers PhysReg.

dump

Dump this MachineOperand to dbgs() for debugging.

getBlockAddress

Return the BlockAddress referenced by this operand.

getCFIIndex

Return the CFI instruction index of this MO_CFIIndex operand.

getCImm

Return the ConstantInt for this MO_CImmediate operand.

getFPImm

Return the ConstantFP for this MO_FPImmediate operand.

getGlobal

Return the GlobalValue referenced by this operand.

getImm

Return the immediate integer value of this MO_Immediate operand.

getIndex

Return the frame index, constant‐pool index, target index, or jump‐table index stored in this operand.

getInstrRefInstrIndex

Return the instruction index of this MO_DbgInstrRef operand.

getInstrRefOpIndex

Return the operand index of this MO_DbgInstrRef operand.

getIntrinsicID

Return the Intrinsic::ID of this MO_IntrinsicID operand.

getLaneMask

Return the lane mask of this MO_LaneMask operand.

getMBB

Return the MachineBasicBlock referenced by this operand.

getMCSymbol

Return the MCSymbol referenced by this operand.

getMetadata

Return the MDNode of this MO_Metadata operand.

getOffset

Return the offset from the symbol in this operand. This always returns 0 for ExternalSymbol operands.

getOperandNo

Returns the index of this operand in the instruction that it belongs to.

getParent

getParent overloads

getPredicate

Return the generic ISel predicate value of this operand.

getReg

getReg ‐ Returns the register number.

getRegLiveOut

getRegLiveOut ‐ Returns a bit mask of live‐out registers.

getRegMask

getRegMask ‐ Returns a bit mask of registers preserved by this RegMask operand.

getShuffleMask

Return the shuffle mask of this MO_ShuffleMask operand.

getSubReg

Return the subregister index for this register operand, or 0 if none.

getSymbolName

Return the external symbol name of this MO_ExternalSymbol operand.

getTargetFlags

Return target‐specific flags carried by non‐register operands; always zero for register operands.

getTargetIndexName

Return the name of this TargetIndex operand, or nullptr if unnamed.

getType

getType ‐ Returns the MachineOperandType for this operand.

isBlockAddress

isBlockAddress ‐ Tests if this is a MO_BlockAddress operand.

isCFIIndex

Return true if this is a MO_CFIIndex operand.

isCImm

isCImm ‐ Test if this is a MO_CImmediate operand.

isCPI

isCPI ‐ Tests if this is a MO_ConstantPoolIndex operand.

isDbgInstrRef

Tests if this is a MO_DbgInstrRef operand.

isDead

Return true if this register definition is dead on exit from the instruction.

isDebug

Return true if this is a debug‐only register use.

isDef

Return true if this register operand is a definition.

isEarlyClobber

Return true if this register definition is an early clobber.

isFI

isFI ‐ Tests if this is a MO_FrameIndex operand.

isFPImm

isFPImm ‐ Tests if this is a MO_FPImmediate operand.

isGlobal

isGlobal ‐ Tests if this is a MO_GlobalAddress operand.

isIdenticalTo

Return true if this operand matches Other ignoring liveness flags.

isImm

isImm ‐ Tests if this is a MO_Immediate operand.

isImplicit

Return true if this register operand is an implicit use or definition.

isInternalRead

Return true if this register operand reads a value defined inside the same instruction or bundle.

isIntrinsicID

Return true if this is a MO_IntrinsicID operand.

isJTI

isJTI ‐ Tests if this is a MO_JumpTableIndex operand.

isKill

Return true if this use is a kill (last use on this path).

isLaneMask

Return true if this is a MO_LaneMask operand.

isMBB

isMBB ‐ Tests if this is a MO_MachineBasicBlock operand.

isMCSymbol

Return true if this is a MO_MCSymbol operand.

isMetadata

isMetadata ‐ Tests if this is a MO_Metadata operand.

isPredicate

Return true if this is a MO_Predicate operand.

isReg

isReg ‐ Tests if this is a MO_Register operand.

isRegLiveOut

isRegLiveOut ‐ Tests if this is a MO_RegisterLiveOut operand.

isRegMask

isRegMask ‐ Tests if this is a MO_RegisterMask operand.

isRenamable

Return true if this physical register operand may be renamed.

isShuffleMask

Return true if this is a MO_ShuffleMask operand.

isSymbol

isSymbol ‐ Tests if this is a MO_ExternalSymbol operand.

isTargetIndex

isTargetIndex ‐ Tests if this is a MO_TargetIndex operand.

isTied

Return true if this register operand is tied to another operand.

isUndef

Return true if this register operand reads an undef (don't‐care) value.

isUse

Return true if this register operand is a use rather than a definition.

isValidExcessOperand

Return true if this operand can validly be appended to an arbitrary operand list. i.e. this behaves like an implicit operand.

print

print overloads

readsReg

Return true if this operand reads the previous value of its register.

setCImm

Set the ConstantInt of this MO_CImmediate operand.

setFPImm

Set the ConstantFP of this MO_FPImmediate operand.

setImm

Set the immediate integer value of this MO_Immediate operand.

setImplicit

Mark whether this register operand is implicit.

setIndex

Set the frame, constant‐pool, target, or jump‐table index.

setInstrRefInstrIndex

Set the instruction index of this MO_DbgInstrRef operand.

setInstrRefOpIndex

Set the operand index of this MO_DbgInstrRef operand.

setIntrinsicID

Set the Intrinsic::ID of this MO_IntrinsicID operand.

setIsDead

Mark whether this definition is dead.

setIsDebug

Mark whether this is a debug‐only register use.

setIsDef

Change a def to a use, or a use to a def.

setIsEarlyClobber

Mark whether this definition is an early clobber.

setIsInternalRead

Mark whether this operand reads a value defined in the same instruction.

setIsKill

Mark whether this use is a kill.

setIsRenamable

Mark whether this physical register operand may be renamed.

setIsUndef

Set whether this register operand reads an undef (don't‐care) value.

setIsUse

Mark this register operand as a use (or definition if Val is false).

setMBB

Set the MachineBasicBlock referenced by this operand.

setMetadata

Set the metadata node for a MO_Metadata operand.

setOffset

Set the symbol or address offset for this operand.

setPredicate

Set the generic ISel predicate of this MO_Predicate operand.

setReg

Change the register this operand corresponds to.

setRegMask

Set the register mask for this MO_RegisterMask operand.

setSubReg

Set the subregister index for this register operand.

setTargetFlags

Set the target‐specific flags for this non‐register operand.

substPhysReg

Substitute the current register with physical register Reg.

substVirtReg

Substitute the current register with the virtual subregister Reg:SubIdx.

Static Member Functions

Name

Description

CreateBA

Create a block‐address machine operand for BA with Offset.

CreateCFIIndex

Create a CFI instruction index machine operand.

CreateCImm

Create a constant‐integer machine operand from CI.

CreateCPI

Create a constant‐pool index machine operand.

CreateDbgInstrRef

Create a debug instruction‐reference machine operand.

CreateES

Create an external‐symbol machine operand.

CreateFI

Create a frame‐index machine operand.

CreateFPImm

Create a floating‐point immediate machine operand from CFP.

CreateGA

Create a global‐address operand for GV with Offset.

CreateImm

Create an immediate integer machine operand with value Val.

CreateIntrinsicID

Create an Intrinsic::ID machine operand.

CreateJTI

Create a jump‐table index machine operand.

CreateLaneMask

Create a lane‐mask machine operand.

CreateMBB

Create a MachineBasicBlock reference operand.

CreateMCSymbol

Create an MCSymbol machine operand.

CreateMetadata

Create a metadata machine operand.

CreatePredicate

Create a generic ISel predicate machine operand.

CreateReg

Create a register machine operand.

CreateRegLiveOut

Create a live‐out register mask operand.

CreateRegMask

Create a register mask operand referencing Mask.

CreateShuffleMask

Create a shuffle‐mask machine operand.

CreateTargetIndex

Create a target‐index machine operand.

clobbersPhysReg

Return true if register mask RegMask clobbers PhysReg.

getRegMaskSize

Returns number of elements needed for a regmask array.

printIRSlotNumber

Print an IR slot number.

printOperandOffset

Print the offset with explicit +/‐ signs.

printStackObjectReference

Print a stack object reference.

printSubRegIdx

Print a subreg index operand.

printSymbol

Print a MCSymbol as an operand.

printTargetFlags

Print operand target flags.

Friends

Name

Description

llvm::DenseMapInfo<MachineOperand>

DenseMapInfo specialization so MachineOperand can be used as a DenseMap key.

llvm::MachineRegisterInfo

MachineRegisterInfo ‐ Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.

llvm::MachineInstr

Representation of each machine instruction.

llvm::hash_value

MachineOperand hash_value overload.

Non-Member Functions

Name

Description

getRegState

Get all register state flags from machine operand RegOp.

operator+

Return an iterator n positions after i.

operator+

Return an iterator n positions after i.

stableHashValue

Compute a stable hash of machine operand MO.

Created with MrDocs