LLVM 20.0.0git
Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::InstrEmitter Class Reference

#include "CodeGen/SelectionDAG/InstrEmitter.h"

Public Types

using VRBaseMapType = SmallDenseMap< SDValue, Register, 16 >
 

Public Member Functions

void AddDbgValueLocationOps (MachineInstrBuilder &MIB, const MCInstrDesc &DbgValDesc, ArrayRef< SDDbgOperand > Locations, VRBaseMapType &VRBaseMap)
 
MachineInstrEmitDbgValue (SDDbgValue *SD, VRBaseMapType &VRBaseMap)
 EmitDbgValue - Generate machine instruction for a dbg_value node.
 
MachineInstrEmitDbgInstrRef (SDDbgValue *SD, VRBaseMapType &VRBaseMap)
 Emit a dbg_value as a DBG_INSTR_REF.
 
MachineInstrEmitDbgNoLocation (SDDbgValue *SD)
 Emit a DBG_VALUE $noreg, indicating a variable has no location.
 
MachineInstrEmitDbgValueList (SDDbgValue *SD, VRBaseMapType &VRBaseMap)
 Emit a DBG_VALUE_LIST from the operands to SDDbgValue.
 
MachineInstrEmitDbgValueFromSingleOp (SDDbgValue *SD, VRBaseMapType &VRBaseMap)
 Emit a DBG_VALUE from the operands to SDDbgValue.
 
MachineInstrEmitDbgLabel (SDDbgLabel *SD)
 Generate machine instruction for a dbg_label node.
 
void EmitNode (SDNode *Node, bool IsClone, bool IsCloned, VRBaseMapType &VRBaseMap)
 EmitNode - Generate machine code for a node and needed dependencies.
 
MachineBasicBlockgetBlock ()
 getBlock - Return the current basic block.
 
MachineBasicBlock::iterator getInsertPos ()
 getInsertPos - Return the current insertion position.
 
 InstrEmitter (const TargetMachine &TM, MachineBasicBlock *mbb, MachineBasicBlock::iterator insertpos)
 InstrEmitter - Construct an InstrEmitter and set it to start inserting at the given position in the given block.
 

Static Public Member Functions

static unsigned CountResults (SDNode *Node)
 CountResults - The results of target nodes have register or immediate operands first, then an optional chain, and optional flag operands (which do not go into the machine instrs.)
 

Detailed Description

Definition at line 32 of file InstrEmitter.h.

Member Typedef Documentation

◆ VRBaseMapType

Definition at line 34 of file InstrEmitter.h.

Constructor & Destructor Documentation

◆ InstrEmitter()

InstrEmitter::InstrEmitter ( const TargetMachine TM,
MachineBasicBlock mbb,
MachineBasicBlock::iterator  insertpos 
)

InstrEmitter - Construct an InstrEmitter and set it to start inserting at the given position in the given block.

Definition at line 1450 of file InstrEmitter.cpp.

References llvm::MachineBasicBlock::getParent(), and llvm::MachineFunction::useDebugInstrRef().

Member Function Documentation

◆ AddDbgValueLocationOps()

void InstrEmitter::AddDbgValueLocationOps ( MachineInstrBuilder MIB,
const MCInstrDesc DbgValDesc,
ArrayRef< SDDbgOperand Locations,
VRBaseMapType VRBaseMap 
)

◆ CountResults()

unsigned InstrEmitter::CountResults ( SDNode Node)
static

CountResults - The results of target nodes have register or immediate operands first, then an optional chain, and optional flag operands (which do not go into the machine instrs.)

CountResults - The results of target nodes have register or immediate operands first, then an optional chain, and optional glue operands (which do not go into the resulting MachineInstr).

Definition at line 43 of file InstrEmitter.cpp.

References N.

◆ EmitDbgInstrRef()

MachineInstr * InstrEmitter::EmitDbgInstrRef ( SDDbgValue SD,
VRBaseMapType VRBaseMap 
)

Emit a dbg_value as a DBG_INSTR_REF.

May produce DBG_VALUE $noreg instead if there is no variable location; alternately a half-formed DBG_INSTR_REF that refers to a virtual register and is corrected later in isel.

Definition at line 782 of file InstrEmitter.cpp.

References llvm::all_of(), llvm::any_of(), llvm::DIExpression::append(), assert(), llvm::BuildMI(), llvm::SDDbgOperand::CONST, llvm::DIExpression::convertToVariadicExpression(), llvm::MachineOperand::CreateDbgInstrRef(), llvm::MachineOperand::CreateReg(), llvm::MachineRegisterInfo::def_instr_begin(), DefMI, DL, EmitDbgNoLocation(), EmitDbgValueFromSingleOp(), EmitDbgValueList(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::SDDbgOperand::FRAMEIX, llvm::MCInstrInfo::get(), llvm::MachineInstr::getDebugInstrNum(), llvm::SDDbgValue::getDebugLoc(), llvm::SDDbgValue::getExpression(), llvm::SDDbgOperand::getKind(), llvm::SDDbgValue::getLocationOps(), GetMOForConstDbgOp(), llvm::SDDbgOperand::getResNo(), llvm::SDDbgOperand::getSDNode(), llvm::SDDbgValue::getVariable(), llvm::SDDbgOperand::getVReg(), llvm::MachineRegisterInfo::hasOneDef(), I, llvm::TargetInstrInfo::isCopyInstr(), llvm::MachineInstr::isCopyLike(), llvm::SDDbgValue::isIndirect(), llvm::SDDbgValue::isVariadic(), llvm::MachineInstr::operands(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SDDbgOperand::SDNODE, llvm::SmallVectorBase< Size_T >::size(), and llvm::SDDbgOperand::VREG.

Referenced by EmitDbgValue().

◆ EmitDbgLabel()

MachineInstr * InstrEmitter::EmitDbgLabel ( SDDbgLabel SD)

Generate machine instruction for a dbg_label node.

Definition at line 975 of file InstrEmitter.cpp.

References llvm::MachineInstrBuilder::addMetadata(), assert(), llvm::BuildMI(), DL, llvm::MCInstrInfo::get(), llvm::SDDbgLabel::getDebugLoc(), llvm::SDDbgLabel::getLabel(), and II.

◆ EmitDbgNoLocation()

MachineInstr * InstrEmitter::EmitDbgNoLocation ( SDDbgValue SD)

◆ EmitDbgValue()

MachineInstr * InstrEmitter::EmitDbgValue ( SDDbgValue SD,
VRBaseMapType VRBaseMap 
)

◆ EmitDbgValueFromSingleOp()

MachineInstr * InstrEmitter::EmitDbgValueFromSingleOp ( SDDbgValue SD,
VRBaseMapType VRBaseMap 
)

◆ EmitDbgValueList()

MachineInstr * InstrEmitter::EmitDbgValueList ( SDDbgValue SD,
VRBaseMapType VRBaseMap 
)

◆ EmitNode()

void llvm::InstrEmitter::EmitNode ( SDNode Node,
bool  IsClone,
bool  IsCloned,
VRBaseMapType VRBaseMap 
)
inline

EmitNode - Generate machine code for a node and needed dependencies.

Definition at line 142 of file InstrEmitter.h.

◆ getBlock()

MachineBasicBlock * llvm::InstrEmitter::getBlock ( )
inline

getBlock - Return the current basic block.

Definition at line 151 of file InstrEmitter.h.

References MBB.

◆ getInsertPos()

MachineBasicBlock::iterator llvm::InstrEmitter::getInsertPos ( )
inline

getInsertPos - Return the current insertion position.

Definition at line 154 of file InstrEmitter.h.


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