From 38cff03e58b4ae2f7b8275e429cde1c355ab1b07 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Tue, 27 Jun 2023 19:22:42 +0100 Subject: [PATCH] radv: use nir_lower_conv64 This has a more accurate i2f/u2f implementation. fossil-db (navi21): Totals from 342 (0.26% of 133461) affected shaders: MaxWaves: 10480 -> 10472 (-0.08%) Instrs: 273455 -> 274019 (+0.21%); split: -0.02%, +0.22% CodeSize: 1545020 -> 1546852 (+0.12%); split: -0.11%, +0.23% VGPRs: 9528 -> 9552 (+0.25%) SpillSGPRs: 553 -> 592 (+7.05%); split: -2.71%, +9.76% SpillVGPRs: 821 -> 811 (-1.22%); split: -1.71%, +0.49% Latency: 3837590 -> 3822989 (-0.38%); split: -0.52%, +0.14% InvThroughput: 1284512 -> 1277012 (-0.58%); split: -0.77%, +0.19% VClause: 6480 -> 6486 (+0.09%); split: -0.15%, +0.25% SClause: 6640 -> 6645 (+0.08%); split: -0.02%, +0.09% Copies: 45858 -> 46160 (+0.66%); split: -0.10%, +0.76% Branches: 8736 -> 8741 (+0.06%); split: -0.01%, +0.07% PreSGPRs: 14320 -> 14323 (+0.02%) PreVGPRs: 8545 -> 8551 (+0.07%) Signed-off-by: Rhys Perry Reviewed-by: Georg Lehmann Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9275 Part-of: --- src/amd/vulkan/radv_shader.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index ca8abdf0354..10ee584e8c1 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -111,10 +111,8 @@ get_nir_options_for_stage(struct radv_physical_device *device, gl_shader_stage s .max_unroll_iterations_aggressive = 128, .use_interpolated_input_intrinsics = true, .vectorize_vec2_16bit = true, - /* nir_lower_int64() isn't actually called for the LLVM backend, - * but this helps the loop unrolling heuristics. */ .lower_int64_options = nir_lower_imul64 | nir_lower_imul_high64 | nir_lower_imul_2x32_64 | nir_lower_divmod64 | - nir_lower_minmax64 | nir_lower_iabs64 | nir_lower_iadd_sat64, + nir_lower_minmax64 | nir_lower_iabs64 | nir_lower_iadd_sat64 | nir_lower_conv64, .lower_doubles_options = nir_lower_drcp | nir_lower_dsqrt | nir_lower_drsq | nir_lower_ddiv, .divergence_analysis_options = nir_divergence_view_index_uniform, .optimize_quad_vote_to_reduce = true,