AMDGPU: Fix format string indexes for existing llvm.printf.fmts
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 10 Jan 2023 22:17:29 +0000 (17:17 -0500)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 13 Jan 2023 18:18:27 +0000 (13:18 -0500)
commit39af5cec8b066901b374ae52179cd378dceb2e0e
tree0762328ee24b72ef8c4cfa6f854ed6df7b72024e
parent521554a7eeead2f41f7f7b465c2fc326bd22b22a
AMDGPU: Fix format string indexes for existing llvm.printf.fmts

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.
llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp
llvm/test/CodeGen/AMDGPU/printf-existing-format-strings.ll [new file with mode: 0644]