aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2019-07-19 22:51:51 (GMT)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2019-07-22 15:20:34 (GMT)
commitbc741599f24dee49937fe397073dc7c4c8230399 (patch)
treefa1907f03084a596c19667518f20cb13d990e52e
parent40abf117085fe20d2eb10cc8297e57c00340d1e6 (diff)
downloadexternal_mesa3d-bc741599f24dee49937fe397073dc7c4c8230399.zip
external_mesa3d-bc741599f24dee49937fe397073dc7c4c8230399.tar.gz
external_mesa3d-bc741599f24dee49937fe397073dc7c4c8230399.tar.bz2
panfrost/midgard: Promote to *move*, not rewrite for non-SSA
Fixes promoted uniform loads to registers. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
-rw-r--r--src/panfrost/midgard/mir_promote_uniforms.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/panfrost/midgard/mir_promote_uniforms.c b/src/panfrost/midgard/mir_promote_uniforms.c
index 7206cb7..227b943 100644
--- a/src/panfrost/midgard/mir_promote_uniforms.c
+++ b/src/panfrost/midgard/mir_promote_uniforms.c
@@ -67,9 +67,16 @@ midgard_promote_uniforms(compiler_context *ctx, unsigned register_pressure)
/* It is, great! Let's promote */
ctx->uniform_cutoff = MAX2(ctx->uniform_cutoff, address + 1);
-
unsigned promoted = SSA_FIXED_REGISTER(uniform_reg);
- mir_rewrite_index_src(ctx, ins->ssa_args.dest, promoted);
+
+ /* We do need the move for safety for a non-SSA dest */
+
+ if (ins->ssa_args.dest >= ctx->func->impl->ssa_alloc) {
+ midgard_instruction mov = v_mov(promoted, blank_alu_src, ins->ssa_args.dest);
+ mir_insert_instruction_before(ins, mov);
+ } else {
+ mir_rewrite_index_src(ctx, ins->ssa_args.dest, promoted);
+ }
mir_remove_instruction(ins);
}