From 53294de682a7f54105a419a24f7b2470cb93aeed Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Thu, 17 Aug 2023 15:26:32 -0500 Subject: [PATCH] nir: Take a nir_def * in nir_phi_instr_add_src() Reviewed-by: Alyssa Rosenzweig Part-of: --- src/compiler/nir/nir.c | 4 ++-- src/compiler/nir/nir.h | 3 ++- src/compiler/nir/nir_builder.c | 4 ++-- src/compiler/nir/nir_clone.c | 2 +- src/compiler/nir/nir_control_flow.c | 2 +- src/compiler/nir/nir_lower_bit_size.c | 4 ++-- src/compiler/nir/nir_lower_phis_to_scalar.c | 2 +- src/compiler/nir/nir_opt_if.c | 8 ++++---- src/compiler/nir/nir_opt_phi_precision.c | 4 ++-- src/compiler/nir/nir_phi_builder.c | 2 +- src/compiler/nir/nir_serialize.c | 2 +- .../nir/nir_split_64bit_vec3_and_vec4.c | 2 +- src/compiler/nir/nir_to_lcssa.c | 2 +- src/compiler/nir/tests/dce_tests.cpp | 2 +- src/compiler/nir/tests/loop_analyze_tests.cpp | 12 ++++-------- src/compiler/nir/tests/loop_unroll_tests.cpp | 5 ++--- src/compiler/nir/tests/opt_if_tests.cpp | 6 +++--- .../nir/tests/opt_shrink_vectors_tests.cpp | 18 ++++++------------ .../nir/tests/range_analysis_tests.cpp | 6 ++---- .../drivers/r600/sfn/sfn_nir_lower_64bit.cpp | 4 ++-- src/microsoft/compiler/dxil_nir.c | 2 +- 21 files changed, 42 insertions(+), 54 deletions(-) diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c index f7e061a4123..32e624b0b67 100644 --- a/src/compiler/nir/nir.c +++ b/src/compiler/nir/nir.c @@ -847,13 +847,13 @@ nir_phi_instr_create(nir_shader *shader) * list_addtail(&phi_src->src.use_link, &src.ssa->uses); */ nir_phi_src * -nir_phi_instr_add_src(nir_phi_instr *instr, nir_block *pred, nir_src src) +nir_phi_instr_add_src(nir_phi_instr *instr, nir_block *pred, nir_def *src) { nir_phi_src *phi_src; phi_src = gc_zalloc(gc_get_context(instr), nir_phi_src, 1); phi_src->pred = pred; - phi_src->src = src; + phi_src->src = nir_src_for_ssa(src); nir_src_set_parent_instr(&phi_src->src, &instr->instr); exec_list_push_tail(&instr->srcs, &phi_src->node); diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 5e77e998195..fccd19d424f 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -4093,7 +4093,8 @@ nir_call_instr *nir_call_instr_create(nir_shader *shader, nir_tex_instr *nir_tex_instr_create(nir_shader *shader, unsigned num_srcs); nir_phi_instr *nir_phi_instr_create(nir_shader *shader); -nir_phi_src *nir_phi_instr_add_src(nir_phi_instr *instr, nir_block *pred, nir_src src); +nir_phi_src *nir_phi_instr_add_src(nir_phi_instr *instr, + nir_block *pred, nir_def *src); nir_parallel_copy_instr *nir_parallel_copy_instr_create(nir_shader *shader); diff --git a/src/compiler/nir/nir_builder.c b/src/compiler/nir/nir_builder.c index cbd0623fc70..de4037e1724 100644 --- a/src/compiler/nir/nir_builder.c +++ b/src/compiler/nir/nir_builder.c @@ -458,8 +458,8 @@ nir_if_phi(nir_builder *build, nir_def *then_def, nir_def *else_def) nir_if *nif = nir_cf_node_as_if(nir_cf_node_prev(&block->cf_node)); nir_phi_instr *phi = nir_phi_instr_create(build->shader); - nir_phi_instr_add_src(phi, nir_if_last_then_block(nif), nir_src_for_ssa(then_def)); - nir_phi_instr_add_src(phi, nir_if_last_else_block(nif), nir_src_for_ssa(else_def)); + nir_phi_instr_add_src(phi, nir_if_last_then_block(nif), then_def); + nir_phi_instr_add_src(phi, nir_if_last_else_block(nif), else_def); assert(then_def->num_components == else_def->num_components); assert(then_def->bit_size == else_def->bit_size); diff --git a/src/compiler/nir/nir_clone.c b/src/compiler/nir/nir_clone.c index d0ac3bef584..aa25829539b 100644 --- a/src/compiler/nir/nir_clone.c +++ b/src/compiler/nir/nir_clone.c @@ -388,7 +388,7 @@ clone_phi(clone_state *state, const nir_phi_instr *phi, nir_block *nblk) nir_instr_insert_after_block(nblk, &nphi->instr); nir_foreach_phi_src(src, phi) { - nir_phi_src *nsrc = nir_phi_instr_add_src(nphi, src->pred, src->src); + nir_phi_src *nsrc = nir_phi_instr_add_src(nphi, src->pred, src->src.ssa); /* Stash it in the list of phi sources. We'll walk this list and fix up * sources at the very end of clone_function_impl. diff --git a/src/compiler/nir/nir_control_flow.c b/src/compiler/nir/nir_control_flow.c index 9e922a02c0a..8add05061a3 100644 --- a/src/compiler/nir/nir_control_flow.c +++ b/src/compiler/nir/nir_control_flow.c @@ -228,7 +228,7 @@ nir_insert_phi_undef(nir_block *block, nir_block *pred) phi->def.num_components, phi->def.bit_size); nir_instr_insert_before_cf_list(&impl->body, &undef->instr); - nir_phi_src *src = nir_phi_instr_add_src(phi, pred, nir_src_for_ssa(&undef->def)); + nir_phi_src *src = nir_phi_instr_add_src(phi, pred, &undef->def); list_addtail(&src->src.use_link, &undef->def.uses); } } diff --git a/src/compiler/nir/nir_lower_bit_size.c b/src/compiler/nir/nir_lower_bit_size.c index eb2d932b907..82543f107ff 100644 --- a/src/compiler/nir/nir_lower_bit_size.c +++ b/src/compiler/nir/nir_lower_bit_size.c @@ -318,8 +318,8 @@ split_phi(nir_builder *b, nir_phi_instr *phi) nir_def *x = nir_unpack_64_2x32_split_x(b, src->src.ssa); nir_def *y = nir_unpack_64_2x32_split_y(b, src->src.ssa); - nir_phi_instr_add_src(lowered[0], src->pred, nir_src_for_ssa(x)); - nir_phi_instr_add_src(lowered[1], src->pred, nir_src_for_ssa(y)); + nir_phi_instr_add_src(lowered[0], src->pred, x); + nir_phi_instr_add_src(lowered[1], src->pred, y); } nir_def_init(&lowered[0]->instr, &lowered[0]->def, num_components, 32); diff --git a/src/compiler/nir/nir_lower_phis_to_scalar.c b/src/compiler/nir/nir_lower_phis_to_scalar.c index a6c5f9b3a94..7512b9238ac 100644 --- a/src/compiler/nir/nir_lower_phis_to_scalar.c +++ b/src/compiler/nir/nir_lower_phis_to_scalar.c @@ -226,7 +226,7 @@ lower_phis_to_scalar_block(nir_block *block, else nir_instr_insert_after_block(src->pred, &mov->instr); - nir_phi_instr_add_src(new_phi, src->pred, nir_src_for_ssa(&mov->def)); + nir_phi_instr_add_src(new_phi, src->pred, &mov->def); } nir_instr_insert_before(&phi->instr, &new_phi->instr); diff --git a/src/compiler/nir/nir_opt_if.c b/src/compiler/nir/nir_opt_if.c index 2322490f623..08627c06de8 100644 --- a/src/compiler/nir/nir_opt_if.c +++ b/src/compiler/nir/nir_opt_if.c @@ -496,8 +496,8 @@ opt_split_alu_of_phi(nir_builder *b, nir_loop *loop) * result of the new instruction from continue_block. */ nir_phi_instr *const phi = nir_phi_instr_create(b->shader); - nir_phi_instr_add_src(phi, prev_block, nir_src_for_ssa(prev_value)); - nir_phi_instr_add_src(phi, continue_block, nir_src_for_ssa(alu_copy)); + nir_phi_instr_add_src(phi, prev_block, prev_value); + nir_phi_instr_add_src(phi, continue_block, alu_copy); nir_def_init(&phi->instr, &phi->def, alu_copy->num_components, alu_copy->bit_size); @@ -656,12 +656,12 @@ opt_simplify_bcsel_of_phi(nir_builder *b, nir_loop *loop) nir_phi_instr_add_src(phi, prev_block, nir_phi_get_src_from_block(nir_instr_as_phi(bcsel->src[entry_src].src.ssa->parent_instr), prev_block) - ->src); + ->src.ssa); nir_phi_instr_add_src(phi, continue_block, nir_phi_get_src_from_block(nir_instr_as_phi(bcsel->src[continue_src].src.ssa->parent_instr), continue_block) - ->src); + ->src.ssa); nir_def_init(&phi->instr, &phi->def, bcsel->def.num_components, diff --git a/src/compiler/nir/nir_opt_phi_precision.c b/src/compiler/nir/nir_opt_phi_precision.c index b8e4666c5dd..45f1016daef 100644 --- a/src/compiler/nir/nir_opt_phi_precision.c +++ b/src/compiler/nir/nir_opt_phi_precision.c @@ -242,7 +242,7 @@ try_move_narrowing_dst(nir_builder *b, nir_phi_instr *phi) nir_def *new_src = nir_build_alu(b, op, old_src, NULL, NULL, NULL); /* and add corresponding phi_src to the new_phi: */ - nir_phi_instr_add_src(new_phi, src->pred, nir_src_for_ssa(new_src)); + nir_phi_instr_add_src(new_phi, src->pred, new_src); } /* And finally rewrite the original uses of the original phi uses to @@ -408,7 +408,7 @@ try_move_widening_src(nir_builder *b, nir_phi_instr *phi) } /* add corresponding phi_src to the new_phi: */ - nir_phi_instr_add_src(new_phi, src->pred, nir_src_for_ssa(new_src)); + nir_phi_instr_add_src(new_phi, src->pred, new_src); } /* And insert the new phi after all sources are in place: */ diff --git a/src/compiler/nir/nir_phi_builder.c b/src/compiler/nir/nir_phi_builder.c index 8fc5560dc3a..98980a48a10 100644 --- a/src/compiler/nir/nir_phi_builder.c +++ b/src/compiler/nir/nir_phi_builder.c @@ -288,7 +288,7 @@ nir_phi_builder_finish(struct nir_phi_builder *pb) for (unsigned i = 0; i < phi->instr.block->predecessors->entries; i++) { nir_phi_instr_add_src(phi, preds[i], - nir_src_for_ssa(nir_phi_builder_value_get_block_def(val, preds[i]))); + nir_phi_builder_value_get_block_def(val, preds[i])); } ralloc_free(preds); diff --git a/src/compiler/nir/nir_serialize.c b/src/compiler/nir/nir_serialize.c index b74b155e1f4..831920d5a81 100644 --- a/src/compiler/nir/nir_serialize.c +++ b/src/compiler/nir/nir_serialize.c @@ -1512,7 +1512,7 @@ read_phi(read_ctx *ctx, nir_block *blk, union packed_instr header) for (unsigned i = 0; i < header.phi.num_srcs; i++) { nir_def *def = (nir_def *)(uintptr_t)blob_read_uint32(ctx->blob); nir_block *pred = (nir_block *)(uintptr_t)blob_read_uint32(ctx->blob); - nir_phi_src *src = nir_phi_instr_add_src(phi, pred, nir_src_for_ssa(def)); + nir_phi_src *src = nir_phi_instr_add_src(phi, pred, def); /* Since we're not letting nir_insert_instr handle use/def stuff for us, * we have to set the parent_instr manually. It doesn't really matter diff --git a/src/compiler/nir/nir_split_64bit_vec3_and_vec4.c b/src/compiler/nir/nir_split_64bit_vec3_and_vec4.c index e061e2689b7..510b2c185ac 100644 --- a/src/compiler/nir/nir_split_64bit_vec3_and_vec4.c +++ b/src/compiler/nir/nir_split_64bit_vec3_and_vec4.c @@ -250,7 +250,7 @@ split_phi(nir_builder *b, nir_phi_instr *phi) nir_def *new_src = nir_channels(b, src->src.ssa, ((1 << num_comp[i]) - 1) << (2 * i)); - nir_phi_instr_add_src(new_phi[i], src->pred, nir_src_for_ssa(new_src)); + nir_phi_instr_add_src(new_phi[i], src->pred, new_src); } nir_instr_insert_before(&phi->instr, &new_phi[i]->instr); } diff --git a/src/compiler/nir/nir_to_lcssa.c b/src/compiler/nir/nir_to_lcssa.c index 371f92a921c..a4e75740a61 100644 --- a/src/compiler/nir/nir_to_lcssa.c +++ b/src/compiler/nir/nir_to_lcssa.c @@ -233,7 +233,7 @@ convert_loop_exit_for_ssa(nir_def *def, void *void_state) */ uint32_t num_exits = state->block_after_loop->predecessors->entries; for (uint32_t i = 0; i < num_exits; i++) { - nir_phi_instr_add_src(phi, state->exit_blocks[i], nir_src_for_ssa(def)); + nir_phi_instr_add_src(phi, state->exit_blocks[i], def); } nir_instr_insert_before_block(state->block_after_loop, &phi->instr); diff --git a/src/compiler/nir/tests/dce_tests.cpp b/src/compiler/nir/tests/dce_tests.cpp index 660d26c14bc..1aecc0ea984 100644 --- a/src/compiler/nir/tests/dce_tests.cpp +++ b/src/compiler/nir/tests/dce_tests.cpp @@ -43,7 +43,7 @@ nir_phi_instr *create_one_source_phi(nir_shader *shader, nir_block *pred, nir_def *def) { nir_phi_instr *phi = nir_phi_instr_create(shader); - nir_phi_instr_add_src(phi, pred, nir_src_for_ssa(def)); + nir_phi_instr_add_src(phi, pred, def); nir_def_init(&phi->instr, &phi->def, def->num_components, def->bit_size); diff --git a/src/compiler/nir/tests/loop_analyze_tests.cpp b/src/compiler/nir/tests/loop_analyze_tests.cpp index 6cd76812ff2..2735d4cbcd4 100644 --- a/src/compiler/nir/tests/loop_analyze_tests.cpp +++ b/src/compiler/nir/tests/loop_analyze_tests.cpp @@ -86,8 +86,7 @@ loop_builder(nir_builder *b, loop_builder_param p) nir_def_init(&phi->instr, &phi->def, ssa_0->num_components, ssa_0->bit_size); - nir_phi_instr_add_src(phi, ssa_0->parent_instr->block, - nir_src_for_ssa(ssa_0)); + nir_phi_instr_add_src(phi, ssa_0->parent_instr->block, ssa_0); nir_def *ssa_5 = &phi->def; nir_def *ssa_3 = p.cond_instr(b, ssa_5, ssa_1); @@ -101,8 +100,7 @@ loop_builder(nir_builder *b, loop_builder_param p) nir_def *ssa_4 = p.incr_instr(b, ssa_5, ssa_2); - nir_phi_instr_add_src(phi, ssa_4->parent_instr->block, - nir_src_for_ssa(ssa_4)); + nir_phi_instr_add_src(phi, ssa_4->parent_instr->block, ssa_4); } nir_pop_loop(b, loop); @@ -156,8 +154,7 @@ loop_builder_invert(nir_builder *b, loop_builder_invert_param p) nir_def_init(&phi->instr, &phi->def, ssa_0->num_components, ssa_0->bit_size); - nir_phi_instr_add_src(phi, ssa_0->parent_instr->block, - nir_src_for_ssa(ssa_0)); + nir_phi_instr_add_src(phi, ssa_0->parent_instr->block, ssa_0); nir_def *ssa_5 = &phi->def; @@ -172,8 +169,7 @@ loop_builder_invert(nir_builder *b, loop_builder_invert_param p) } nir_pop_if(b, nif); - nir_phi_instr_add_src(phi, nir_cursor_current_block(b->cursor), - nir_src_for_ssa(ssa_3)); + nir_phi_instr_add_src(phi, nir_cursor_current_block(b->cursor), ssa_3); } nir_pop_loop(b, loop); diff --git a/src/compiler/nir/tests/loop_unroll_tests.cpp b/src/compiler/nir/tests/loop_unroll_tests.cpp index 903bdca4119..f9ffb1f7a1c 100644 --- a/src/compiler/nir/tests/loop_unroll_tests.cpp +++ b/src/compiler/nir/tests/loop_unroll_tests.cpp @@ -118,7 +118,7 @@ loop_unroll_test_helper(nir_builder *bld, nir_def *init, nir_phi_instr *phi = nir_phi_instr_create(bld->shader); nir_def_init(&phi->instr, &phi->def, 1, 32); - nir_phi_instr_add_src(phi, top_block, nir_src_for_ssa(init)); + nir_phi_instr_add_src(phi, top_block, init); nir_def *cond = cond_instr(bld, (reverse ? limit : &phi->def), @@ -130,8 +130,7 @@ loop_unroll_test_helper(nir_builder *bld, nir_def *init, nir_def *var = incr_instr(bld, &phi->def, step); - nir_phi_instr_add_src(phi, nir_cursor_current_block(bld->cursor), - nir_src_for_ssa(var)); + nir_phi_instr_add_src(phi, nir_cursor_current_block(bld->cursor), var); nir_pop_loop(bld, loop); diff --git a/src/compiler/nir/tests/opt_if_tests.cpp b/src/compiler/nir/tests/opt_if_tests.cpp index 8ba009174e3..02da4a7a867 100644 --- a/src/compiler/nir/tests/opt_if_tests.cpp +++ b/src/compiler/nir/tests/opt_if_tests.cpp @@ -111,7 +111,7 @@ TEST_F(nir_opt_if_test, opt_if_simplification_single_source_phi_after_if) nir_phi_instr *const phi = nir_phi_instr_create(b->shader); - nir_phi_instr_add_src(phi, then_block, nir_src_for_ssa(one)); + nir_phi_instr_add_src(phi, then_block, one); nir_def_init(&phi->instr, &phi->def, one->num_components, one->bit_size); @@ -138,13 +138,13 @@ TEST_F(nir_opt_if_test, opt_if_alu_of_phi_progress) nir_def_init(&phi->instr, &phi->def, x->num_components, x->bit_size); - nir_phi_instr_add_src(phi, x->parent_instr->block, nir_src_for_ssa(x)); + nir_phi_instr_add_src(phi, x->parent_instr->block, x); nir_def *y = nir_iadd(b, &phi->def, two); nir_store_var(b, out_var, nir_imul(b, &phi->def, two), 1); - nir_phi_instr_add_src(phi, nir_cursor_current_block(b->cursor), nir_src_for_ssa(y)); + nir_phi_instr_add_src(phi, nir_cursor_current_block(b->cursor), y); } nir_pop_loop(b, loop); diff --git a/src/compiler/nir/tests/opt_shrink_vectors_tests.cpp b/src/compiler/nir/tests/opt_shrink_vectors_tests.cpp index 74f6f733b7a..85e3032543b 100644 --- a/src/compiler/nir/tests/opt_shrink_vectors_tests.cpp +++ b/src/compiler/nir/tests/opt_shrink_vectors_tests.cpp @@ -282,8 +282,7 @@ TEST_F(nir_opt_shrink_vectors_test, opt_shrink_phis_loop_simple) nir_def_init(&phi->instr, &phi->def, v->num_components, v->bit_size); - nir_phi_instr_add_src(phi, v->parent_instr->block, - nir_src_for_ssa(v)); + nir_phi_instr_add_src(phi, v->parent_instr->block, v); nir_def *fge = nir_fge(b, phi_def, loop_max); nir_alu_instr *fge_alu_instr = nir_instr_as_alu(fge->parent_instr); @@ -309,8 +308,7 @@ TEST_F(nir_opt_shrink_vectors_test, opt_shrink_phis_loop_simple) srcs[1] = nir_get_scalar(fadd, 0); nir_def *vec = nir_vec_scalars(b, srcs, 4); - nir_phi_instr_add_src(phi, vec->parent_instr->block, - nir_src_for_ssa(vec)); + nir_phi_instr_add_src(phi, vec->parent_instr->block, vec); nir_pop_loop(b, loop); @@ -388,8 +386,7 @@ TEST_F(nir_opt_shrink_vectors_test, opt_shrink_phis_loop_swizzle) nir_def_init(&phi->instr, &phi->def, v->num_components, v->bit_size); - nir_phi_instr_add_src(phi, v->parent_instr->block, - nir_src_for_ssa(v)); + nir_phi_instr_add_src(phi, v->parent_instr->block, v); nir_def *fge = nir_fge(b, phi_def, loop_max); nir_alu_instr *fge_alu_instr = nir_instr_as_alu(fge->parent_instr); @@ -415,8 +412,7 @@ TEST_F(nir_opt_shrink_vectors_test, opt_shrink_phis_loop_swizzle) srcs[3] = nir_get_scalar(phi_def, 3); nir_def *vec = nir_vec_scalars(b, srcs, 4); - nir_phi_instr_add_src(phi, vec->parent_instr->block, - nir_src_for_ssa(vec)); + nir_phi_instr_add_src(phi, vec->parent_instr->block, vec); nir_pop_loop(b, loop); @@ -495,8 +491,7 @@ TEST_F(nir_opt_shrink_vectors_test, opt_shrink_phis_loop_phi_out) nir_def_init(&phi->instr, &phi->def, v->num_components, v->bit_size); - nir_phi_instr_add_src(phi, v->parent_instr->block, - nir_src_for_ssa(v)); + nir_phi_instr_add_src(phi, v->parent_instr->block, v); nir_def *fge = nir_fge(b, phi_def, loop_max); nir_alu_instr *fge_alu_instr = nir_instr_as_alu(fge->parent_instr); @@ -522,8 +517,7 @@ TEST_F(nir_opt_shrink_vectors_test, opt_shrink_phis_loop_phi_out) srcs[1] = nir_get_scalar(fadd, 0); nir_def *vec = nir_vec_scalars(b, srcs, 4); - nir_phi_instr_add_src(phi, vec->parent_instr->block, - nir_src_for_ssa(vec)); + nir_phi_instr_add_src(phi, vec->parent_instr->block, vec); nir_pop_loop(b, loop); diff --git a/src/compiler/nir/tests/range_analysis_tests.cpp b/src/compiler/nir/tests/range_analysis_tests.cpp index 2e8fbe4ee35..cc0c2afda5c 100644 --- a/src/compiler/nir/tests/range_analysis_tests.cpp +++ b/src/compiler/nir/tests/range_analysis_tests.cpp @@ -279,10 +279,8 @@ TEST_F(unsigned_upper_bound_test, loop_phi_bcsel) nir_def *sel = nir_bcsel(b, cond, &phi->def, two); nir_pop_loop(b, NULL); - nir_phi_instr_add_src(phi, zero->parent_instr->block, - nir_src_for_ssa(zero)); - nir_phi_instr_add_src(phi, sel->parent_instr->block, - nir_src_for_ssa(sel)); + nir_phi_instr_add_src(phi, zero->parent_instr->block, zero); + nir_phi_instr_add_src(phi, sel->parent_instr->block, sel); b->cursor = nir_before_instr(sel->parent_instr); nir_builder_instr_insert(b, &phi->instr); diff --git a/src/gallium/drivers/r600/sfn/sfn_nir_lower_64bit.cpp b/src/gallium/drivers/r600/sfn/sfn_nir_lower_64bit.cpp index 0e96d056864..056b6613207 100644 --- a/src/gallium/drivers/r600/sfn/sfn_nir_lower_64bit.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_nir_lower_64bit.cpp @@ -255,8 +255,8 @@ class LowerSplit64op : public NirLowerInstruction { { auto lo = nir_unpack_32_2x16_split_x(b, nir_ssa_for_src(b, s->src, 1)); auto hi = nir_unpack_32_2x16_split_x(b, nir_ssa_for_src(b, s->src, 1)); - nir_phi_instr_add_src(phi_lo, s->pred, nir_src_for_ssa(lo)); - nir_phi_instr_add_src(phi_hi, s->pred, nir_src_for_ssa(hi)); + nir_phi_instr_add_src(phi_lo, s->pred, lo); + nir_phi_instr_add_src(phi_hi, s->pred, hi); } return nir_pack_64_2x32_split(b, &phi_lo->def, &phi_hi->def); } diff --git a/src/microsoft/compiler/dxil_nir.c b/src/microsoft/compiler/dxil_nir.c index 8eb57ded6cb..5712c7293be 100644 --- a/src/microsoft/compiler/dxil_nir.c +++ b/src/microsoft/compiler/dxil_nir.c @@ -832,7 +832,7 @@ cast_phi(nir_builder *b, nir_phi_instr *phi, unsigned new_bit_size) nir_def *cast = nir_u2uN(b, src->src.ssa, new_bit_size); - nir_phi_instr_add_src(lowered, src->pred, nir_src_for_ssa(cast)); + nir_phi_instr_add_src(lowered, src->pred, cast); } nir_def_init(&lowered->instr, &lowered->def, num_components,