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 <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15408>
This commit is contained in:
Daniel Schürmann 2022-03-16 10:59:52 +01:00 committed by Marge Bot
parent 08f3950d6b
commit 44fb9ba84a
2 changed files with 2 additions and 2 deletions

View File

@ -421,7 +421,7 @@ live_var_analysis(Program* program)
std::vector<PhiInfo> 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 */

View File

@ -1398,7 +1398,7 @@ get_reg_specified(ra_ctx& ctx, RegisterFile& reg_file, RegClass rc, aco_ptr<Inst
PhysRegInterval bounds = get_reg_bounds(ctx.program, rc.type());
PhysRegInterval vcc_win = {vcc, 2};
/* VCC is outside the bounds */
bool is_vcc = rc.type() == RegType::sgpr && vcc_win.contains(reg_win);
bool is_vcc = rc.type() == RegType::sgpr && vcc_win.contains(reg_win) && ctx.program->needs_vcc;
bool is_m0 = rc == s1 && reg == m0;
if (!bounds.contains(reg_win) && !is_vcc && !is_m0)
return false;