intel/compiler: move nir_lower_bool_to_int32 before nir_lower_locals_to_regs
authorIago Toral Quiroga <itoral@igalia.com>
Wed, 19 Dec 2018 07:05:19 +0000 (08:05 +0100)
committerIago Toral Quiroga <itoral@igalia.com>
Thu, 20 Dec 2018 07:02:44 +0000 (08:02 +0100)
The former expects to see SSA-only things, but the latter injects registers.

The assertions in the lowering where not seeing this because they asserted
on the bit_size values only, not on the is_ssa field, so add that assertion
too.

Fixes: 11dc1307794e "nir: Add a bool to int32 lowering pass"
CC: mesa-stable@lists.freedesktop.org
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir_lower_bool_to_int32.c
src/intel/compiler/brw_nir.c

index 064b27b9025e6315ab874e76ef3d181ff17f1469..fdd2f55175dd3a7c41d5211ce572d8848e0204bb 100644 (file)
@@ -46,6 +46,8 @@ lower_alu_instr(nir_alu_instr *alu)
 {
    const nir_op_info *op_info = &nir_op_infos[alu->op];
 
+   assert(alu->dest.dest.is_ssa);
+
    switch (alu->op) {
    case nir_op_imov:
    case nir_op_vec2:
index ab88a5f1fc788dfd77b148424b6a26b946599cf6..4fdc98b6cf4b9dd4830fddd9747276e2f2394ffc 100644 (file)
@@ -832,6 +832,8 @@ brw_postprocess_nir(nir_shader *nir, const struct brw_compiler *compiler,
    OPT(nir_opt_dce);
    OPT(nir_opt_move_comparisons);
 
+   OPT(nir_lower_bool_to_int32);
+
    OPT(nir_lower_locals_to_regs);
 
    if (unlikely(debug_enabled)) {
@@ -846,8 +848,6 @@ brw_postprocess_nir(nir_shader *nir, const struct brw_compiler *compiler,
       nir_print_shader(nir, stderr);
    }
 
-   OPT(nir_lower_bool_to_int32);
-
    OPT(nir_convert_from_ssa, true);
 
    if (!is_scalar) {