Mesa (master): aco: allow SGPRs on every src position for VOP3P
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Jan 13 18:03:29 UTC 2021
Module: Mesa
Branch: master
Commit: 178b33c87089ddec0df1e7adac9bf4630974439f
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=178b33c87089ddec0df1e7adac9bf4630974439f
Author: Daniel Schürmann <daniel at schuermann.dev>
Date: Fri Jan 8 23:14:16 2021 +0100
aco: allow SGPRs on every src position for VOP3P
Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6680>
---
src/amd/compiler/aco_optimizer.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp
index deebff042f4..c986c6f69e7 100644
--- a/src/amd/compiler/aco_optimizer.cpp
+++ b/src/amd/compiler/aco_optimizer.cpp
@@ -2524,7 +2524,8 @@ void apply_sgprs(opt_ctx &ctx, aco_ptr<Instruction>& instr)
/* Applying two sgprs require making it VOP3, so don't do it unless it's
* definitively beneficial.
* TODO: this is too conservative because later the use count could be reduced to 1 */
- if (num_sgprs && ctx.uses[sgpr_info_id] > 1 && !instr->isVOP3() && !instr->isSDWA())
+ if (num_sgprs && ctx.uses[sgpr_info_id] > 1 &&
+ !instr->isVOP3() && !instr->isSDWA() && instr->format != Format::VOP3P)
break;
Temp sgpr = ctx.info[sgpr_info_id].temp;
@@ -2532,7 +2533,8 @@ void apply_sgprs(opt_ctx &ctx, aco_ptr<Instruction>& instr)
if (new_sgpr && num_sgprs >= max_sgprs)
continue;
- if (sgpr_idx == 0 || instr->isVOP3() || instr->isSDWA()) {
+ if (sgpr_idx == 0 || instr->isVOP3() ||
+ instr->isSDWA() || instr->format == Format::VOP3P) {
instr->operands[sgpr_idx] = Operand(sgpr);
} else if (can_swap_operands(instr)) {
instr->operands[sgpr_idx] = instr->operands[0];
More information about the mesa-commit
mailing list