From d5a2666ad9b7ab2989e2bc5fce1f99c377a718f3 Mon Sep 17 00:00:00 2001 From: Natalie Vock Date: Thu, 2 May 2024 17:28:15 +0200 Subject: [PATCH] aco/ra: Assert operands only clear their own id This is useful for debugging register assignment, as this case would usually result in RA silently assigning the same register to multiple temps at the same time. Part-of: --- src/amd/compiler/aco_register_allocation.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index fbee1dbfa01..d361f64705a 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -367,7 +367,12 @@ public: } } - void clear(Operand op) { clear(op.physReg(), op.regClass()); } + void clear(Operand op) + { + if (op.isTemp() && !is_empty_or_blocked(op.physReg())) + assert(get_id(op.physReg()) == op.tempId()); + clear(op.physReg(), op.regClass()); + } void fill(Definition def) {