From: Tomeu Vizoso Date: Mon, 22 Apr 2019 15:06:24 +0000 (+0200) Subject: panfrost/midgard: Skip liveness analysis for instructions without dest X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ad7c9ba0ecb349763ab7fad7bce74f1d47c139e3;p=mesa.git panfrost/midgard: Skip liveness analysis for instructions without dest [Alyssa: Add comment explanation] Signed-off-by: Tomeu Vizoso Reviewed-by: Alyssa Rosenzweig --- diff --git a/src/gallium/drivers/panfrost/midgard/midgard_compile.c b/src/gallium/drivers/panfrost/midgard/midgard_compile.c index d4d26b9a25e..e1d2edf1670 100644 --- a/src/gallium/drivers/panfrost/midgard/midgard_compile.c +++ b/src/gallium/drivers/panfrost/midgard/midgard_compile.c @@ -2109,6 +2109,13 @@ allocate_registers(compiler_context *ctx) mir_foreach_instr_in_block(block, ins) { if (ins->compact_branch) continue; + /* Dest is < 0 for store_vary instructions, which break + * the usual SSA conventions. Liveness analysis doesn't + * make sense on these instructions, so skip them to + * avoid memory corruption */ + + if (ins->ssa_args.dest < 0) continue; + if (ins->ssa_args.dest < SSA_FIXED_MINIMUM) { /* If this destination is not yet live, it is now since we just wrote it */