Mesa (master): aco: use p_as_uniform for get_sampler_desc and convert_pointer_to_64_bit

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Feb 26 14:22:53 UTC 2021


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

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Fri Feb 26 09:45:07 2021 +0000

aco: use p_as_uniform for get_sampler_desc and convert_pointer_to_64_bit

Since value-numbering no longer works across loops, we no longer need to
use v_readfirstlane_b32.

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Daniel Schürmann <daniel at schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9288>

---

 src/amd/compiler/aco_instruction_selection.cpp | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index 2422d46177f..2fcfdaa2b11 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -736,10 +736,8 @@ Temp convert_pointer_to_64_bit(isel_context *ctx, Temp ptr, bool non_uniform=fal
    if (ptr.size() == 2)
       return ptr;
    Builder bld(ctx->program, ctx->block);
-   if (ptr.type() == RegType::vgpr && !non_uniform) {
-      ptr = bld.vop1(aco_opcode::v_readfirstlane_b32, bld.def(s1), ptr);
-      ptr = emit_wqm(bld, ptr);
-   }
+   if (ptr.type() == RegType::vgpr && !non_uniform)
+      ptr = bld.as_uniform(ptr);
    return bld.pseudo(aco_opcode::p_create_vector, bld.def(RegClass(ptr.type(), 2)),
                      ptr, Operand((unsigned)ctx->options->address32_hi));
 }
@@ -5698,10 +5696,8 @@ Temp get_sampler_desc(isel_context *ctx, nir_deref_instr *deref_instr,
             constant_index += array_size * const_value->u32;
          } else {
             Temp indirect = get_ssa_temp(ctx, deref_instr->arr.index.ssa);
-            if (indirect.type() == RegType::vgpr) {
-               indirect = bld.vop1(aco_opcode::v_readfirstlane_b32, bld.def(s1), indirect);
-               indirect = emit_wqm(bld, indirect);
-            }
+            if (indirect.type() == RegType::vgpr)
+               indirect = bld.as_uniform(indirect);
 
             if (array_size != 1)
                indirect = bld.sop2(aco_opcode::s_mul_i32, bld.def(s1), Operand(array_size), indirect);



More information about the mesa-commit mailing list