freedreno: a2xx: fix order of NIR opts
authorJonathan Marek <jonathan@marek.ca>
Thu, 1 Aug 2019 18:38:18 +0000 (14:38 -0400)
committerJonathan Marek <jonathan@marek.ca>
Fri, 2 Aug 2019 15:58:22 +0000 (15:58 +0000)
int_to_float needs to come after bool_to_float, and lower_to_source_mods
needs to come after both, since they don't deal wih source mods.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Rob Clark <robdclark@chromium.org>
src/gallium/drivers/freedreno/a2xx/ir2_nir.c

index 95047d903ac2976362f2c16fc8e925d06d98dc5e..6121627c080a5396ac581e1798e0aae2a15f3c99 100644 (file)
@@ -1064,13 +1064,13 @@ ir2_nir_compile(struct ir2_context *ctx, bool binning)
        /* postprocess */
        OPT_V(ctx->nir, nir_opt_algebraic_late);
 
-       OPT_V(ctx->nir, nir_lower_to_source_mods, nir_lower_all_source_mods);
        OPT_V(ctx->nir, nir_copy_prop);
        OPT_V(ctx->nir, nir_opt_dce);
        OPT_V(ctx->nir, nir_opt_move_comparisons);
 
-       OPT_V(ctx->nir, nir_lower_bool_to_float);
        OPT_V(ctx->nir, nir_lower_int_to_float);
+       OPT_V(ctx->nir, nir_lower_bool_to_float);
+       OPT_V(ctx->nir, nir_lower_to_source_mods, nir_lower_all_source_mods);
 
        /* lower to scalar instructions that can only be scalar on a2xx */
        OPT_V(ctx->nir, ir2_nir_lower_scalar);