This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Fix format string indexes for existing llvm.printf.fmts
ClosedPublic

Authored by arsenm on Jan 10 2023, 2:24 PM.

Details

Reviewers
sameerds
vikramRH
Group Reviewers
Restricted Project
Summary

The index stored to the buffer is just an index into this named
metadata. It would more robust to produce a private constant table,
and use a constant expression to index into it.

Diff Detail

Event Timeline

arsenm created this revision.Jan 10 2023, 2:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 10 2023, 2:24 PM
arsenm requested review of this revision.Jan 10 2023, 2:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 10 2023, 2:24 PM
Herald added a subscriber: wdng. · View Herald Transcript
vikramRH added inline comments.Jan 11 2023, 12:36 AM
llvm/test/CodeGen/AMDGPU/printf-existing-format-strings.ll
52–53

I guess this does not relate to the test case, is it just mentioned as a template ?

vikramRH added inline comments.Jan 11 2023, 12:47 AM
llvm/test/CodeGen/AMDGPU/printf-existing-format-strings.ll
52–53

if these are just inputs, probably it make sense to have assertions for output metadata as well ?

arsenm updated this revision to Diff 488624.Jan 12 2023, 5:51 AM

Generate metadata checks

sameerds accepted this revision.Jan 12 2023, 6:44 AM
This revision is now accepted and ready to land.Jan 12 2023, 6:44 AM
arsenm closed this revision.Jan 13 2023, 10:17 AM
arsenm added inline comments.
llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp
170

For some reason this indexing scheme starts at one, so this is off by one