From 5326e033ff668b91d28c50e04d9048c028812f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Mon, 13 May 2024 15:49:49 +0200 Subject: [PATCH] aco/ra: fix handling of killed operands in compact_relocate_vars() Found by inspection. Part-of: --- src/amd/compiler/aco_register_allocation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index dcedb16b311..a6631b02dbb 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -1851,7 +1851,7 @@ get_reg(ra_ctx& ctx, const RegisterFile& reg_file, Temp temp, unsigned killed_op_size = 0; for (Operand op : instr->operands) { - if (op.isTemp() && op.isKillBeforeDef() && op.regClass().type() == info.rc.type()) + if (op.isTemp() && op.isFirstKillBeforeDef() && op.regClass().type() == info.rc.type()) killed_op_size += op.regClass().size(); } @@ -1868,7 +1868,7 @@ get_reg(ra_ctx& ctx, const RegisterFile& reg_file, Temp temp, /* reallocate killed operands */ std::vector killed_op_vars; for (Operand op : instr->operands) { - if (op.isKillBeforeDef() && op.regClass().type() == info.rc.type()) + if (op.isFirstKillBeforeDef() && op.regClass().type() == info.rc.type()) killed_op_vars.emplace_back(op.tempId(), op.regClass()); } compact_relocate_vars(ctx, killed_op_vars, parallelcopies, space);