agx: trust in agx_index size
validated. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
This commit is contained in:
@@ -63,7 +63,7 @@ agx_insert_waits_local(agx_context *ctx, agx_block *block)
|
||||
if (I->src[s].type != AGX_INDEX_REGISTER)
|
||||
continue;
|
||||
|
||||
unsigned nr_read = agx_read_registers(I, s);
|
||||
unsigned nr_read = agx_index_size_16(I->src[s]);
|
||||
for (unsigned slot = 0; slot < ARRAY_SIZE(slots); ++slot) {
|
||||
if (BITSET_TEST_RANGE(slots[slot].writes, I->src[s].value,
|
||||
I->src[s].value + nr_read - 1))
|
||||
@@ -76,7 +76,7 @@ agx_insert_waits_local(agx_context *ctx, agx_block *block)
|
||||
if (I->dest[d].type != AGX_INDEX_REGISTER)
|
||||
continue;
|
||||
|
||||
unsigned nr_writes = agx_write_registers(I, d);
|
||||
unsigned nr_writes = agx_index_size_16(I->dest[d]);
|
||||
for (unsigned slot = 0; slot < ARRAY_SIZE(slots); ++slot) {
|
||||
if (BITSET_TEST_RANGE(slots[slot].writes, I->dest[d].value,
|
||||
I->dest[d].value + nr_writes - 1))
|
||||
@@ -125,8 +125,9 @@ agx_insert_waits_local(agx_context *ctx, agx_block *block)
|
||||
continue;
|
||||
|
||||
assert(I->dest[d].type == AGX_INDEX_REGISTER);
|
||||
BITSET_SET_RANGE(slots[I->scoreboard].writes, I->dest[d].value,
|
||||
I->dest[d].value + agx_write_registers(I, d) - 1);
|
||||
BITSET_SET_RANGE(
|
||||
slots[I->scoreboard].writes, I->dest[d].value,
|
||||
I->dest[d].value + agx_index_size_16(I->dest[d]) - 1);
|
||||
}
|
||||
|
||||
slots[I->scoreboard].nr_pending++;
|
||||
|
@@ -128,7 +128,7 @@ calculate_pressure_delta(agx_instr *I, BITSET_WORD *live)
|
||||
/* Destinations must be unique */
|
||||
agx_foreach_ssa_dest(I, d) {
|
||||
if (BITSET_TEST(live, I->dest[d].value))
|
||||
delta -= agx_write_registers(I, d);
|
||||
delta -= agx_index_size_16(I->dest[d]);
|
||||
}
|
||||
|
||||
agx_foreach_ssa_src(I, src) {
|
||||
@@ -143,7 +143,7 @@ calculate_pressure_delta(agx_instr *I, BITSET_WORD *live)
|
||||
}
|
||||
|
||||
if (!dupe && !BITSET_TEST(live, I->src[src].value))
|
||||
delta += agx_read_registers(I, src);
|
||||
delta += agx_index_size_16(I->src[src]);
|
||||
}
|
||||
|
||||
return delta;
|
||||
|
@@ -1127,7 +1127,7 @@ agx_ra(agx_context *ctx)
|
||||
unsigned v = I->dest[d].value;
|
||||
assert(ncomps[v] == 0 && "broken SSA");
|
||||
/* Round up vectors for easier live range splitting */
|
||||
ncomps[v] = util_next_power_of_two(agx_write_registers(I, d));
|
||||
ncomps[v] = util_next_power_of_two(agx_index_size_16(I->dest[d]));
|
||||
sizes[v] = I->dest[d].size;
|
||||
|
||||
max_ncomps = MAX2(max_ncomps, ncomps[v]);
|
||||
|
Reference in New Issue
Block a user