Mesa (main): aco: use VOPC_SDWA on GFX9+
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Aug 23 10:48:49 UTC 2021
Module: Mesa
Branch: main
Commit: 3d6ca41e44d5fcf9310f802cd486bd43b40ac258
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3d6ca41e44d5fcf9310f802cd486bd43b40ac258
Author: Daniel Schürmann <daniel at schuermann.dev>
Date: Wed Jul 7 11:37:49 2021 +0200
aco: use VOPC_SDWA on GFX9+
Totals from 5138 (3.42% of 150170) affected shaders: (GFX10.3)
VGPRs: 409520 -> 409416 (-0.03%); split: -0.03%, +0.00%
CodeSize: 43056360 -> 43035696 (-0.05%); split: -0.06%, +0.02%
MaxWaves: 69296 -> 69310 (+0.02%)
Instrs: 8161016 -> 8153365 (-0.09%); split: -0.10%, +0.01%
Latency: 109397002 -> 109756208 (+0.33%); split: -0.05%, +0.38%
InvThroughput: 23238920 -> 23310761 (+0.31%); split: -0.11%, +0.42%
VClause: 135141 -> 135100 (-0.03%); split: -0.05%, +0.02%
SClause: 349511 -> 349489 (-0.01%); split: -0.01%, +0.00%
Copies: 388107 -> 387754 (-0.09%); split: -0.48%, +0.38%
Branches: 184629 -> 184503 (-0.07%); split: -0.08%, +0.01%
PreSGPRs: 258807 -> 258839 (+0.01%)
PreVGPRs: 372561 -> 372184 (-0.10%); split: -0.10%, +0.00%
Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12364>
---
src/amd/compiler/aco_ir.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/amd/compiler/aco_ir.cpp b/src/amd/compiler/aco_ir.cpp
index b30ec36a073..61cf3c2c43c 100644
--- a/src/amd/compiler/aco_ir.cpp
+++ b/src/amd/compiler/aco_ir.cpp
@@ -197,7 +197,7 @@ can_use_SDWA(chip_class chip, const aco_ptr<Instruction>& instr, bool pre_ra)
VOP3_instruction& vop3 = instr->vop3();
if (instr->format == Format::VOP3)
return false;
- if (vop3.clamp && instr->format == asVOP3(Format::VOPC) && chip != GFX8)
+ if (vop3.clamp && instr->isVOPC() && chip != GFX8)
return false;
if (vop3.omod && chip < GFX9)
return false;
@@ -214,7 +214,7 @@ can_use_SDWA(chip_class chip, const aco_ptr<Instruction>& instr, bool pre_ra)
}
}
- if (!instr->definitions.empty() && instr->definitions[0].bytes() > 4)
+ if (!instr->definitions.empty() && instr->definitions[0].bytes() > 4 && !instr->isVOPC())
return false;
if (!instr->operands.empty()) {
@@ -235,7 +235,7 @@ can_use_SDWA(chip_class chip, const aco_ptr<Instruction>& instr, bool pre_ra)
return false;
// TODO: return true if we know we will use vcc
- if (!pre_ra && instr->isVOPC())
+ if (!pre_ra && instr->isVOPC() && chip == GFX8)
return false;
if (!pre_ra && instr->operands.size() >= 3 && !is_mac)
return false;
More information about the mesa-commit
mailing list