LLVM 20.0.0git
|
#include "CodeGen/SelectionDAG/InstrEmitter.h"
Public Member Functions | |
void | AddDbgValueLocationOps (MachineInstrBuilder &MIB, const MCInstrDesc &DbgValDesc, ArrayRef< SDDbgOperand > Locations, DenseMap< SDValue, Register > &VRBaseMap) |
MachineInstr * | EmitDbgValue (SDDbgValue *SD, DenseMap< SDValue, Register > &VRBaseMap) |
EmitDbgValue - Generate machine instruction for a dbg_value node. | |
MachineInstr * | EmitDbgInstrRef (SDDbgValue *SD, DenseMap< SDValue, Register > &VRBaseMap) |
Emit a dbg_value as a DBG_INSTR_REF. | |
MachineInstr * | EmitDbgNoLocation (SDDbgValue *SD) |
Emit a DBG_VALUE $noreg, indicating a variable has no location. | |
MachineInstr * | EmitDbgValueList (SDDbgValue *SD, DenseMap< SDValue, Register > &VRBaseMap) |
Emit a DBG_VALUE_LIST from the operands to SDDbgValue. | |
MachineInstr * | EmitDbgValueFromSingleOp (SDDbgValue *SD, DenseMap< SDValue, Register > &VRBaseMap) |
Emit a DBG_VALUE from the operands to SDDbgValue. | |
MachineInstr * | EmitDbgLabel (SDDbgLabel *SD) |
Generate machine instruction for a dbg_label node. | |
void | EmitNode (SDNode *Node, bool IsClone, bool IsCloned, DenseMap< SDValue, Register > &VRBaseMap) |
EmitNode - Generate machine code for a node and needed dependencies. | |
MachineBasicBlock * | getBlock () |
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.) | |
Definition at line 32 of file InstrEmitter.h.
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().
void InstrEmitter::AddDbgValueLocationOps | ( | MachineInstrBuilder & | MIB, |
const MCInstrDesc & | DbgValDesc, | ||
ArrayRef< SDDbgOperand > | Locations, | ||
DenseMap< SDValue, Register > & | VRBaseMap | ||
) |
Definition at line 755 of file InstrEmitter.cpp.
References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addFrameIndex(), llvm::MachineInstrBuilder::addReg(), llvm::SDDbgOperand::CONST, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count(), llvm::SDDbgOperand::FRAMEIX, GetMOForConstDbgOp(), llvm::SDDbgOperand::SDNODE, and llvm::SDDbgOperand::VREG.
Referenced by EmitDbgValueFromSingleOp(), and EmitDbgValueList().
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.
MachineInstr * InstrEmitter::EmitDbgInstrRef | ( | SDDbgValue * | SD, |
DenseMap< SDValue, Register > & | 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 788 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().
MachineInstr * InstrEmitter::EmitDbgLabel | ( | SDDbgLabel * | SD | ) |
Generate machine instruction for a dbg_label node.
Definition at line 981 of file InstrEmitter.cpp.
References llvm::MachineInstrBuilder::addMetadata(), assert(), llvm::BuildMI(), DL, llvm::MCInstrInfo::get(), llvm::SDDbgLabel::getDebugLoc(), llvm::SDDbgLabel::getLabel(), and II.
MachineInstr * InstrEmitter::EmitDbgNoLocation | ( | SDDbgValue * | SD | ) |
Emit a DBG_VALUE $noreg, indicating a variable has no location.
Definition at line 917 of file InstrEmitter.cpp.
References llvm::BuildMI(), llvm::DIExpression::convertToUndefExpression(), DL, llvm::MCInstrInfo::get(), llvm::SDDbgValue::getDebugLoc(), llvm::SDDbgValue::getExpression(), and llvm::SDDbgValue::getVariable().
Referenced by EmitDbgInstrRef(), and EmitDbgValue().
MachineInstr * InstrEmitter::EmitDbgValue | ( | SDDbgValue * | SD, |
DenseMap< SDValue, Register > & | VRBaseMap | ||
) |
EmitDbgValue - Generate machine instruction for a dbg_value node.
Definition at line 705 of file InstrEmitter.cpp.
References assert(), DL, EmitDbgInstrRef(), EmitDbgNoLocation(), EmitDbgValueFromSingleOp(), EmitDbgValueList(), llvm::SDDbgValue::getDebugLoc(), llvm::SDDbgValue::getLocationOps(), llvm::SDDbgValue::getVariable(), llvm::SDDbgValue::isInvalidated(), llvm::SDDbgValue::isVariadic(), and llvm::SDDbgValue::setIsEmitted().
MachineInstr * InstrEmitter::EmitDbgValueFromSingleOp | ( | SDDbgValue * | SD, |
DenseMap< SDValue, Register > & | VRBaseMap | ||
) |
Emit a DBG_VALUE from the operands to SDDbgValue.
Definition at line 946 of file InstrEmitter.cpp.
References AddDbgValueLocationOps(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMetadata(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::CallingConv::C, llvm::SDDbgOperand::CONST, llvm::DIExpression::constantFold(), DL, llvm::SDDbgOperand::fromConst(), llvm::MCInstrInfo::get(), llvm::SDDbgValue::getDebugLoc(), llvm::SDDbgValue::getExpression(), llvm::SDDbgValue::getLocationOps(), llvm::SDDbgValue::getVariable(), II, and llvm::SDDbgValue::isIndirect().
Referenced by EmitDbgInstrRef(), and EmitDbgValue().
MachineInstr * InstrEmitter::EmitDbgValueList | ( | SDDbgValue * | SD, |
DenseMap< SDValue, Register > & | VRBaseMap | ||
) |
Emit a DBG_VALUE_LIST from the operands to SDDbgValue.
Definition at line 930 of file InstrEmitter.cpp.
References AddDbgValueLocationOps(), llvm::MachineInstrBuilder::addMetadata(), llvm::BuildMI(), DL, llvm::MCInstrInfo::get(), llvm::SDDbgValue::getDebugLoc(), llvm::SDDbgValue::getExpression(), llvm::SDDbgValue::getLocationOps(), and llvm::SDDbgValue::getVariable().
Referenced by EmitDbgInstrRef(), and EmitDbgValue().
|
inline |
EmitNode - Generate machine code for a node and needed dependencies.
Definition at line 142 of file InstrEmitter.h.
|
inline |
getBlock - Return the current basic block.
Definition at line 151 of file InstrEmitter.h.
References MBB.
|
inline |
getInsertPos - Return the current insertion position.
Definition at line 154 of file InstrEmitter.h.