/* 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);
}