aco/ra: don't optimize encodings on precolor affinity mismatch
Totals from 238 (0.30% of 79839) affected shaders: (Navi48) Instrs: 137836 -> 137176 (-0.48%); split: -0.50%, +0.02% CodeSize: 728616 -> 728668 (+0.01%); split: -0.06%, +0.07% Latency: 1503248 -> 1500202 (-0.20%); split: -0.56%, +0.36% InvThroughput: 297725 -> 296715 (-0.34%); split: -0.70%, +0.36% Copies: 9390 -> 8825 (-6.02%); split: -6.33%, +0.31% VALU: 89861 -> 89296 (-0.63%); split: -0.66%, +0.03% SALU: 13166 -> 13167 (+0.01%); split: -0.05%, +0.06% Suggested-by: Georg Lehmann <dadschoorse@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36345>
This commit is contained in:
committed by
Marge Bot
parent
93606a19c6
commit
2ddd8ef0a3
@@ -3231,6 +3231,9 @@ optimize_encoding_vop2(ra_ctx& ctx, RegisterFile& register_file, aco_ptr<Instruc
|
||||
std::any_of(instr->operands.begin(), instr->operands.end(), [&](Operand op)
|
||||
{ return op.isKillBeforeDef() && op.physReg() == affinity.reg; })))
|
||||
return;
|
||||
} else if (ctx.assignments[def_id].precolor_affinity) {
|
||||
if (ctx.assignments[def_id].reg != instr->operands[2].physReg())
|
||||
return;
|
||||
}
|
||||
|
||||
if (!instr->operands[1].isOfType(RegType::vgpr))
|
||||
@@ -3276,11 +3279,14 @@ optimize_encoding_sopk(ra_ctx& ctx, RegisterFile& register_file, aco_ptr<Instruc
|
||||
unsigned def_id = instr->definitions[0].tempId();
|
||||
if (ctx.assignments[def_id].affinity) {
|
||||
assignment& affinity = ctx.assignments[ctx.assignments[def_id].affinity];
|
||||
if (affinity.assigned && affinity.reg != instr->operands[!literal_idx].physReg() &&
|
||||
if (affinity.assigned && affinity.reg != op_reg &&
|
||||
(!register_file.test(affinity.reg, instr->operands[!literal_idx].bytes()) ||
|
||||
std::any_of(instr->operands.begin(), instr->operands.end(), [&](Operand op)
|
||||
{ return op.isKillBeforeDef() && op.physReg() == affinity.reg; })))
|
||||
return;
|
||||
} else if (ctx.assignments[def_id].precolor_affinity) {
|
||||
if (ctx.assignments[def_id].reg != op_reg)
|
||||
return;
|
||||
}
|
||||
|
||||
instr->format = Format::SOPK;
|
||||
|
||||
Reference in New Issue
Block a user