Mesa (main): radv: vectorize nir_op_fdiv & nir_op_flrp & nir_op_ineg

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 27 15:30:53 UTC 2022


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

Author: Daniel Schürmann <daniel at schuermann.dev>
Date:   Tue Aug 10 18:06:58 2021 +0200

radv: vectorize nir_op_fdiv & nir_op_flrp & nir_op_ineg

These instructions are lowered to fmul/isub.
So, prevent scalarization.

Totals from 49 (0.04% of 134913) affected shaders: (GFX10.3)
VGPRs: 2576 -> 2568 (-0.31%)
SpillVGPRs: 1145 -> 1132 (-1.14%); split: -2.10%, +0.96%
CodeSize: 663968 -> 659376 (-0.69%); split: -1.08%, +0.38%
Scratch: 113664 -> 112640 (-0.90%)
Instrs: 110274 -> 109683 (-0.54%); split: -0.81%, +0.27%
Latency: 2904434 -> 2869588 (-1.20%); split: -1.64%, +0.44%
InvThroughput: 1414237 -> 1396600 (-1.25%); split: -1.69%, +0.44%
VClause: 2899 -> 2891 (-0.28%); split: -0.93%, +0.66%
SClause: 1520 -> 1537 (+1.12%); split: -0.07%, +1.18%
Copies: 28829 -> 28662 (-0.58%); split: -1.90%, +1.32%
Branches: 3560 -> 3564 (+0.11%)
PreVGPRs: 2550 -> 2427 (-4.82%)

Reviewed-by: Georg Lehmann <dadschoorse at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15176>

---

 src/amd/vulkan/radv_pipeline.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index 85f02742cc0..ebe72c11c02 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -4070,6 +4070,8 @@ opt_vectorize_callback(const nir_instr *instr, const void *_)
    case nir_op_fsub:
    case nir_op_fmul:
    case nir_op_ffma:
+   case nir_op_fdiv:
+   case nir_op_flrp:
    case nir_op_fneg:
    case nir_op_fsat:
    case nir_op_fmin:
@@ -4080,6 +4082,7 @@ opt_vectorize_callback(const nir_instr *instr, const void *_)
    case nir_op_isub:
    case nir_op_isub_sat:
    case nir_op_usub_sat:
+   case nir_op_ineg:
    case nir_op_imul:
    case nir_op_imin:
    case nir_op_imax:



More information about the mesa-commit mailing list