r600/sfn: Make 3vec loads skip possible moves
authorGert Wollny <gert.wollny@collabora.com>
Wed, 6 May 2020 21:58:25 +0000 (23:58 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 19 May 2020 07:52:13 +0000 (07:52 +0000)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5085>

src/gallium/drivers/r600/sfn/sfn_shader_compute.cpp

index 2351a7fc50b129443fcb635952caacc4d4b74200..2d458ad838cf42949ffb08e00b2aac3d33cfc52e 100644 (file)
@@ -79,12 +79,8 @@ bool ComputeShaderFromNir::emit_intrinsic_instruction_override(nir_intrinsic_ins
 bool ComputeShaderFromNir::emit_load_3vec(nir_intrinsic_instr* instr,
                                           const std::array<PValue,3>& src)
 {
-   AluInstruction *ir = nullptr;
-   for (int i = 0; i < 3; ++i) {
-      ir = new AluInstruction(op1_mov, from_nir(instr->dest, i), src[i], {alu_write});
-      emit_instruction(ir);
-   }
-   ir->set_flag(alu_last_instr);
+   for (int i = 0; i < 3; ++i)
+      load_preloaded_value(instr->dest, i, src[i], i == 2);
    return true;
 }