diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-08-16 07:54:34 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-08-19 08:32:17 -0700 |
commit | 24c91bb54b6dd9b07f6a8fe5b01cc305d498ab03 (patch) | |
tree | fe7a80b115adf0e992903b3c2fa4a5b98a191966 | |
parent | 9ae4d3653ee1ef6c67f0fecd05a07fbb41aa627b (diff) |
pan/midgard: Analyze load/store for swizzle propagation
If there's a nontrivial swizzle fed into an extra (shortened) argument,
we bail on copyprop. No glmark changes (since it doesn't use fancy
texturing/loads).
Signed-off-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r-- | src/panfrost/midgard/midgard_opt_copy_prop.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/panfrost/midgard/midgard_opt_copy_prop.c b/src/panfrost/midgard/midgard_opt_copy_prop.c index dc5579c4d46..68c1a4d0d55 100644 --- a/src/panfrost/midgard/midgard_opt_copy_prop.c +++ b/src/panfrost/midgard/midgard_opt_copy_prop.c @@ -52,13 +52,31 @@ midgard_opt_copy_prop(compiler_context *ctx, midgard_block *block) if (mir_nontrivial_source2_mod_simple(ins)) continue; if (mir_nontrivial_outmod(ins)) continue; - /* Texture ops have some weirdness around bias */ + /* Shortened arguments (bias for textures, extra load/store + * arguments, etc.) do not get a swizzlw, only a start + * component and even that is restricted. */ bool skip = false; mir_foreach_instr_global(ctx, q) { - if (q->ssa_args.src[1] != to) continue; - if (q->type == TAG_TEXTURE_4) skip = true; + bool is_tex = q->type == TAG_TEXTURE_4; + bool is_ldst = q->type == TAG_LOAD_STORE_4; + + if (!(is_tex || is_ldst)) continue; + + /* For textures, we get one real swizzle. For stores, + * we also get one. For loads, we get none. */ + + unsigned start = + is_tex ? 1 : + OP_IS_STORE(q->load_store.op) ? 1 : 0; + + mir_foreach_src(q, s) { + if ((s >= start) && q->ssa_args.src[s] == to) { + skip = true; + break; + } + } } if (skip) |