aco: require linear vgpr uses to be late kill

This also removes some linear VGPR tests which will be replaced soon
anyway.

fossil-db (navi31):
Totals from 107 (0.14% of 79242) affected shaders:
Instrs: 66203 -> 66211 (+0.01%); split: -0.09%, +0.10%
CodeSize: 354644 -> 354588 (-0.02%); split: -0.08%, +0.07%
VGPRs: 4476 -> 4452 (-0.54%); split: -0.80%, +0.27%
Latency: 513863 -> 513877 (+0.00%); split: -0.08%, +0.08%
InvThroughput: 68871 -> 68870 (-0.00%); split: -0.02%, +0.02%
SClause: 1589 -> 1590 (+0.06%)
PreVGPRs: 3404 -> 3415 (+0.32%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27697>
This commit is contained in:
Rhys Perry
2024-01-31 18:44:21 +00:00
committed by Marge Bot
parent 5e17a39b15
commit 07eab4ab40
7 changed files with 59 additions and 136 deletions
@@ -6095,8 +6095,11 @@ emit_mimg(Builder& bld, aco_opcode op, Temp dst, Temp rsrc, Operand samp, std::v
mimg->operands[0] = Operand(rsrc);
mimg->operands[1] = samp;
mimg->operands[2] = vdata;
for (unsigned i = 0; i < coords.size(); i++)
for (unsigned i = 0; i < coords.size(); i++) {
mimg->operands[3 + i] = Operand(coords[i]);
if (coords[i].regClass().is_linear_vgpr())
mimg->operands[3 + i].setLateKill(true);
}
mimg->strict_wqm = strict_wqm;
MIMG_instruction* res = mimg.get();
@@ -10320,8 +10323,11 @@ visit_block(isel_context* ctx, nir_block* block)
{
if (ctx->block->kind & block_kind_top_level) {
Builder bld(ctx->program, ctx->block);
for (Temp tmp : ctx->unended_linear_vgprs)
bld.pseudo(aco_opcode::p_end_linear_vgpr, tmp);
for (Temp tmp : ctx->unended_linear_vgprs) {
Operand op(tmp);
op.setLateKill(true);
bld.pseudo(aco_opcode::p_end_linear_vgpr, op);
}
ctx->unended_linear_vgprs.clear();
}