All of the opcodes in nir_opt_algebraic_late are the unsized (1-bit)
versions. If the lowering to int32 happens first, many of the
optimizations and lowerings won't happen.
Of particular importance is the lowering of fisfinite. If a shader
happens to contain fisfinite of an fp16 value, it will assert later
during compliation.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Fixes:
78b4e417d44 ("gallivm: handle fisfinite/fisnormal")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14942>
break;
}
case nir_op_fisfinite32:
- result = lp_build_isfinite(get_flt_bld(bld_base, src_bit_size[0]), src[0]);
- break;
+ unreachable("Should have been lowered in nir_opt_algebraic_late.");
case nir_op_flog2:
result = lp_build_log2_safe(get_flt_bld(bld_base, src_bit_size[0]), src[0]);
break;
NIR_PASS_V(nir, nir_lower_subgroups, &subgroups_options);
} while (progress);
- nir_lower_bool_to_int32(nir);
do {
progress = false;
NIR_PASS_V(nir, nir_opt_cse);
}
} while (progress);
+
+ if (nir_lower_bool_to_int32(nir)) {
+ NIR_PASS_V(nir, nir_copy_prop);
+ NIR_PASS_V(nir, nir_opt_dce);
+ }
}