14#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUASMPRINTER_H
15#define LLVM_LIB_TARGET_AMDGPU_AMDGPUASMPRINTER_H
23class AMDGPUMachineFunction;
24struct AMDGPUResourceUsageAnalysis;
25class AMDGPUTargetStreamer;
31struct MCKernelDescriptor;
32struct AMDGPUMCKernelCodeT;
34class MetadataStreamer;
40 unsigned CodeObjectVersion;
41 void initializeTargetID(
const Module &M);
49 std::unique_ptr<AMDGPU::HSAMD::MetadataStreamer> HSAMetadataStream;
67 void emitCommonFunctionComments(
const MCExpr *NumVGPR,
const MCExpr *NumAGPR,
68 const MCExpr *TotalNumVGPR,
74 bool isModuleEntryFunction,
bool hasMAIInsts);
82 void initTargetStreamer(
Module &M);
93 std::unique_ptr<MCStreamer> Streamer);
MC infrastructure to propagate the function level resource usage info.
Defines struct to track resource usage and hardware flags for kernels and entry functions.
void emitFunctionEntryLabel() override
EmitFunctionEntryLabel - Emit the label that is the entrypoint for the function.
const MCSubtargetInfo * getGlobalSTI() const
void emitImplicitDef(const MachineInstr *MI) const override
Targets can override this to customize the output of IMPLICIT_DEF instructions in verbose mode.
std::vector< std::string > DisasmLines
void emitStartOfAsmFile(Module &M) override
This virtual method can be overridden by targets that want to emit something at the start of their fi...
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
std::vector< std::string > HexLines
bool IsTargetStreamerInitialized
void emitGlobalVariable(const GlobalVariable *GV) override
Emit the specified global variable to the .s file.
bool lowerOperand(const MachineOperand &MO, MCOperand &MCOp) const
Wrapper for MCInstLowering.lowerOperand() for the tblgen'erated pseudo lowering.
bool lowerPseudoInstExpansion(const MachineInstr *MI, MCInst &Inst)
tblgen'erated driver function for lowering simple MI->MC pseudo instructions.
void getAnalysisUsage(AnalysisUsage &AU) const override
Record analysis usage.
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &O) override
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant.
bool runOnMachineFunction(MachineFunction &MF) override
Emit the specified function out to the OutStreamer.
void emitFunctionBodyEnd() override
Targets can override this to emit stuff after the last basic block in the function.
bool doFinalization(Module &M) override
Shut down the asmprinter.
void emitEndOfAsmFile(Module &M) override
This virtual method can be overridden by targets that want to emit something at the end of their file...
bool doInitialization(Module &M) override
Set up the AsmPrinter when we are working on a new module.
const MCExpr * lowerConstant(const Constant *CV) override
Lower the specified LLVM Constant to an MCExpr.
void emitFunctionBodyStart() override
Targets can override this to emit stuff before the first basic block in the function.
void emitBasicBlockStart(const MachineBasicBlock &MBB) override
Targets can override this to emit stuff at the start of a basic block.
void emitInstruction(const MachineInstr *MI) override
Implemented in AMDGPUMCInstLower.cpp.
AMDGPUTargetStreamer * getTargetStreamer() const
Represent the analysis usage information of a pass.
This class is intended to be used as a driving class for all asm writers.
TargetMachine & TM
Target machine description.
MachineFunction * MF
The current machine function.
This is an important base class in LLVM.
MCCodeEmitter - Generic instruction encoding interface.
Base class for the full range of assembler expressions which are needed for parsing.
Instances of this class represent a single low-level machine instruction.
Instances of this class represent operands of the MCInst class.
Generic base class for all target subtargets.
Representation of each machine instruction.
MachineOperand class - Representation of each machine instruction operand.
A Module instance is used to store all the information related to an LLVM module.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
StringRef - Represent a constant reference to a string, i.e.
Primary interface to the complete machine description for the target machine.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
Track resource usage for kernels / entry functions.