diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2021-07-29 20:15:26 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2021-07-29 20:15:26 +0000 |
commit | 344a3780b2e33f6ca763666c380202b18aab72a3 (patch) | |
tree | f0b203ee6eb71d7fdd792373e3c81eb18d6934dd /llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.h | |
parent | b60736ec1405bb0a8dd40989f67ef4c93da068ab (diff) | |
download | src-344a3780b2e33f6ca763666c380202b18aab72a3.tar.gz src-344a3780b2e33f6ca763666c380202b18aab72a3.zip |
vendor/llvm-project/llvmorg-13-init-16847-g88e66fa60ae5vendor/llvm-project/llvmorg-12.0.1-rc2-0-ge7dac564cd0evendor/llvm-project/llvmorg-12.0.1-0-gfed41342a82f
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.h')
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.h | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.h b/llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.h index 1c6db14b85cd..4824b4cf37c7 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.h +++ b/llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.h @@ -15,6 +15,7 @@ #ifndef LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUHSAMETADATASTREAMER_H #define LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUHSAMETADATASTREAMER_H +#include "Utils/AMDGPUBaseInfo.h" #include "llvm/BinaryFormat/MsgPackDocument.h" #include "llvm/Support/AMDGPUMetadata.h" #include "llvm/Support/Alignment.h" @@ -40,7 +41,8 @@ public: virtual bool emitTo(AMDGPUTargetStreamer &TargetStreamer) = 0; - virtual void begin(const Module &Mod) = 0; + virtual void begin(const Module &Mod, + const IsaInfo::AMDGPUTargetID &TargetID) = 0; virtual void end() = 0; @@ -48,8 +50,9 @@ public: const SIProgramInfo &ProgramInfo) = 0; }; -class MetadataStreamerV3 final : public MetadataStreamer { -private: +// TODO: Rename MetadataStreamerV3 -> MetadataStreamerMsgPackV3. +class MetadataStreamerV3 : public MetadataStreamer { +protected: std::unique_ptr<msgpack::Document> HSAMetadataDoc = std::make_unique<msgpack::Document>(); @@ -108,7 +111,8 @@ public: bool emitTo(AMDGPUTargetStreamer &TargetStreamer) override; - void begin(const Module &Mod) override; + void begin(const Module &Mod, + const IsaInfo::AMDGPUTargetID &TargetID) override; void end() override; @@ -116,6 +120,21 @@ public: const SIProgramInfo &ProgramInfo) override; }; +// TODO: Rename MetadataStreamerV4 -> MetadataStreamerMsgPackV4. +class MetadataStreamerV4 final : public MetadataStreamerV3 { + void emitVersion(); + + void emitTargetID(const IsaInfo::AMDGPUTargetID &TargetID); + +public: + MetadataStreamerV4() = default; + ~MetadataStreamerV4() = default; + + void begin(const Module &Mod, + const IsaInfo::AMDGPUTargetID &TargetID) override; +}; + +// TODO: Rename MetadataStreamerV2 -> MetadataStreamerYamlV2. class MetadataStreamerV2 final : public MetadataStreamer { private: Metadata HSAMetadata; @@ -172,7 +191,8 @@ public: bool emitTo(AMDGPUTargetStreamer &TargetStreamer) override; - void begin(const Module &Mod) override; + void begin(const Module &Mod, + const IsaInfo::AMDGPUTargetID &TargetID) override; void end() override; |