pan/midgard: Rewrite bidirectionally when eliminating moves

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: 20771ede1c ("pan/midgard: Add post-RA move elimination")

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
Alyssa Rosenzweig 2019-08-05 10:53:41 -07:00
parent 04a9951580
commit 2869758355
1 changed files with 2 additions and 3 deletions

View 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);