This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Refactor HSAMetadataStream::emitKernel (NFC)
ClosedPublic

Authored by scott.linder on Jun 14 2018, 9:43 AM.

Details

Summary

Move all metadata construction into AMDGPUHSAMetadataStreamer.

This patch is part of a series required for AMDGPU to support it's new MessagePack metadata.

Diff Detail

Repository
rL LLVM

Event Timeline

scott.linder created this revision.Jun 14 2018, 9:43 AM
arsenm accepted this revision.Jun 14 2018, 1:51 PM

LGTM

This revision is now accepted and ready to land.Jun 14 2018, 1:51 PM
This revision was automatically updated to reflect the committed changes.
bjope added a subscriber: bjope.Jul 10 2018, 3:42 PM
bjope added inline comments.
llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUHSAMetadataStreamer.h
31

I see some build errors. Seems to be due to this commit:

[1276/3790] Building CXX object lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/AMDGPUHSAMetadataStreamer.cpp.o
FAILED: lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/AMDGPUHSAMetadataStreamer.cpp.o 
/app/clang/3.6/bin/clang++  -march=corei7  -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Target/AMDGPU -I../lib/Target/AMDGPU -I/usr/include/libxml2 -Iinclude -I../include -fPIC -fvisibility-inlines-hidden -Werror -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -O3    -UNDEBUG  -fno-exceptions -fno-rtti -MMD -MT lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/AMDGPUHSAMetadataStreamer.cpp.o -MF lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/AMDGPUHSAMetadataStreamer.cpp.o.d -o lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/AMDGPUHSAMetadataStreamer.cpp.o -c ../lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp
In file included from ../lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp:20:
../lib/Target/AMDGPU/SIProgramInfo.h:22:1: error: 'SIProgramInfo' defined as a struct here but previously declared as a class [-Werror,-Wmismatched-tags]
struct SIProgramInfo {
^
../lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.h:31:1: note: did you mean struct here?
class SIProgramInfo;
^~~~~
struct
1 error generated.
[1277/3790] Building CXX object lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/AMDGPUFrameLowering.cpp.o
[1278/3790] Building CXX object lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/AMDGPUAsmPrinter.cpp.o
FAILED: lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/AMDGPUAsmPrinter.cpp.o 
/app/clang/3.6/bin/clang++  -march=corei7  -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Target/AMDGPU -I../lib/Target/AMDGPU -I/usr/include/libxml2 -Iinclude -I../include -fPIC -fvisibility-inlines-hidden -Werror -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -O3    -UNDEBUG  -fno-exceptions -fno-rtti -MMD -MT lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/AMDGPUAsmPrinter.cpp.o -MF lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/AMDGPUAsmPrinter.cpp.o.d -o lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/AMDGPUAsmPrinter.cpp.o -c ../lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
In file included from ../lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp:19:
In file included from ../lib/Target/AMDGPU/AMDGPUAsmPrinter.h:21:
../lib/Target/AMDGPU/SIProgramInfo.h:22:1: error: 'SIProgramInfo' defined as a struct here but previously declared as a class [-Werror,-Wmismatched-tags]
struct SIProgramInfo {
^
../lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.h:31:1: note: did you mean struct here?
class SIProgramInfo;
^~~~~
struct
1 error generated.