diff options
author | Rhys Perry <[email protected]> | 2019-11-20 19:09:25 +0000 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-01-14 12:56:28 +0000 |
commit | c240c1aecfdf46f6bb9b0956df6f4ab8a609dfdf (patch) | |
tree | 5264815caa8963c2466244eef3c827460e838d8d /src/amd/compiler | |
parent | 8f10e48745e730137d1231a6b6754d2efe803247 (diff) |
aco: apply literals to split mads
Removing the return is also needed to apply literals to mads (which can be
done on GFX10).
pipeline-db (Navi):
Totals from affected shaders:
SGPRS: 368787 -> 367555 (-0.33 %)
VGPRS: 312436 -> 312448 (0.00 %)
Spilled SGPRs: 461 -> 461 (0.00 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Code Size: 26113388 -> 26098260 (-0.06 %) bytes
Max Waves: 35982 -> 35982 (0.00 %)
Instructions: 5038670 -> 5028941 (-0.19 %)
pipeline-db (Vega):
Totals from affected shaders:
SGPRS: 369843 -> 368659 (-0.32 %)
VGPRS: 317224 -> 317196 (-0.01 %)
Spilled SGPRs: 629 -> 629 (0.00 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Code Size: 26310540 -> 26295156 (-0.06 %) bytes
Max Waves: 36324 -> 36326 (0.01 %)
Instructions: 5073957 -> 5064164 (-0.19 %)
Signed-off-by: Rhys Perry <[email protected]>
Reviewed-by: Daniel Schürmann <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2883>
Diffstat (limited to 'src/amd/compiler')
-rw-r--r-- | src/amd/compiler/aco_optimizer.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 8e4d4d6d9c0..e7a2da1bcb1 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -2301,6 +2301,10 @@ void select_instruction(opt_ctx &ctx, aco_ptr<Instruction>& instr) /* first, check profitability */ if (ctx.uses[info->mul_temp_id]) { ctx.uses[info->mul_temp_id]++; + if (instr->operands[0].isTemp()) + ctx.uses[instr->operands[0].tempId()]--; + if (instr->operands[1].isTemp()) + ctx.uses[instr->operands[1].tempId()]--; instr.swap(info->add_instr); /* second, check possible literals */ @@ -2333,7 +2337,6 @@ void select_instruction(opt_ctx &ctx, aco_ptr<Instruction>& instr) info->literal_idx = literal_idx; } } - return; } /* check for literals */ |