From 44fb9ba84ac1048bd045b147546a2731962ea458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Wed, 16 Mar 2022 10:59:52 +0100 Subject: [PATCH] aco/ra: only use VCC if program->needs_vcc == true A future commit will make VCC register assignment independent from register hints. Up to GFX9, VCC can alternatively be used as regular SGPR, so prevent overlap. Reviewed-by: Rhys Perry Part-of: --- src/amd/compiler/aco_live_var_analysis.cpp | 2 +- src/amd/compiler/aco_register_allocation.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_live_var_analysis.cpp b/src/amd/compiler/aco_live_var_analysis.cpp index 48456fc0df8..abe839642af 100644 --- a/src/amd/compiler/aco_live_var_analysis.cpp +++ b/src/amd/compiler/aco_live_var_analysis.cpp @@ -421,7 +421,7 @@ live_var_analysis(Program* program) std::vector phi_info(program->blocks.size()); RegisterDemand new_demand; - program->needs_vcc = false; + program->needs_vcc = program->chip_class >= GFX10; /* this implementation assumes that the block idx corresponds to the block's position in * program->blocks vector */ diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index 41c36603608..0204f934bb3 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -1398,7 +1398,7 @@ get_reg_specified(ra_ctx& ctx, RegisterFile& reg_file, RegClass rc, aco_ptrneeds_vcc; bool is_m0 = rc == s1 && reg == m0; if (!bounds.contains(reg_win) && !is_vcc && !is_m0) return false;