From f92a89a9798399e0641a319b543b426b0a2e9766 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Wed, 11 Dec 2019 16:10:26 +0000 Subject: [PATCH] aco: improve readfirstlane after uniform LDS loads Totals from affected shaders: SGPRS: 976 -> 968 (-0.82 %) VGPRS: 580 -> 584 (0.69 %) Spilled SGPRs: 0 -> 0 (0.00 %) Spilled VGPRs: 0 -> 0 (0.00 %) Code Size: 106032 -> 103076 (-2.79 %) bytes Max Waves: 237 -> 237 (0.00 %) Instructions: 19452 -> 18740 (-3.66 %) Signed-off-by: Rhys Perry Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 79a5376f4c0..8af2e5eadf0 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -2818,8 +2818,11 @@ void load_lds(isel_context *ctx, unsigned elem_size_bytes, Temp dst, return; } - if (dst.type() == RegType::sgpr) - res = bld.as_uniform(res); + if (dst.type() == RegType::sgpr) { + Temp new_res = bld.tmp(RegType::sgpr, res.size()); + expand_vector(ctx, res, new_res, res.size(), (1 << res.size()) - 1); + res = new_res; + } if (num_elements == 1) { result[result_size++] = res; -- 2.30.2