From e1c9b2a4553ab75e14caa53ebe0abc4ddbd14dae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Wed, 24 Apr 2024 11:55:58 +0200 Subject: [PATCH] aco/ra: assert that the register file is empty after register allocation completed Part-of: --- src/amd/compiler/aco_register_allocation.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index 452a7421ffd..47fefded1e5 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -3333,9 +3333,12 @@ register_allocation(Program* program, live& live_vars, ra_test_policy policy) if ((block.kind & block_kind_top_level) && block.linear_succs.empty()) { /* Reset this for block_kind_resume. */ - ASSERTED PhysRegInterval linear_vgpr_bounds = get_reg_bounds(ctx, RegType::vgpr, true); - assert(register_file.count_zero(linear_vgpr_bounds) == linear_vgpr_bounds.size); ctx.num_linear_vgprs = 0; + + ASSERTED PhysRegInterval vgpr_bounds = get_reg_bounds(ctx, RegType::vgpr, false); + ASSERTED PhysRegInterval sgpr_bounds = get_reg_bounds(ctx, RegType::sgpr, false); + assert(register_file.count_zero(vgpr_bounds) == ctx.vgpr_bounds); + assert(register_file.count_zero(sgpr_bounds) == ctx.sgpr_bounds); } else if (should_compact_linear_vgprs(ctx, live_vars, register_file)) { aco_ptr br = std::move(instructions.back()); instructions.pop_back();