diff options
author | Rhys Perry <pendingchaos02@gmail.com> | 2022-06-14 20:25:24 +0100 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2022-06-16 00:47:51 +0000 |
commit | 33e7ba2e3e144f40174240298bed2fcc0fc93e80 (patch) | |
tree | bdd9660e867093a9621fca14d8fa4248275b5ebe /src/amd/compiler/aco_print_asm.cpp | |
parent | d301883aba5a60d8d748a82a5777aa0701bdcaca (diff) | |
download | mesa-33e7ba2e3e144f40174240298bed2fcc0fc93e80.tar.gz |
aco: update SMEM offset workaround for LLVM 15
This isn't needed since LLVM 15's b0ccf38b018.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6663
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17036>
Diffstat (limited to 'src/amd/compiler/aco_print_asm.cpp')
-rw-r--r-- | src/amd/compiler/aco_print_asm.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/amd/compiler/aco_print_asm.cpp b/src/amd/compiler/aco_print_asm.cpp index 974ef764cbe..ecfdb950c4a 100644 --- a/src/amd/compiler/aco_print_asm.cpp +++ b/src/amd/compiler/aco_print_asm.cpp @@ -308,22 +308,31 @@ disasm_instr(amd_gfx_level gfx_level, LLVMDisasmContextRef disasm, uint32_t* bin size = l / 4; } +#if LLVM_VERSION_MAJOR <= 14 /* See: https://github.com/GPUOpen-Tools/radeon_gpu_profiler/issues/65 and * https://github.com/llvm/llvm-project/issues/38652 */ - if (gfx_level == GFX9 && (binary[pos] & 0xfc024000) == 0xc0024000) { + if (invalid) { + /* do nothing */ + } else if (gfx_level == GFX9 && (binary[pos] & 0xfc024000) == 0xc0024000) { /* SMEM with IMM=1 and SOE=1: LLVM ignores SOFFSET */ size_t len = strlen(outline); - snprintf(outline + len, outline_size - len, ", s%u", binary[pos + 1] >> 25); + + char imm[16] = {0}; + while (outline[--len] != ' ') ; + strncpy(imm, outline + len + 1, sizeof(imm) - 1); + + snprintf(outline + len, outline_size - len, " s%u offset:%s", binary[pos + 1] >> 25, imm); } else if (gfx_level >= GFX10 && (binary[pos] & 0xfc000000) == 0xf4000000 && (binary[pos + 1] & 0xfe000000) != 0xfa000000) { /* SMEM non-NULL SOFFSET: LLVM ignores OFFSET */ uint32_t offset = binary[pos + 1] & 0x1fffff; if (offset) { size_t len = strlen(outline); - snprintf(outline + len, outline_size - len, ", 0x%x", offset); + snprintf(outline + len, outline_size - len, " offset:0x%x", offset); } } +#endif return std::make_pair(invalid, size); } |