freedreno/ir3: fix crash when no non-input instructions
authorRob Clark <robdclark@chromium.org>
Thu, 19 Dec 2019 17:48:39 +0000 (09:48 -0800)
committerMarge Bot <eric+marge@anholt.net>
Sat, 1 Feb 2020 02:40:22 +0000 (02:40 +0000)
This scenario can come up with block-sched and nop-sched moved to after
RA.  So lets fix it first to keep things bisectable.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3569>

src/freedreno/ir3/ir3_ra.c

index 789c08f42ed487cd9d2fb963fb257882af9e1f1e..3b54bdb189325957ad6ff4a0c73b34189a0df7ed 100644 (file)
@@ -775,7 +775,7 @@ ra_block_compute_live_ranges(struct ir3_ra_ctx *ctx, struct ir3_block *block)
 
                                def(name, id->defn);
 
-                               if (instr->opc == OPC_META_INPUT)
+                               if ((instr->opc == OPC_META_INPUT) && first_non_input)
                                        use(name, first_non_input);
 
                                if (is_high(id->defn)) {