pan/midgard: Rewrite bidirectionally when eliminating moves
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 5 Aug 2019 17:53:41 +0000 (10:53 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 5 Aug 2019 17:58:39 +0000 (10:58 -0700)
Symptom: the sky is black in SuperTuxKart (flashbacks to SMB/NES
emulation intensify).

Essentially, what happened is a fixed (special) move to r0 was
eliminated but scheduling did not factor this in, so
can_run_concurrent_ssa returned true even when there was a logical data
dependency that needed to be resolved.

Fixes: 20771ede1c0 ("pan/midgard: Add post-RA move elimination")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/midgard/midgard_opt_dce.c

index 28f0886fe318ba0bedb1e9b687e00b82757fe57b..9964675763c2bf705f3f13d525aede19c9315fcf 100644 (file)
@@ -123,9 +123,8 @@ midgard_opt_post_move_eliminate(compiler_context *ctx, midgard_block *block, str
                 if (mir_nontrivial_outmod(ins)) continue;
                 if (ins->mask != 0xF) continue;
 
-                /* We do want to rewrite to keep the graph sane for pipeline
-                 * register creation (TODO: is this the best approach?) */
-                mir_rewrite_index_dst(ctx, ins->ssa_args.src[1], ins->ssa_args.dest);
+                /* We do need to rewrite to facilitate pipelining/scheduling */
+                mir_rewrite_index(ctx, ins->ssa_args.src[1], ins->ssa_args.dest);
 
                 /* We're good to go */
                 mir_remove_instruction(ins);