From b0ad3c216026565f84685d8a805ff397ff276706 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Sat, 13 Jul 2024 00:15:26 +0200 Subject: [PATCH] aco: fix s_delay_alu with salu and trans dependency These events were silently truncated in get_counters_for_event. The integer types in this pass are a bit all over the place, maybe we should consider using typedefs for clarity or a different solution with type safety. Fixes: 9e9cabd2fa1 ("aco/waitcnt: support GFX12 in waitcnt pass") Reviewed-by: Rhys Perry Part-of: --- src/amd/compiler/aco_insert_waitcnt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_insert_waitcnt.cpp b/src/amd/compiler/aco_insert_waitcnt.cpp index 9369240c17f..ae079dcd755 100644 --- a/src/amd/compiler/aco_insert_waitcnt.cpp +++ b/src/amd/compiler/aco_insert_waitcnt.cpp @@ -260,7 +260,7 @@ struct target_info { unordered_events = event_smem | (gfx_level < GFX10 ? event_flat : 0); } - uint8_t get_counters_for_event(uint16_t event) const { return counters[ffs(event) - 1]; } + uint8_t get_counters_for_event(wait_event event) const { return counters[ffs(event) - 1]; } private: /* Bitfields of counters affected by each event */ @@ -388,7 +388,7 @@ check_instr(wait_ctx& ctx, wait_imm& wait, alu_delay_info& delay, Instruction* i /* Vector Memory reads and writes return in the order they were issued */ uint8_t vmem_type = get_vmem_type(ctx.gfx_level, instr); if (vmem_type) { - uint32_t event = get_vmem_event(ctx, instr, vmem_type); + wait_event event = get_vmem_event(ctx, instr, vmem_type); wait_type type = (wait_type)(ffs(ctx.info->get_counters_for_event(event)) - 1); if ((it->second.events & ctx.info->events[type]) == event && (type != wait_type_vm || it->second.vmem_types == vmem_type))