freedreno/ir3/legalize: don't allow (nopN) if (rptN)
authorRob Clark <robdclark@chromium.org>
Tue, 10 Mar 2020 23:01:30 +0000 (16:01 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 16 Jun 2020 20:56:15 +0000 (20:56 +0000)
These two encodings are mutually exclusive.  If the instruction is a
vector(ish) `(rptN)` instruction, then we can't fold a `(nopN)` post-
delay into it.

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

src/freedreno/ir3/ir3_legalize.c

index c59c065c207b80dbd72a466b8f81b8077f521629..ce3d4fdebb86e471dfb62bece67a27ad6261e32b 100644 (file)
@@ -681,7 +681,8 @@ nop_sched(struct ir3 *ir)
                         */
 
                        if ((delay > 0) && (ir->compiler->gpu_id >= 600) && last &&
-                                       ((opc_cat(last->opc) == 2) || (opc_cat(last->opc) == 3))) {
+                                       ((opc_cat(last->opc) == 2) || (opc_cat(last->opc) == 3)) &&
+                                       (last->repeat == 0)) {
                                /* the previous cat2/cat3 instruction can encode at most 3 nop's: */
                                unsigned transfer = MIN2(delay, 3 - last->nop);
                                last->nop += transfer;