diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.h')
-rw-r--r-- | contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.h | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.h b/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.h index 9e1e26d65d8c..d3a555bc228f 100644 --- a/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.h +++ b/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.h @@ -22,6 +22,7 @@ struct amd_kernel_code_t; namespace llvm { class AMDGPUMachineFunction; +struct AMDGPUResourceUsageAnalysis; class AMDGPUTargetStreamer; class MCCodeEmitter; class MCOperand; @@ -39,32 +40,17 @@ struct kernel_descriptor_t; class AMDGPUAsmPrinter final : public AsmPrinter { private: - // Track resource usage for callee functions. - struct SIFunctionResourceInfo { - // Track the number of explicitly used VGPRs. Special registers reserved at - // the end are tracked separately. - int32_t NumVGPR = 0; - int32_t NumAGPR = 0; - int32_t NumExplicitSGPR = 0; - uint64_t PrivateSegmentSize = 0; - bool UsesVCC = false; - bool UsesFlatScratch = false; - bool HasDynamicallySizedStack = false; - bool HasRecursion = false; - - int32_t getTotalNumSGPRs(const GCNSubtarget &ST) const; - int32_t getTotalNumVGPRs(const GCNSubtarget &ST) const; - }; + void initializeTargetID(const Module &M); + + AMDGPUResourceUsageAnalysis *ResourceUsage; SIProgramInfo CurrentProgramInfo; - DenseMap<const Function *, SIFunctionResourceInfo> CallGraphResourceInfo; std::unique_ptr<AMDGPU::HSAMD::MetadataStreamer> HSAMetadataStream; MCCodeEmitter *DumpCodeInstEmitter = nullptr; uint64_t getFunctionCodeSize(const MachineFunction &MF) const; - SIFunctionResourceInfo analyzeResourceUsage(const MachineFunction &MF) const; void getSIProgramInfo(SIProgramInfo &Out, const MachineFunction &MF); void getAmdKernelCode(amd_kernel_code_t &Out, const SIProgramInfo &KernelInfo, @@ -146,6 +132,8 @@ public: const char *ExtraCode, raw_ostream &O) override; protected: + void getAnalysisUsage(AnalysisUsage &AU) const override; + std::vector<std::string> DisasmLines, HexLines; size_t DisasmLineMaxLen; }; |