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

Member Functions

Name

Description

ChangeToBA

ChangeToBA ‐ Replace this operand with a new block address operand.

ChangeToCPI

ChangeToCPI ‐ Replace this operand with a new constant pool index operand.

ChangeToDbgInstrRef

Replace this operand with an Instruction Reference.

ChangeToES

ChangeToES ‐ Replace this operand with a new external symbol operand.

ChangeToFPImmediate

ChangeToFPImmediate ‐ Replace this operand with a new FP immediate operand of the specified value. If an operand is known to be an FP immediate already, the setFPImm method should be used.

ChangeToFrameIndex

Replace this operand with a frame index.

ChangeToGA

ChangeToGA ‐ Replace this operand with a new global address operand.

ChangeToImmediate

ChangeToImmediate ‐ Replace this operand with a new immediate operand of the specified value. If an operand is known to be an immediate already, the setImm method should be used.

ChangeToMCSymbol

ChangeToMCSymbol ‐ Replace this operand with a new MC symbol operand.

ChangeToRegister

ChangeToRegister ‐ Replace this operand with a new register operand of the specified value. If an operand is known to be an register already, the setReg method should be used.

ChangeToTargetIndex

Replace this operand with a target index.

addTargetFlag

clearParent

clearParent ‐ Reset the parent pointer.

clobbersPhysReg

clobbersPhysReg ‐ Returns true if this RegMask operand clobbers PhysReg.

dump

getBlockAddress

getCFIIndex

getCImm

getFPImm

getGlobal

getImm

getIndex

getInstrRefInstrIndex

getInstrRefOpIndex

getIntrinsicID

getLaneMask

getMBB

getMCSymbol

getMetadata

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 ‐ Return the instruction that this operand belongs to.

getPredicate

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

getSubReg

getSymbolName

getTargetFlags

getTargetIndexName

getTargetIndexName ‐ If this MachineOperand is a TargetIndex that has a name, attempt to get the name. Returns nullptr if the TargetIndex does not have a name. Asserts if MO is not a TargetIndex.

getType

getType ‐ Returns the MachineOperandType for this operand.

isBlockAddress

isBlockAddress ‐ Tests if this is a MO_BlockAddress operand.

isCFIIndex

isCImm

isCImm ‐ Test if this is a MO_CImmediate operand.

isCPI

isCPI ‐ Tests if this is a MO_ConstantPoolIndex operand.

isDbgInstrRef

isDead

isDebug

isDef

isEarlyClobber

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

Returns true if this operand is identical to the specified operand except for liveness related flags (isKill, isUndef and isDead). Note that this should stay in sync with the hash_value overload below.

isImm

isImm ‐ Tests if this is a MO_Immediate operand.

isImplicit

isInternalRead

isIntrinsicID

isJTI

isJTI ‐ Tests if this is a MO_JumpTableIndex operand.

isKill

isLaneMask

isMBB

isMBB ‐ Tests if this is a MO_MachineBasicBlock operand.

isMCSymbol

isMetadata

isMetadata ‐ Tests if this is a MO_Metadata operand.

isPredicate

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

isRenamable ‐ Returns true if this register may be renamed, i.e. it does not generate a value that is somehow read in a way that is not represented by the Machine IR (e.g. to meet an ABI or ISA requirement). This is only valid on physical register operands. Virtual registers are assumed to always be renamable regardless of the value of this field.

isShuffleMask

isSymbol

isSymbol ‐ Tests if this is a MO_ExternalSymbol operand.

isTargetIndex

isTargetIndex ‐ Tests if this is a MO_TargetIndex operand.

isTied

isUndef

isUse

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

readsReg ‐ Returns true if this operand reads the previous value of its register. A use operand with the <undef> flag set doesn't read its register. A sub‐register def implicitly reads the other parts of the register being redefined unless the <undef> flag is set.

setCImm

setFPImm

setImm

setImplicit

setIndex

setInstrRefInstrIndex

setInstrRefOpIndex

setIntrinsicID

setIsDead

setIsDebug

setIsDef

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

setIsEarlyClobber

setIsInternalRead

setIsKill

setIsRenamable

setIsUndef

setIsUse

setMBB

setMetadata

setOffset

setPredicate

setReg

Change the register this operand corresponds to.

setRegMask

Sets value of register mask operand referencing Mask. The operand does not take ownership of the memory referenced by Mask, it must remain valid for the lifetime of the operand. See CreateRegMask(). Any physreg with a 0 bit in the mask is clobbered by the instruction.

setSubReg

setTargetFlags

substPhysReg

substPhysReg ‐ Substitute the current register with the physical register Reg, taking any existing SubReg into account. For instance, substPhysReg(%eax) will change %reg1024:sub_8bit to %al.

substVirtReg

substVirtReg ‐ Substitute the current register with the virtual subregister Reg:SubReg. Take any existing SubReg index into account, using TargetRegisterInfo to compose the subreg indices if necessary. Reg must be a virtual register, SubIdx can be 0.

Static Member Functions

Name

Description

CreateBA

CreateCFIIndex

CreateCImm

CreateCPI

CreateDbgInstrRef

CreateES

CreateFI

CreateFPImm

CreateGA

CreateImm

CreateIntrinsicID

CreateJTI

CreateLaneMask

CreateMBB

CreateMCSymbol

CreateMetadata

CreatePredicate

CreateReg

CreateRegLiveOut

CreateRegMask

CreateRegMask ‐ Creates a register mask operand referencing Mask. The operand does not take ownership of the memory referenced by Mask, it must remain valid for the lifetime of the operand.

CreateShuffleMask

CreateTargetIndex

clobbersPhysReg

clobbersPhysReg ‐ Returns true if this RegMask clobbers PhysReg. It is sometimes necessary to detach the register mask pointer from its machine operand. This static method can be used for such detached bit mask pointers.

getRegMaskSize

Returns number of elements needed for a regmask array.

printIRSlotNumber

Print an IRSlotNumber.

printOperandOffset

Print the offset with explicit +/‐ signs.

printStackObjectReference

Print a stack object reference.

printSubRegIdx

Print a subreg index operand. MO_Immediate operands can also be subreg idices. If it's the case, the subreg index name will be printed. MachineInstr::isOperandSubregIdx can be called to check this.

printSymbol

Print a MCSymbol as an operand.

printTargetFlags

Print operand target flags.

Friends

Name

Description

llvm::DenseMapInfo<MachineOperand>

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.

Created with MrDocs