pan/mdg: Be a bit more pedantic in invert passes
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 29 Apr 2020 22:01:50 +0000 (18:01 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 29 Apr 2020 23:07:03 +0000 (23:07 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4820>

src/panfrost/midgard/midgard_opt_invert.c

index de7f6bc43d80bc84768dccbe0ecc9e2ccd5b97c9..e9c1ef261a17f7a7d8f8daa5402b9d71cee06dc6 100644 (file)
@@ -308,6 +308,7 @@ midgard_opt_csel_invert(compiler_context *ctx, midgard_block *block)
         mir_foreach_instr_in_block_safe(block, ins) {
                 if (ins->type != TAG_ALU_4) continue;
                 if (!OP_IS_CSEL(ins->alu.op)) continue;
+                if (!is_ssa_or_constant(ins->src[2])) continue;
                 if (!mir_single_use(ctx, ins->src[2])) continue;
                 if (!mir_strip_inverted(ctx, ins->src[2])) continue;