pan/bi: Expand pseudo instructions when nosched is set
authorBoris Brezillon <boris.brezillon@collabora.com>
Mon, 19 Apr 2021 15:51:41 +0000 (17:51 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 22 Apr 2021 16:59:18 +0000 (16:59 +0000)
Pseudo instruction might expend to 2 instructions (one in the FMA slot
and one in the ADD slot), we need to expand those even if nosched is
set.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10332>

src/panfrost/bifrost/bi_schedule.c

index 8300753..fa98b08 100644 (file)
@@ -881,12 +881,6 @@ bi_take_instr(bi_context *ctx, struct bi_worklist st,
                 struct bi_tuple_state *tuple,
                 bool fma)
 {
-#ifndef NDEBUG
-        /* Don't pair instructions if debugging */
-        if ((bifrost_debug & BIFROST_DBG_NOSCHED) && tuple->add)
-                return NULL;
-#endif
-
         if (tuple->add && tuple->add->op == BI_OPCODE_CUBEFACE)
                 return bi_lower_cubeface(ctx, clause, tuple);
         else if (tuple->add && tuple->add->op == BI_OPCODE_PATOM_C_I32)
@@ -898,6 +892,12 @@ bi_take_instr(bi_context *ctx, struct bi_worklist st,
         else if (tuple->add && tuple->add->table)
                 return bi_lower_dtsel(ctx, clause, tuple);
 
+#ifndef NDEBUG
+        /* Don't pair instructions if debugging */
+        if ((bifrost_debug & BIFROST_DBG_NOSCHED) && tuple->add)
+                return NULL;
+#endif
+
         unsigned idx = bi_choose_index(st, clause, tuple, fma);
 
         if (idx >= st.count)