freedreno/ir3/ra: only assign array base in first pass
authorRob Clark <robdclark@chromium.org>
Tue, 28 Apr 2020 00:00:17 +0000 (17:00 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 28 Apr 2020 20:06:49 +0000 (20:06 +0000)
In particular, we specifically don't want to let the base change between
passes, as it could end up conflicting with registers assigned in the
first pass.

Mostly-closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2838
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4780>

src/freedreno/ir3/ir3_ra.c

index 656fa01193e8d731790f0075650563b04694c1a3..927f91e98ec467cca5c963449f1582933e6f22ac 100644 (file)
@@ -1383,7 +1383,8 @@ ra_precolor(struct ir3_ra_ctx *ctx, struct ir3_instruction **precolor, unsigned
                if (arr->end_ip == 0)
                        continue;
 
-               assign_arr_base(ctx, arr, precolor, nprecolor);
+               if (!ctx->scalar_pass)
+                       assign_arr_base(ctx, arr, precolor, nprecolor);
 
                unsigned base = arr->reg;