15 #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUASMPRINTER_H
16 #define LLVM_LIB_TARGET_AMDGPU_AMDGPUASMPRINTER_H
31 class AMDGPUTargetStreamer;
38 struct SIFunctionResourceInfo {
42 int32_t NumExplicitSGPR = 0;
45 bool UsesFlatScratch =
false;
46 bool HasDynamicallySizedStack =
false;
47 bool HasRecursion =
false;
53 struct SIProgramInfo {
65 uint64_t ComputePGMRSrc1 = 0;
71 uint64_t ComputePGMRSrc2 = 0;
76 bool FlatUsed =
false;
86 uint16_t ReservedVGPRFirst = 0;
89 uint16_t ReservedVGPRCount = 0;
94 uint16_t DebuggerWavefrontPrivateSegmentOffsetSGPR =
100 uint16_t DebuggerPrivateSegmentBufferSGPR =
105 bool DynamicCallStack =
false;
108 bool VCCUsed =
false;
110 SIProgramInfo() =
default;
113 SIProgramInfo CurrentProgramInfo;
117 SIFunctionResourceInfo analyzeResourceUsage(
const MachineFunction &MF)
const;
124 unsigned &NumVGPR)
const;
129 void EmitProgramInfoSI(
const MachineFunction &MF,
const SIProgramInfo &KernelInfo);
130 void emitCommonFunctionComments(
uint32_t NumVGPR,
137 std::unique_ptr<MCStreamer> Streamer);
179 unsigned AsmVariant,
const char *ExtraCode,
190 #endif // LLVM_LIB_TARGET_AMDGPU_AMDGPUASMPRINTER_H
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.
const MCExpr * lowerConstant(const Constant *CV) override
Lower the specified LLVM Constant to an MCExpr.
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
A Module instance is used to store all the information related to an LLVM module. ...
bool emitPseudoExpansionLowering(MCStreamer &OutStreamer, const MachineInstr *MI)
tblgen'erated driver function for lowering simple MI->MC pseudo instructions.
const MachineFunction * MF
The current machine function.
const MCSubtargetInfo * getSTI() const
OpenCL uses address spaces to differentiate between various memory regions on the hardware...
AMD Kernel Code Object (amd_kernel_code_t).
Base class for the full range of assembler expressions which are needed for parsing.
AMDGPUTargetStreamer & getTargetStreamer() const
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.
unsigned getTotalNumSGPRs(const FeatureBitset &Features)
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...
std::vector< std::string > HexLines
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.
MCSubtargetInfo - 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.
Instances of this class represent operands of the MCInst class.