This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: [AMDGPU] Assembler: add .hsa_code_object_metadata directive for functime metadata V2.0
ClosedPublic

Authored by SamWot on Dec 9 2016, 7:21 AM.

Details

Summary

Added pair of directives .hsa_code_object_metadata/.end_hsa_code_object_metadata.
Between them user can put YAML string that would be directly put to the generated note. E.g.:

.hsa_code_object_metadata
    {
        amd.MDVersion: [ 2, 0 ]
    }
.end_hsa_code_object_metadata

Based on D25046

Diff Detail

Repository
rL LLVM

Event Timeline

SamWot updated this revision to Diff 80898.Dec 9 2016, 7:21 AM
SamWot retitled this revision from to AMDGPU: [AMDGPU] Assembler: add .hsa_code_object_metadata directive for functime metadata V2.0.
SamWot updated this object.
SamWot added reviewers: vpykhtin, nhaustov, yaxunl.
SamWot edited edge metadata.Dec 9 2016, 7:23 AM
SamWot updated this object.
SamWot added a subscriber: Restricted Project.
nhaustov edited edge metadata.Dec 13 2016, 5:44 AM

Could you change directive name to .amdgpu_runtime_metadata? I think it better reflects the purpose as metadata has nothing to do with HSA.

SamWot updated this revision to Diff 81556.Dec 15 2016, 2:51 AM
SamWot edited edge metadata.

Renamed directives to amdgpu_runtime_metadata.

nhaustov accepted this revision.Dec 15 2016, 2:53 AM
nhaustov edited edge metadata.
nhaustov added inline comments.
lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
1743 ↗(On Diff #81556)

Maybe rename to ParseDirectiveRuntimeMetadata to match EmitRuntimeMetadata?

This revision is now accepted and ready to land.Dec 15 2016, 2:53 AM
SamWot updated this revision to Diff 81560.Dec 15 2016, 3:43 AM
SamWot edited edge metadata.

Updated parse method name

yaxunl added inline comments.Dec 15 2016, 7:19 AM
lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
240 ↗(On Diff #81560)

This function and the above function are similar. Is it possible to unify them?

test/MC/AMDGPU/metadata.s
36 ↗(On Diff #81560)

better fix this

SamWot updated this revision to Diff 81728.Dec 16 2016, 2:48 AM
SamWot edited edge metadata.

Capitalized EmitRuntimeMetadata method name.
Unified EmitRuntimeMetadata methods.

yaxunl accepted this revision.Dec 16 2016, 7:16 AM
yaxunl edited edge metadata.

LGTM. Thanks!

This revision was automatically updated to reflect the committed changes.