From fadcd8d371a027e881cc443eabbbda9d5349be03 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 22 Jun 2023 11:08:19 -0400 Subject: [PATCH] gallivm: Use NIR_PASS macros These run nir_validate in debug builds, which will avoid bugs slipping in. It's not enough that llvmpipe doesn't mind illegal NIR, these passes are well within their rights to fail spectacularly if the NIR wouldn't validate. So validate so we catch issues early. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Dave Airlie Part-of: --- src/gallium/auxiliary/gallivm/lp_bld_nir.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.c b/src/gallium/auxiliary/gallivm/lp_bld_nir.c index 2b1a9374eb1..e8ed0a13ba4 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_nir.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.c @@ -2794,14 +2794,14 @@ bool lp_build_nir_llvm(struct lp_build_nir_context *bld_base, { struct nir_function *func; - nir_convert_from_ssa(nir, true); - nir_lower_locals_to_regs(nir, 32); - nir_remove_dead_derefs(nir); - nir_remove_dead_variables(nir, nir_var_function_temp, NULL); + NIR_PASS_V(nir, nir_convert_from_ssa, true); + NIR_PASS_V(nir, nir_lower_locals_to_regs, 32); + NIR_PASS_V(nir, nir_remove_dead_derefs); + NIR_PASS_V(nir, nir_remove_dead_variables, nir_var_function_temp, NULL); if (is_aos(bld_base)) { - nir_move_vec_src_uses_to_dest(nir); - nir_lower_vec_to_movs(nir, NULL, NULL); + NIR_PASS_V(nir, nir_move_vec_src_uses_to_dest); + NIR_PASS_V(nir, nir_lower_vec_to_movs, NULL, NULL); } nir_foreach_shader_out_variable(variable, nir)