Go to the documentation of this file.
14 #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUASMPRINTER_H
15 #define LLVM_LIB_TARGET_AMDGPU_AMDGPUASMPRINTER_H
24 class AMDGPUMachineFunction;
25 struct AMDGPUResourceUsageAnalysis;
26 class AMDGPUTargetStreamer;
32 class MetadataStreamer;
37 struct kernel_descriptor_t;
42 void initializeTargetID(
const Module &
M);
48 std::unique_ptr<AMDGPU::HSAMD::MetadataStreamer> HSAMetadataStream;
65 void emitCommonFunctionComments(
uint32_t NumVGPR,
73 uint16_t getAmdhsaKernelCodeProperties(
80 void initTargetStreamer(
Module &
M);
84 std::unique_ptr<MCStreamer> Streamer);
142 #endif // LLVM_LIB_TARGET_AMDGPU_AMDGPUASMPRINTER_H
void emitBasicBlockStart(const MachineBasicBlock &MBB) override
Targets can override this to emit stuff at the start of a basic block.
This is an optimization pass for GlobalISel generic memory operations.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
AMDGPUAsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer)
void emitFunctionBodyStart() override
Targets can override this to emit stuff before the first basic block in the function.
void getAnalysisUsage(AnalysisUsage &AU) const override
Record analysis usage.
bool isBlockOnlyReachableByFallthrough(const MachineBasicBlock *MBB) const override
Return true if the basic block has exactly one predecessor and the control transfer mechanism between...
bool lowerOperand(const MachineOperand &MO, MCOperand &MCOp) const
Wrapper for MCInstLowering.lowerOperand() for the tblgen'erated pseudo lowering.
Streaming machine code generation interface.
void emitInstruction(const MachineInstr *MI) override
Implemented in AMDGPUMCInstLower.cpp.
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
Represent the analysis usage information of a pass.
MachineOperand class - Representation of each machine instruction operand.
bool IsTargetStreamerInitialized
This class implements an extremely fast bulk output stream that can only output to a stream.
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.
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 is an important base class in LLVM.
Representation of each machine instruction.
void emitEndOfAsmFile(Module &M) override
This virtual method can be overridden by targets that want to emit something at the end of their file...
AMDGPUTargetStreamer * getTargetStreamer() const
Primary interface to the complete machine description for the target machine.
std::vector< std::string > DisasmLines
const MCSubtargetInfo * getGlobalSTI() const
MachineFunction * MF
The current machine function.
A Module instance is used to store all the information related to an LLVM module.
const MCExpr * lowerConstant(const Constant *CV) override
Lower the specified LLVM Constant to an MCExpr.
StringRef - Represent a constant reference to a string, i.e.
void emitFunctionBodyEnd() override
Targets can override this to emit stuff after the last basic block in the function.
AMD Kernel Code Object (amd_kernel_code_t).
MCCodeEmitter - Generic instruction encoding interface.
This class is intended to be used as a driving class for all asm writers.
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
bool doFinalization(Module &M) override
Shut down the asmprinter.
Track resource usage for kernels / entry functions.
bool emitPseudoExpansionLowering(MCStreamer &OutStreamer, const MachineInstr *MI)
tblgen'erated driver function for lowering simple MI->MC pseudo instructions.
TargetMachine & TM
Target machine description.
void emitFunctionEntryLabel() override
EmitFunctionEntryLabel - Emit the label that is the entrypoint for the function.
Instances of this class represent operands of the MCInst class.
bool runOnMachineFunction(MachineFunction &MF) override
Emit the specified function out to the OutStreamer.
std::vector< std::string > HexLines
void emitGlobalVariable(const GlobalVariable *GV) override
Emit the specified global variable to the .s file.
Generic base class for all target subtargets.
Base class for the full range of assembler expressions which are needed for parsing.