summaryrefslogtreecommitdiffstats
path: root/src/panfrost/midgard
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-12-06 17:11:44 -0500
committerAlyssa Rosenzweig <[email protected]>2019-12-12 11:42:07 -0500
commit05b839f3545b5bf8a4c22ee6db0ad66d2b6bbc16 (patch)
treee6e888c0927f2114243cd475b4b332601cdbd28b /src/panfrost/midgard
parent4308d752811310689bbe71cba35b4357fa7efb0f (diff)
pan/midgard: Simplify and fix vector copyprop
Fixes a regression in QuakeSpasm. See https://gitlab.freedesktop.org/mesa/mesa/issues/2169 for apitrace. Closes #2169 Fixes: f72873e6aa0 ("pan/midgard: Copypropagate vector creation") Signed-off-by: Alyssa Rosenzweig <[email protected]> Reported-by: Icecream95
Diffstat (limited to 'src/panfrost/midgard')
-rw-r--r--src/panfrost/midgard/midgard_opt_copy_prop.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/panfrost/midgard/midgard_opt_copy_prop.c b/src/panfrost/midgard/midgard_opt_copy_prop.c
index 242db1eae2d..ca4f78f9a33 100644
--- a/src/panfrost/midgard/midgard_opt_copy_prop.c
+++ b/src/panfrost/midgard/midgard_opt_copy_prop.c
@@ -46,22 +46,13 @@ midgard_opt_copy_prop_reg(compiler_context *ctx, midgard_block *block)
if (ins->has_constants) continue;
if (mir_nontrivial_source2_mod(ins)) continue;
if (mir_nontrivial_outmod(ins)) continue;
- if (!mir_single_use(ctx, ins->src[1])) continue;
+ if (!mir_single_use(ctx, from)) continue;
- bool bad = false;
+ /* Ensure mask is continguous from 0 */
+ if (!(ins->mask & (1 << COMPONENT_X))) continue;
+ if (ins->mask & (ins->mask + 1)) continue;
- mir_foreach_instr_global(ctx, c) {
- if (mir_has_arg(c, ins->src[1])) {
- if (ins->mask != c->mask)
- bad = true;
- }
- }
-
- if (bad)
- continue;
-
-
- mir_rewrite_index_dst(ctx, ins->src[1], ins->dest);
+ mir_rewrite_index_dst(ctx, from, ins->dest);
mir_remove_instruction(ins);
progress |= true;
}