15 #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUASMPRINTER_H 16 #define LLVM_LIB_TARGET_AMDGPU_AMDGPUASMPRINTER_H 34 class AMDGPUMachineFunction;
35 class AMDGPUTargetStreamer;
42 struct SIFunctionResourceInfo {
46 int32_t NumExplicitSGPR = 0;
47 uint64_t PrivateSegmentSize = 0;
49 bool UsesFlatScratch =
false;
50 bool HasDynamicallySizedStack =
false;
51 bool HasRecursion =
false;
59 std::unique_ptr<AMDGPU::HSAMD::MetadataStreamer> HSAMetadataStream;
60 std::map<uint32_t, uint32_t> PALMetadataMap;
63 SIFunctionResourceInfo analyzeResourceUsage(
const MachineFunction &MF)
const;
65 void readPALMetadata(
Module &M);
71 unsigned &NumVGPR)
const;
79 void emitCommonFunctionComments(
uint32_t NumVGPR,
85 uint16_t getAmdhsaKernelCodeProperties(
94 std::unique_ptr<MCStreamer> Streamer);
140 unsigned AsmVariant,
const char *ExtraCode,
150 #endif // LLVM_LIB_TARGET_AMDGPU_AMDGPUASMPRINTER_H void EmitGlobalVariable(const GlobalVariable *GV) override
Emit the specified global variable to the .s file.
const MCExpr * lowerConstant(const Constant *CV) override
Lower the specified LLVM Constant to an MCExpr.
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
void EmitFunctionBodyEnd() override
Targets can override this to emit stuff after the last basic block in the function.
bool emitPseudoExpansionLowering(MCStreamer &OutStreamer, const MachineInstr *MI)
tblgen'erated driver function for lowering simple MI->MC pseudo instructions.
MachineFunction * MF
The current machine function.
const MCSubtargetInfo * getSTI() const
Track resource usage for kernels / entry functions.
AMD Kernel Code Object (amd_kernel_code_t).
Defines struct to track resource usage for kernels and entry functions.
Base class for the full range of assembler expressions which are needed for parsing.
AMDGPUAsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer)
void EmitInstruction(const MachineInstr *MI) override
Implemented in AMDGPUMCInstLower.cpp.
bool isBlockOnlyReachableByFallthrough(const MachineBasicBlock *MBB) const override
Return true if the basic block has exactly one predecessor and the control transfer mechanism between...
Streaming machine code generation interface.
This is an important base class in LLVM.
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode, raw_ostream &O) override
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant...
TargetMachine & TM
Target machine description.
This class is intended to be used as a driving class for all asm writers.
void EmitEndOfAsmFile(Module &M) override
This virtual method can be overridden by targets that want to emit something at the end of their file...
void EmitBasicBlockStart(const MachineBasicBlock &MBB) const override
Targets can override this to emit stuff at the start of a basic block.
AMDGPUTargetStreamer * getTargetStreamer() const
AMDHSA kernel descriptor definitions.
std::vector< std::string > HexLines
unsigned getTotalNumSGPRs(const MCSubtargetInfo *STI)
MachineOperand class - Representation of each machine instruction operand.
bool runOnMachineFunction(MachineFunction &MF) override
Emit the specified function out to the OutStreamer.
std::vector< std::string > DisasmLines
void EmitFunctionEntryLabel() override
EmitFunctionEntryLabel - Emit the label that is the entrypoint for the function.
Representation of each machine instruction.
void EmitFunctionBodyStart() override
Targets can override this to emit stuff before the first basic block in the function.
bool doFinalization(Module &M) override
Shut down the asmprinter.
Generic base class for all target subtargets.
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
void EmitStartOfAsmFile(Module &M) override
This virtual method can be overridden by targets that want to emit something at the start of their fi...
This class implements an extremely fast bulk output stream that can only output to a stream...
Primary interface to the complete machine description for the target machine.
StringRef - Represent a constant reference to a string, i.e.
bool lowerOperand(const MachineOperand &MO, MCOperand &MCOp) const
Wrapper for MCInstLowering.lowerOperand() for the tblgen'erated pseudo lowering.
Instances of this class represent operands of the MCInst class.