From 8259c97b2d0328d002b8d266ec00c8f03c5e9b3a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Sch=C3=BCrmann?= Date: Thu, 5 Dec 2019 19:27:16 +0100 Subject: [PATCH] aco: propagate temporaries into expanded vectors Gives a very slight decrease in code size: Totals from affected shaders: Code Size: 1708488 -> 1702768 (-0.33 %) bytes Max Waves: 2858 -> 2855 (-0.10 %) Reviewed-by: Rhys Perry --- src/amd/compiler/aco_optimizer.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 66f4db8ce07..ceecc0f34e4 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -777,8 +777,13 @@ void label_instruction(opt_ctx &ctx, Block& block, aco_ptr& instr) unsigned k = 0; for (Operand& old_op : old_vec->operands) { if (old_op.isTemp() && ctx.info[old_op.tempId()].is_vec()) { - for (unsigned j = 0; j < ctx.info[old_op.tempId()].instr->operands.size(); j++) - instr->operands[k++] = ctx.info[old_op.tempId()].instr->operands[j]; + for (unsigned j = 0; j < ctx.info[old_op.tempId()].instr->operands.size(); j++) { + Operand op = ctx.info[old_op.tempId()].instr->operands[j]; + if (op.isTemp() && ctx.info[op.tempId()].is_temp() && + ctx.info[op.tempId()].temp.type() == instr->definitions[0].regClass().type()) + op.setTemp(ctx.info[op.tempId()].temp); + instr->operands[k++] = op; + } } else { instr->operands[k++] = old_op; } -- 2.30.2