Mesa (main): aco: Swap s_and operand order for ballot.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 16 14:48:33 UTC 2021


Module: Mesa
Branch: main
Commit: b12318f26c2440bed3cc0cc9261666d1253a05ba
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b12318f26c2440bed3cc0cc9261666d1253a05ba

Author: Timur Kristóf <timur.kristof at gmail.com>
Date:   Fri Jun 18 11:48:18 2021 +0200

aco: Swap s_and operand order for ballot.

This allows our optimizer to recognize this and eliminate it when
it can prove that the s_and with exec is unneeded.

Fossil DB changes on Sienna Cichlid:
Totals from 1969 (1.53% of 128647) affected shaders:
CodeSize: 9468228 -> 9469348 (+0.01%); split: -0.00%, +0.01%
Instrs: 1773566 -> 1773581 (+0.00%); split: -0.01%, +0.01%
Latency: 19504042 -> 19503385 (-0.00%); split: -0.00%, +0.00%
InvThroughput: 3617406 -> 3617333 (-0.00%)
Copies: 108998 -> 110592 (+1.46%)

Signed-off-by: Timur Kristóf <timur.kristof at gmail.com>
Reviewed-by: Daniel Schürmann <daniel at schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11458>

---

 src/amd/compiler/aco_instruction_selection.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index d5a48264ff8..3986850142d 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -8248,7 +8248,7 @@ visit_intrinsic(isel_context* ctx, nir_intrinsic_instr* instr)
 
       /* Make sure that all inactive lanes return zero.
        * Value-numbering might remove the comparison above */
-      src = bld.sop2(Builder::s_and, bld.def(bld.lm), bld.def(s1, scc), Operand(exec, bld.lm), src);
+      src = bld.sop2(Builder::s_and, bld.def(bld.lm), bld.def(s1, scc), src, Operand(exec, bld.lm));
       if (dst.size() != bld.lm.size()) {
          /* Wave32 with ballot size set to 64 */
          src =



More information about the mesa-commit mailing list