From b45a39c44bef8296d14ecc39c92b83d64db3f209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Tue, 10 Aug 2021 18:06:58 +0200 Subject: [PATCH] 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 Part-of: --- 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: