From ad7c9ba0ecb349763ab7fad7bce74f1d47c139e3 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Mon, 22 Apr 2019 17:06:24 +0200 Subject: [PATCH] panfrost/midgard: Skip liveness analysis for instructions without dest [Alyssa: Add comment explanation] Signed-off-by: Tomeu Vizoso Reviewed-by: Alyssa Rosenzweig --- src/gallium/drivers/panfrost/midgard/midgard_compile.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gallium/drivers/panfrost/midgard/midgard_compile.c b/src/gallium/drivers/panfrost/midgard/midgard_compile.c index d4d26b9..e1d2edf 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 */ -- 2.7.4