From b2a95d213307a423f119dedeec92f9f9f9a68ef4 Mon Sep 17 00:00:00 2001 From: Natalie Vock Date: Mon, 14 Apr 2025 23:03:11 +0200 Subject: [PATCH] aco/ra: Add affinities for DS vector-aligned operands Part-of: --- src/amd/compiler/aco_register_allocation.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index 2ebd2063cd5..7c6d8835803 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -3036,6 +3036,14 @@ get_affinities(ra_ctx& ctx) ctx.assignments[instr->operands[0].tempId()].vcc = true; } else if (instr->opcode == aco_opcode::s_sendmsg) { ctx.assignments[instr->operands[0].tempId()].m0 = true; + } else if (instr->format == Format::DS) { + bool is_vector = false; + for (unsigned i = 0, vector_begin = 0; i < instr->operands.size(); i++) { + if (is_vector || instr->operands[i].isVectorAligned()) + ctx.vectors[instr->operands[i].tempId()] = vector_info(instr.get(), vector_begin); + is_vector = instr->operands[i].isVectorAligned(); + vector_begin = is_vector ? vector_begin : i + 1; + } } auto tied_defs = get_tied_defs(instr.get());