broadcom/compiler: drop spill_count and add spilling boolean

We added spill_count to handle uniform batch spills, which we no longer do.
What we want now is a way to know if we are spilling registers.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15041>
This commit is contained in:
Iago Toral Quiroga
2022-02-17 08:53:54 +01:00
committed by Marge Bot
parent f3c3228522
commit 8883975209
3 changed files with 9 additions and 7 deletions

View File

@@ -4507,7 +4507,6 @@ v3d_nir_to_vir(struct v3d_compile *c)
return;
}
c->spill_count = 0;
c->spills = 0;
c->fills = 0;
c->threads /= 2;

View File

@@ -789,6 +789,12 @@ struct v3d_compile {
uint32_t spill_size;
/* Shader-db stats */
uint32_t spills, fills, loops;
/* Whether we are in the process of spilling registers for
* register allocation
*/
bool spilling;
/**
* Register spilling's per-thread base address, shared between each
* spill/fill's addressing calculations.
@@ -881,9 +887,6 @@ struct v3d_compile {
bool emitted_tlb_load;
bool lock_scoreboard_on_first_thrsw;
/* Total number of spilled registers in the program */
uint32_t spill_count;
enum v3d_compilation_result compilation_result;
bool tmu_dirty_rcl;

View File

@@ -278,7 +278,7 @@ v3d_setup_spill_base(struct v3d_compile *c)
* accumulator because it is used for TMU spill/fill and thus
* needs to persist across thread switches.
*/
if (c->spill_count > 0) {
if (c->spilling) {
int temp_class = CLASS_BITS_PHYS;
if (i != c->spill_base.index)
temp_class |= CLASS_BITS_ACC;
@@ -415,8 +415,7 @@ static void
v3d_spill_reg(struct v3d_compile *c, int *acc_nodes, int spill_temp)
{
int start_num_temps = c->num_temps;
c->spill_count++;
c->spilling = true;
bool is_uniform = vir_is_mov_uniform(c, spill_temp);
@@ -615,6 +614,7 @@ v3d_spill_reg(struct v3d_compile *c, int *acc_nodes, int spill_temp)
}
c->disable_ldunif_opt = had_disable_ldunif_opt;
c->spilling = false;
}
struct v3d_ra_select_callback_data {