aco/ra: only create phi-affinities for killed operands

If a phi-operand is not killed, it must be copied anyway.
The additional affinity would only overwrite any potential
better affinity that was already created

Totals from 1067 (0.71% of 149839) affected shaders (GFX10.3):
VGPRs: 68072 -> 68064 (-0.01%)
CodeSize: 8252588 -> 8245220 (-0.09%); split: -0.12%, +0.03%
Instrs: 1596146 -> 1593941 (-0.14%); split: -0.16%, +0.02%
Latency: 18828176 -> 18823914 (-0.02%); split: -0.08%, +0.06%
InvThroughput: 3575063 -> 3574787 (-0.01%); split: -0.05%, +0.04%
VClause: 24345 -> 24325 (-0.08%); split: -0.16%, +0.07%
Copies: 88712 -> 87398 (-1.48%); split: -1.77%, +0.29%
Branches: 52067 -> 51364 (-1.35%); split: -1.38%, +0.03%

Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8764>
This commit is contained in:
Daniel Schürmann 2021-01-28 16:52:28 +01:00
parent 6e2d8ab808
commit 3a98f484d1

View file

@ -2055,7 +2055,7 @@ void get_affinities(ra_ctx& ctx, std::vector<IDSet>& live_out_per_block)
affinity_related.emplace_back(instr->definitions[0].getTemp());
affinity_related.emplace_back(instr->definitions[0].getTemp());
for (const Operand& op : instr->operands) {
if (op.isTemp() && op.regClass() == instr->definitions[0].regClass()) {
if (op.isTemp() && op.isKill() && op.regClass() == instr->definitions[0].regClass()) {
affinity_related.emplace_back(op.getTemp());
temp_to_phi_ressources[op.tempId()] = phi_ressources.size();
}