mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 15:20:10 +01:00
treewide: Switch to nir_progress
Via the Coccinelle patch at the end of the commit message, followed by
sed -ie 's/progress = progress | /progress |=/g' $(git grep -l 'progress = prog')
ninja -C ~/mesa/build clang-format
cd ~/mesa/src/compiler/nir && clang-format -i *.c
agxfmt
@@
identifier prog;
expression impl, metadata;
@@
-if (prog) {
-nir_metadata_preserve(impl, metadata);
-} else {
-nir_metadata_preserve(impl, nir_metadata_all);
-}
-return prog;
+return nir_progress(prog, impl, metadata);
@@
expression prog_expr, impl, metadata;
@@
-if (prog_expr) {
-nir_metadata_preserve(impl, metadata);
-return true;
-} else {
-nir_metadata_preserve(impl, nir_metadata_all);
-return false;
-}
+bool progress = prog_expr;
+return nir_progress(progress, impl, metadata);
@@
identifier prog;
expression impl, metadata;
@@
-nir_metadata_preserve(impl, prog ? (metadata) : nir_metadata_all);
-return prog;
+return nir_progress(prog, impl, metadata);
@@
identifier prog;
expression impl, metadata;
@@
-nir_metadata_preserve(impl, prog ? (metadata) : nir_metadata_all);
+nir_progress(prog, impl, metadata);
@@
expression impl, metadata;
@@
-nir_metadata_preserve(impl, metadata);
-return true;
+return nir_progress(true, impl, metadata);
@@
expression impl;
@@
-nir_metadata_preserve(impl, nir_metadata_all);
-return false;
+return nir_no_progress(impl);
@@
identifier other_prog, prog;
expression impl, metadata;
@@
-if (prog) {
-nir_metadata_preserve(impl, metadata);
-} else {
-nir_metadata_preserve(impl, nir_metadata_all);
-}
-other_prog |= prog;
+other_prog = other_prog | nir_progress(prog, impl, metadata);
@@
identifier prog;
expression impl, metadata;
@@
-if (prog) {
-nir_metadata_preserve(impl, metadata);
-} else {
-nir_metadata_preserve(impl, nir_metadata_all);
-}
+nir_progress(prog, impl, metadata);
@@
identifier other_prog, prog;
expression impl, metadata;
@@
-if (prog) {
-nir_metadata_preserve(impl, metadata);
-other_prog = true;
-} else {
-nir_metadata_preserve(impl, nir_metadata_all);
-}
+other_prog = other_prog | nir_progress(prog, impl, metadata);
@@
expression prog_expr, impl, metadata;
identifier prog;
@@
-if (prog_expr) {
-nir_metadata_preserve(impl, metadata);
-prog = true;
-} else {
-nir_metadata_preserve(impl, nir_metadata_all);
-}
+bool impl_progress = prog_expr;
+prog = prog | nir_progress(impl_progress, impl, metadata);
@@
identifier other_prog, prog;
expression impl, metadata;
@@
-if (prog) {
-other_prog = true;
-nir_metadata_preserve(impl, metadata);
-} else {
-nir_metadata_preserve(impl, nir_metadata_all);
-}
+other_prog = other_prog | nir_progress(prog, impl, metadata);
@@
expression prog_expr, impl, metadata;
identifier prog;
@@
-if (prog_expr) {
-prog = true;
-nir_metadata_preserve(impl, metadata);
-} else {
-nir_metadata_preserve(impl, nir_metadata_all);
-}
+bool impl_progress = prog_expr;
+prog = prog | nir_progress(impl_progress, impl, metadata);
@@
expression prog_expr, impl, metadata;
@@
-if (prog_expr) {
-nir_metadata_preserve(impl, metadata);
-} else {
-nir_metadata_preserve(impl, nir_metadata_all);
-}
+bool impl_progress = prog_expr;
+nir_progress(impl_progress, impl, metadata);
@@
identifier prog;
expression impl, metadata;
@@
-nir_metadata_preserve(impl, metadata);
-prog = true;
+prog = nir_progress(true, impl, metadata);
@@
identifier prog;
expression impl, metadata;
@@
-if (prog) {
-nir_metadata_preserve(impl, metadata);
-}
-return prog;
+return nir_progress(prog, impl, metadata);
@@
identifier prog;
expression impl, metadata;
@@
-if (prog) {
-nir_metadata_preserve(impl, metadata);
-}
+nir_progress(prog, impl, metadata);
@@
expression impl;
@@
-nir_metadata_preserve(impl, nir_metadata_all);
+nir_no_progress(impl);
@@
expression impl, metadata;
@@
-nir_metadata_preserve(impl, metadata);
+nir_progress(true, impl, metadata);
squashme! sed -ie 's/progress = progress | /progress |=/g' $(git grep -l 'progress = prog')
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33722>
This commit is contained in:
parent
91872c9c51
commit
9a58a8257e
192 changed files with 348 additions and 904 deletions
|
|
@ -284,8 +284,7 @@ ac_nir_lower_legacy_gs(nir_shader *nir,
|
|||
nir_sendmsg_amd(b, nir_load_gs_wave_id_amd(b),
|
||||
.base = AC_SENDMSG_GS_OP_NOP | AC_SENDMSG_GS_DONE);
|
||||
|
||||
if (progress)
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(progress, impl, nir_metadata_none);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,5 @@ ac_nir_lower_legacy_vs(nir_shader *nir,
|
|||
&out);
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
|
||||
return true;
|
||||
return nir_progress(true, impl, nir_metadata_none);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -838,7 +838,7 @@ analyze_shader_before_culling(nir_shader *shader, lower_ngg_nogs_state *s)
|
|||
}
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
nir_no_progress(impl);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1203,7 +1203,7 @@ add_deferred_attribute_culling(nir_builder *b, nir_cf_list *original_extracted_c
|
|||
nir_store_var(b, s->gs_accepted_var, gs_thread, 0x1u);
|
||||
|
||||
/* Remove all non-position outputs, and put the position output into the variable. */
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
remove_culling_shader_outputs(b->shader, s);
|
||||
b->cursor = nir_after_impl(impl);
|
||||
|
||||
|
|
@ -1929,7 +1929,7 @@ ac_nir_lower_ngg_nogs(nir_shader *shader, const ac_nir_lower_ngg_options *option
|
|||
}
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
nir_validate_shader(shader, "after emitting NGG VS/TES");
|
||||
|
||||
/* Cleanup */
|
||||
|
|
|
|||
|
|
@ -957,13 +957,11 @@ ac_nir_lower_ngg_gs(nir_shader *shader, const ac_nir_lower_ngg_options *options)
|
|||
ngg_gs_finale(b, &state);
|
||||
|
||||
/* Take care of metadata and validation before calling other passes */
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
nir_validate_shader(shader, "after emitting NGG GS");
|
||||
|
||||
/* Cleanup */
|
||||
nir_lower_vars_to_ssa(shader);
|
||||
nir_remove_dead_variables(shader, nir_var_function_temp, NULL);
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
|
||||
return true;
|
||||
return nir_progress(true, impl, nir_metadata_none);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1429,7 +1429,7 @@ ac_nir_lower_ngg_mesh(nir_shader *shader,
|
|||
emit_ms_finale(b, &state);
|
||||
|
||||
/* Take care of metadata and validation before calling other passes */
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
nir_validate_shader(shader, "after emitting NGG MS");
|
||||
|
||||
/* Cleanup */
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ ac_nir_lower_task_outputs_to_mem(nir_shader *shader,
|
|||
* that are made by lower_task_launch_mesh_workgroups.
|
||||
*/
|
||||
nir_function_impl *impl = nir_shader_get_entrypoint(shader);
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
}
|
||||
|
||||
return progress;
|
||||
|
|
|
|||
|
|
@ -1113,7 +1113,7 @@ hs_finale(nir_shader *shader, lower_tess_io_state *st)
|
|||
}
|
||||
nir_pop_if(b, if_invocation_id_zero);
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
}
|
||||
|
||||
static nir_def *
|
||||
|
|
|
|||
|
|
@ -495,10 +495,11 @@ ac_nir_lower_tex(nir_shader *nir, const ac_nir_lower_tex_options *options)
|
|||
state.num_wqm_vgprs = 0;
|
||||
|
||||
bool divergent_discard = false;
|
||||
if (move_coords_from_divergent_cf(&state, impl, &impl->body, &divergent_discard, false))
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
else
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
bool impl_progress = move_coords_from_divergent_cf(&state, impl,
|
||||
&impl->body,
|
||||
&divergent_discard,
|
||||
false);
|
||||
nir_progress(impl_progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
progress |= nir_shader_instructions_pass(
|
||||
|
|
|
|||
|
|
@ -232,8 +232,7 @@ bool ac_nir_optimize_outputs(nir_shader *nir, bool sprite_tex_disallowed,
|
|||
|
||||
if (nir->info.stage != MESA_SHADER_VERTEX &&
|
||||
nir->info.stage != MESA_SHADER_TESS_EVAL) {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
return false;
|
||||
return nir_no_progress(impl);
|
||||
}
|
||||
|
||||
struct ac_out_info outputs[NUM_TOTAL_VARYING_SLOTS] = { 0 };
|
||||
|
|
@ -300,10 +299,5 @@ bool ac_nir_optimize_outputs(nir_shader *nir, bool sprite_tex_disallowed,
|
|||
ac_eliminate_duplicated_output(outputs, outputs_optimized, i, &b, slot_remap);
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -373,7 +373,7 @@ init_context(isel_context* ctx, nir_shader* shader)
|
|||
|
||||
/* sanitize control flow */
|
||||
sanitize_cf_list(impl, &impl->body);
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
|
||||
/* we'll need these for isel */
|
||||
nir_metadata_require(impl, nir_metadata_block_index);
|
||||
|
|
|
|||
|
|
@ -591,7 +591,7 @@ radv_nir_apply_pipeline_layout(nir_shader *shader, struct radv_device *device, c
|
|||
|
||||
if (progress) {
|
||||
nir_foreach_function (function, shader) {
|
||||
nir_metadata_preserve(function->impl, nir_metadata_control_flow);
|
||||
nir_progress(true, function->impl, nir_metadata_control_flow);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,10 +82,5 @@ radv_nir_export_multiview(nir_shader *nir)
|
|||
break;
|
||||
}
|
||||
|
||||
if (progress)
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
else
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -516,7 +516,7 @@ radv_nir_lower_abi(nir_shader *shader, enum amd_gfx_level gfx_level, const struc
|
|||
state.gsvs_ring[i] = load_gsvs_ring(&b, &state, i);
|
||||
|
||||
progress = true;
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
nir_progress(true, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
progress |= nir_shader_intrinsics_pass(shader, lower_abi_instr, nir_metadata_control_flow, &state);
|
||||
|
|
|
|||
|
|
@ -521,11 +521,5 @@ radv_nir_lower_cooperative_matrix(nir_shader *shader, enum amd_gfx_level gfx_lev
|
|||
|
||||
_mesa_hash_table_destroy(type_map, NULL);
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(func->impl, 0);
|
||||
} else {
|
||||
nir_metadata_preserve(func->impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, func->impl, 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,10 +84,5 @@ radv_nir_lower_primitive_shading_rate(nir_shader *nir, enum amd_gfx_level gfx_le
|
|||
break;
|
||||
}
|
||||
|
||||
if (progress)
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
else
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -719,7 +719,7 @@ radv_nir_lower_ray_queries(struct nir_shader *shader, struct radv_device *device
|
|||
}
|
||||
}
|
||||
|
||||
nir_metadata_preserve(function->impl, nir_metadata_none);
|
||||
nir_progress(true, function->impl, nir_metadata_none);
|
||||
}
|
||||
|
||||
ralloc_free(query_ht);
|
||||
|
|
|
|||
|
|
@ -157,12 +157,7 @@ lower_rt_derefs(nir_shader *shader)
|
|||
}
|
||||
}
|
||||
|
||||
if (progress)
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
else
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -789,10 +784,7 @@ lower_hit_attribs(nir_shader *shader, nir_variable **hit_attribs, uint32_t workg
|
|||
if (!hit_attribs)
|
||||
shader->info.shared_size = MAX2(shader->info.shared_size, workgroup_size * RADV_MAX_HIT_ATTRIB_SIZE);
|
||||
|
||||
if (progress)
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1210,7 +1202,7 @@ nir_lower_intersection_shader(nir_shader *intersection, nir_shader *any_hit)
|
|||
nir_def_rewrite_uses(&intrin->def, accepted);
|
||||
}
|
||||
}
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
|
||||
/* We did some inlining; have to re-index SSA defs */
|
||||
nir_index_ssa_defs(impl);
|
||||
|
|
@ -1629,7 +1621,7 @@ radv_build_traversal(struct radv_device *device, struct radv_ray_tracing_pipelin
|
|||
radv_build_end_trace_token(b, vars, original_tmax, nir_load_var(b, trav_vars.hit),
|
||||
nir_load_var(b, iteration_instance_count));
|
||||
|
||||
nir_metadata_preserve(nir_shader_get_entrypoint(b->shader), nir_metadata_none);
|
||||
nir_progress(true, nir_shader_get_entrypoint(b->shader), nir_metadata_none);
|
||||
radv_nir_lower_hit_attrib_derefs(b->shader);
|
||||
|
||||
/* Register storage for hit attributes */
|
||||
|
|
@ -1748,7 +1740,7 @@ radv_build_traversal_shader(struct radv_device *device, struct radv_ray_tracing_
|
|||
|
||||
/* Deal with all the inline functions. */
|
||||
nir_index_ssa_defs(nir_shader_get_entrypoint(b.shader));
|
||||
nir_metadata_preserve(nir_shader_get_entrypoint(b.shader), nir_metadata_none);
|
||||
nir_progress(true, nir_shader_get_entrypoint(b.shader), nir_metadata_none);
|
||||
|
||||
/* Lower and cleanup variables */
|
||||
NIR_PASS(_, b.shader, nir_lower_global_vars_to_local);
|
||||
|
|
@ -2076,7 +2068,7 @@ radv_nir_lower_rt_abi(nir_shader *shader, const VkRayTracingPipelineCreateInfoKH
|
|||
radv_store_arg(&b, args, traversal_info, args->ac.rt.hit_kind, nir_load_var(&b, vars.hit_kind));
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
|
||||
/* cleanup passes */
|
||||
NIR_PASS(_, shader, nir_lower_global_vars_to_local);
|
||||
|
|
|
|||
|
|
@ -353,10 +353,7 @@ move_rt_instructions(nir_shader *shader)
|
|||
}
|
||||
}
|
||||
|
||||
if (progress)
|
||||
nir_metadata_preserve(nir_shader_get_entrypoint(shader), nir_metadata_control_flow);
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, nir_shader_get_entrypoint(shader), nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
static VkResult
|
||||
|
|
|
|||
|
|
@ -123,6 +123,5 @@ agx_nir_lower_cull_distance_fs(nir_shader *s, unsigned nr_distances)
|
|||
DIV_ROUND_UP(nr_distances, 4));
|
||||
|
||||
s->info.fs.uses_discard = true;
|
||||
nir_metadata_preserve(b->impl, nir_metadata_control_flow);
|
||||
return true;
|
||||
return nir_progress(true, b->impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,13 +129,7 @@ agx_nir_lower_zs_emit(nir_shader *s)
|
|||
progress |= lower_zs_emit(block, s->info.fs.early_fragment_tests);
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
any_progress |= progress;
|
||||
any_progress |= nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
return any_progress;
|
||||
|
|
|
|||
|
|
@ -213,11 +213,10 @@ agx_nir_lower_sample_mask(nir_shader *shader)
|
|||
}
|
||||
} else {
|
||||
/* regular shaders that don't use discard have nothing to lower */
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
return false;
|
||||
return nir_no_progress(impl);
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
nir_progress(true, impl, nir_metadata_control_flow);
|
||||
|
||||
nir_shader_intrinsics_pass(shader, lower_discard_to_sample_mask_0,
|
||||
nir_metadata_control_flow, NULL);
|
||||
|
|
|
|||
|
|
@ -47,8 +47,7 @@ agx_nir_lower_alpha_to_coverage(nir_shader *shader, uint8_t nr_samples)
|
|||
*/
|
||||
nir_def *rgba = store ? store->src[0].ssa : NULL;
|
||||
if (!rgba || rgba->num_components < 4) {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
return false;
|
||||
return nir_no_progress(impl);
|
||||
}
|
||||
|
||||
nir_builder _b = nir_builder_at(nir_before_instr(&store->instr));
|
||||
|
|
@ -68,8 +67,7 @@ agx_nir_lower_alpha_to_coverage(nir_shader *shader, uint8_t nr_samples)
|
|||
/* Discard samples that aren't covered */
|
||||
nir_discard_agx(b, nir_inot(b, mask));
|
||||
shader->info.fs.uses_discard = true;
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
return true;
|
||||
return nir_progress(true, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -117,11 +115,5 @@ agx_nir_lower_alpha_to_one(nir_shader *shader)
|
|||
progress = true;
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1190,7 +1190,7 @@ agx_nir_lower_gs_instancing(nir_shader *gs)
|
|||
nir_pop_loop(&b, loop);
|
||||
|
||||
/* We've mucked about with control flow */
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
|
||||
/* Use the loop counter as the invocation ID each iteration */
|
||||
nir_shader_intrinsics_pass(gs, rewrite_invocation_id,
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ agx_nir_wrap_per_sample_loop(nir_shader *shader, uint8_t nr_samples)
|
|||
nir_pop_loop(&b, loop);
|
||||
|
||||
/* We've mucked about with control flow */
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
|
||||
/* Use the loop variable for the active sampple mask each iteration */
|
||||
nir_shader_intrinsics_pass(shader, lower_active_samples,
|
||||
|
|
|
|||
|
|
@ -289,6 +289,5 @@ agx_nir_lower_tes(nir_shader *tes, bool to_hw_vs)
|
|||
}
|
||||
|
||||
nir_lower_idiv(tes, &(nir_lower_idiv_options){.allow_fp16 = true});
|
||||
nir_metadata_preserve(nir_shader_get_entrypoint(tes), nir_metadata_none);
|
||||
return true;
|
||||
return nir_progress(true, nir_shader_get_entrypoint(tes), nir_metadata_none);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,8 +53,7 @@ agx_nir_lower_poly_stipple(nir_shader *s)
|
|||
nir_demote_if(b, nir_ieq_imm(b, bit, 0));
|
||||
s->info.fs.uses_discard = true;
|
||||
|
||||
nir_metadata_preserve(b->impl, nir_metadata_control_flow);
|
||||
return true;
|
||||
return nir_progress(true, b->impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -685,8 +684,7 @@ agx_nir_lower_stats_fs(nir_shader *s)
|
|||
nir_global_atomic(b, 32, addr, samples, .atomic_op = nir_atomic_op_iadd);
|
||||
|
||||
nir_pop_if(b, NULL);
|
||||
nir_metadata_preserve(b->impl, nir_metadata_control_flow);
|
||||
return true;
|
||||
return nir_progress(true, b->impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -431,8 +431,7 @@ hk_nir_insert_psiz_write(nir_shader *nir)
|
|||
nir_function_impl *impl = nir_shader_get_entrypoint(nir);
|
||||
|
||||
if (nir->info.outputs_written & VARYING_BIT_PSIZ) {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
return false;
|
||||
return nir_no_progress(impl);
|
||||
}
|
||||
|
||||
nir_builder b = nir_builder_at(nir_after_impl(impl));
|
||||
|
|
@ -443,8 +442,7 @@ hk_nir_insert_psiz_write(nir_shader *nir)
|
|||
.io_semantics.num_slots = 1, .src_type = nir_type_float32);
|
||||
|
||||
nir->info.outputs_written |= VARYING_BIT_PSIZ;
|
||||
nir_metadata_preserve(b.impl, nir_metadata_control_flow);
|
||||
return true;
|
||||
return nir_progress(true, b.impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
static nir_def *
|
||||
|
|
|
|||
|
|
@ -673,8 +673,7 @@ v3d_nir_lower_io(nir_shader *s, struct v3d_compile *c)
|
|||
emit_gs_vpm_output_header_prolog(c, &b, &state);
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl,
|
||||
nir_metadata_control_flow);
|
||||
nir_progress(true, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
if (s->info.stage != MESA_SHADER_COMPUTE)
|
||||
|
|
|
|||
|
|
@ -164,12 +164,7 @@ v3d_nir_lower_line_smooth(nir_shader *s)
|
|||
|
||||
progress |= lower_line_smooth_func(&state, impl);
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl,
|
||||
nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
return progress;
|
||||
|
|
|
|||
|
|
@ -408,13 +408,7 @@ v3d_nir_lower_logic_ops(nir_shader *s, struct v3d_compile *c)
|
|||
nir_foreach_block(block, impl)
|
||||
progress |= v3d_nir_lower_logic_ops_block(block, c);
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl,
|
||||
nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl,
|
||||
nir_metadata_all);
|
||||
}
|
||||
nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
return progress;
|
||||
|
|
|
|||
|
|
@ -1576,8 +1576,7 @@ v3d_nir_sort_constant_ubo_loads(nir_shader *s, struct v3d_compile *c)
|
|||
c->sorted_any_ubo_loads |=
|
||||
v3d_nir_sort_constant_ubo_loads_block(c, block);
|
||||
}
|
||||
nir_metadata_preserve(impl,
|
||||
nir_metadata_control_flow);
|
||||
nir_progress(true, impl, nir_metadata_control_flow);
|
||||
}
|
||||
return c->sorted_any_ubo_loads;
|
||||
}
|
||||
|
|
@ -1672,8 +1671,7 @@ v3d_nir_lower_subgroup_intrinsics(nir_shader *s, struct v3d_compile *c)
|
|||
nir_foreach_block(block, impl)
|
||||
progress |= lower_subgroup_intrinsics(c, block, &b);
|
||||
|
||||
nir_metadata_preserve(impl,
|
||||
nir_metadata_control_flow);
|
||||
nir_progress(true, impl, nir_metadata_control_flow);
|
||||
}
|
||||
return progress;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -302,14 +302,14 @@ libclc_add_generic_variants(nir_shader *shader)
|
|||
}
|
||||
|
||||
progress = true;
|
||||
nir_metadata_preserve(func->impl, nir_metadata_none);
|
||||
nir_progress(true, func->impl, nir_metadata_none);
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_foreach_function_impl(impl, shader) {
|
||||
if (impl->valid_metadata & nir_metadata_not_properly_reset) {
|
||||
/* Preserve all metadata for functions that we didn't modify. */
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
nir_no_progress(impl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1215,8 +1215,7 @@ gl_nir_add_point_size(nir_shader *nir)
|
|||
nir->info.outputs_written |= VARYING_BIT_PSIZ;
|
||||
|
||||
/* We always modify the entrypoint */
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
return true;
|
||||
return nir_progress(true, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1251,8 +1250,7 @@ gl_nir_zero_initialize_clip_distance(nir_shader *nir)
|
|||
if (clip_dist1)
|
||||
zero_array_members(&b, clip_dist1);
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
return true;
|
||||
return nir_progress(true, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -489,8 +489,7 @@ gl_nir_lower_blend_equation_advanced(nir_shader *sh, bool coherent)
|
|||
nir_function_impl *impl = nir_shader_get_entrypoint(sh);
|
||||
|
||||
if (sh->info.fs.advanced_blend_modes == 0) {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
return false;
|
||||
return nir_no_progress(impl);
|
||||
}
|
||||
|
||||
sh->info.fs.uses_sample_shading = true;
|
||||
|
|
@ -575,7 +574,7 @@ gl_nir_lower_blend_equation_advanced(nir_shader *sh, bool coherent)
|
|||
}
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
|
||||
/* Remove any dead writes before assigning location to __blend_fb_fetch
|
||||
* otherwise they will be unable to be removed.
|
||||
|
|
|
|||
|
|
@ -311,13 +311,7 @@ lower_buffer_interface_derefs_impl(nir_function_impl *impl,
|
|||
}
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -2238,13 +2238,7 @@ nir_function_impl_lower_instructions(nir_function_impl *impl,
|
|||
}
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, preserved);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, preserved);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -682,7 +682,7 @@ nir_call_serialized(nir_builder *b, const uint32_t *serialized,
|
|||
|
||||
/* Indices & metadata are completely messed up now */
|
||||
nir_index_ssa_defs(b->impl);
|
||||
nir_metadata_preserve(b->impl, nir_metadata_none);
|
||||
nir_progress(true, b->impl, nir_metadata_none);
|
||||
ralloc_free(memctx);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,13 +109,7 @@ nir_function_instructions_pass(nir_function_impl *impl,
|
|||
}
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, preserved);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, preserved);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -172,13 +166,7 @@ nir_function_intrinsics_pass(nir_function_impl *impl,
|
|||
}
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, preserved);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, preserved);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -228,12 +216,7 @@ nir_shader_alu_pass(nir_shader *shader,
|
|||
}
|
||||
}
|
||||
|
||||
if (func_progress) {
|
||||
nir_metadata_preserve(impl, preserved);
|
||||
progress = true;
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
progress |= nir_progress(func_progress, impl, preserved);
|
||||
}
|
||||
|
||||
return progress;
|
||||
|
|
@ -259,12 +242,7 @@ nir_shader_tex_pass(nir_shader *shader, nir_tex_pass_cb pass,
|
|||
}
|
||||
}
|
||||
|
||||
if (func_progress) {
|
||||
nir_metadata_preserve(impl, preserved);
|
||||
progress = true;
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
progress |= nir_progress(func_progress, impl, preserved);
|
||||
}
|
||||
|
||||
return progress;
|
||||
|
|
@ -289,12 +267,7 @@ nir_shader_phi_pass(nir_shader *shader,
|
|||
}
|
||||
}
|
||||
|
||||
if (func_progress) {
|
||||
nir_metadata_preserve(impl, preserved);
|
||||
progress = true;
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
progress |= nir_progress(func_progress, impl, preserved);
|
||||
}
|
||||
|
||||
return progress;
|
||||
|
|
|
|||
|
|
@ -495,7 +495,7 @@ nir_handle_add_jump(nir_block *block)
|
|||
unlink_block_successors(block);
|
||||
|
||||
nir_function_impl *impl = nir_cf_node_get_function(&block->cf_node);
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
|
||||
switch (jump_instr->type) {
|
||||
case nir_jump_return:
|
||||
|
|
@ -554,7 +554,7 @@ nir_handle_remove_jump(nir_block *block, nir_jump_type type)
|
|||
unlink_jump(block, type, true);
|
||||
|
||||
nir_function_impl *impl = nir_cf_node_get_function(&block->cf_node);
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -751,7 +751,7 @@ nir_cf_extract(nir_cf_list *extracted, nir_cursor begin, nir_cursor end)
|
|||
exec_list_make_empty(&extracted->list);
|
||||
|
||||
/* Dominance and other block-related information is toast. */
|
||||
nir_metadata_preserve(extracted->impl, nir_metadata_none);
|
||||
nir_progress(true, extracted->impl, nir_metadata_none);
|
||||
|
||||
nir_cf_node *cf_node = &block_begin->cf_node;
|
||||
nir_cf_node *cf_node_end = &block_end->cf_node;
|
||||
|
|
|
|||
|
|
@ -393,13 +393,7 @@ nir_remove_dead_derefs_impl(nir_function_impl *impl)
|
|||
}
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -1540,13 +1534,7 @@ nir_opt_deref_impl(nir_function_impl *impl)
|
|||
}
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -1451,7 +1451,7 @@ nir_divergence_analysis_impl(nir_function_impl *impl, nir_divergence_options opt
|
|||
/* Unless this pass is called with shader->options->divergence_analysis_options,
|
||||
* it invalidates nir_metadata_divergence.
|
||||
*/
|
||||
nir_metadata_preserve(impl, ~nir_metadata_divergence);
|
||||
nir_progress(true, impl, ~nir_metadata_divergence);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1483,7 +1483,7 @@ nir_vertex_divergence_analysis(nir_shader *shader)
|
|||
nir_metadata_require(impl, nir_metadata_block_index);
|
||||
state.impl = impl;
|
||||
visit_cf_list(&impl->body, &state);
|
||||
nir_metadata_preserve(impl, nir_metadata_all & ~nir_metadata_divergence);
|
||||
nir_progress(true, impl, nir_metadata_all & ~nir_metadata_divergence);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1054,7 +1054,7 @@ nir_convert_from_ssa_impl(nir_function_impl *impl,
|
|||
}
|
||||
|
||||
/* Mark metadata as dirty before we ask for liveness analysis */
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
nir_progress(true, impl, nir_metadata_control_flow);
|
||||
|
||||
nir_metadata_require(impl, nir_metadata_instr_index |
|
||||
nir_metadata_live_defs |
|
||||
|
|
@ -1074,7 +1074,7 @@ nir_convert_from_ssa_impl(nir_function_impl *impl,
|
|||
resolve_parallel_copies_block(block, &state);
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
nir_progress(true, impl, nir_metadata_control_flow);
|
||||
|
||||
/* Clean up dead instructions and the hash tables */
|
||||
nir_instr_free_list(&state.dead_instrs);
|
||||
|
|
|
|||
|
|
@ -476,7 +476,7 @@ nir_group_loads(nir_shader *shader, nir_load_grouping grouping,
|
|||
process_block(block, grouping, max_distance);
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow |
|
||||
nir_metadata_loop_analysis);
|
||||
nir_progress(true, impl,
|
||||
nir_metadata_control_flow | nir_metadata_loop_analysis);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -462,7 +462,7 @@ nir_inline_uniforms(nir_shader *shader, unsigned num_uniforms,
|
|||
}
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
nir_progress(true, impl, nir_metadata_control_flow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1074,10 +1074,7 @@ replace_varying_input_by_constant_load(nir_shader *shader,
|
|||
}
|
||||
}
|
||||
|
||||
if (progress)
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -1123,10 +1120,7 @@ replace_duplicate_input(nir_shader *shader, nir_variable *input_var,
|
|||
}
|
||||
}
|
||||
|
||||
if (progress)
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -1291,10 +1285,7 @@ replace_varying_input_by_uniform_load(nir_shader *shader,
|
|||
}
|
||||
}
|
||||
|
||||
if (progress)
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
/* The GLSL ES 3.20 spec says:
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ nir_lower_amul(nir_shader *shader,
|
|||
}
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
nir_progress(true, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
return state.progress;
|
||||
|
|
|
|||
|
|
@ -131,14 +131,8 @@ nir_lower_array_deref_of_vec_impl(nir_function_impl *impl,
|
|||
}
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
/* indirect store lower will change control flow */
|
||||
nir_metadata_preserve(impl, has_indirect_store ? nir_metadata_none : nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl,
|
||||
has_indirect_store ? nir_metadata_none : nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
/* Lowers away array dereferences on vectors
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ nir_lower_atomics_to_ssbo(nir_shader *shader, unsigned offset_align_state)
|
|||
}
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
nir_progress(true, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
|
|
|
|||
|
|
@ -284,13 +284,7 @@ lower_impl(nir_function_impl *impl,
|
|||
}
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ lower_bitmap_impl(nir_function_impl *impl,
|
|||
|
||||
lower_bitmap(impl->function->shader, &b, options);
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
nir_progress(true, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -417,9 +417,7 @@ nir_lower_clip_vs(nir_shader *shader, unsigned ucp_enables, bool use_vars,
|
|||
lower_clip_vertex_var(&b, &state);
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_dominance);
|
||||
|
||||
return true;
|
||||
return nir_progress(true, impl, nir_metadata_dominance);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -568,7 +566,7 @@ lower_clip_fs(nir_function_impl *impl, unsigned ucp_enables,
|
|||
b.shader->info.fs.uses_discard = true;
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_dominance);
|
||||
nir_progress(true, impl, nir_metadata_dominance);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
|
|||
|
|
@ -510,14 +510,8 @@ nir_lower_clip_cull_distance_arrays(nir_shader *nir)
|
|||
}
|
||||
|
||||
nir_foreach_function_impl(impl, nir) {
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl,
|
||||
nir_metadata_control_flow |
|
||||
nir_metadata_live_defs |
|
||||
nir_metadata_loop_analysis);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
nir_progress(progress, impl,
|
||||
nir_metadata_control_flow | nir_metadata_live_defs | nir_metadata_loop_analysis);
|
||||
}
|
||||
|
||||
return progress;
|
||||
|
|
|
|||
|
|
@ -406,7 +406,7 @@ nir_lower_const_arrays_to_uniforms(nir_shader *shader,
|
|||
}
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
nir_progress(true, impl, nir_metadata_control_flow);
|
||||
|
||||
ralloc_free(var_infos);
|
||||
_mesa_hash_table_destroy(const_array_vars, NULL);
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ lower_continue_constructs_impl(nir_function_impl *impl)
|
|||
bool progress = visit_cf_list(&b, &impl->body, &repair_ssa);
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
|
||||
/* Merge the Phis from Header and Continue Target */
|
||||
nir_lower_reg_intrinsics_to_ssa_impl(impl);
|
||||
|
|
@ -151,7 +151,7 @@ lower_continue_constructs_impl(nir_function_impl *impl)
|
|||
if (repair_ssa)
|
||||
nir_repair_ssa_impl(impl);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
nir_no_progress(impl);
|
||||
}
|
||||
|
||||
return progress;
|
||||
|
|
|
|||
|
|
@ -881,17 +881,14 @@ nir_lower_doubles_impl(nir_function_impl *impl,
|
|||
/* Indices are completely messed up now */
|
||||
nir_index_ssa_defs(impl);
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
|
||||
/* And we have deref casts we need to clean up thanks to function
|
||||
* inlining.
|
||||
*/
|
||||
nir_opt_deref_impl(impl);
|
||||
} else if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
} else
|
||||
nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
|
||||
return progress;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -634,7 +634,7 @@ lower_flrp_impl(nir_function_impl *impl,
|
|||
}
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
nir_progress(true, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -88,9 +88,8 @@ nir_lower_global_vars_to_local(nir_shader *shader)
|
|||
exec_node_remove(&var->node);
|
||||
var->data.mode = nir_var_function_temp;
|
||||
exec_list_push_tail(&impl->locals, &var->node);
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow |
|
||||
nir_metadata_live_defs);
|
||||
progress = true;
|
||||
progress = nir_progress(true, impl,
|
||||
nir_metadata_control_flow | nir_metadata_live_defs);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -100,7 +99,7 @@ nir_lower_global_vars_to_local(nir_shader *shader)
|
|||
nir_fixup_deref_modes(shader);
|
||||
|
||||
nir_foreach_function_impl(impl, shader) {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
nir_no_progress(impl);
|
||||
}
|
||||
|
||||
return progress;
|
||||
|
|
|
|||
|
|
@ -914,8 +914,7 @@ static bool
|
|||
nir_lower_goto_ifs_impl(nir_function_impl *impl)
|
||||
{
|
||||
if (impl->structured) {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
return false;
|
||||
return nir_no_progress(impl);
|
||||
}
|
||||
|
||||
nir_metadata_require(impl, nir_metadata_dominance);
|
||||
|
|
@ -961,7 +960,7 @@ nir_lower_goto_ifs_impl(nir_function_impl *impl)
|
|||
ralloc_free(mem_ctx);
|
||||
nir_cf_delete(&cf_list);
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
|
||||
nir_repair_ssa_impl(impl);
|
||||
nir_lower_reg_intrinsics_to_ssa_impl(impl);
|
||||
|
|
|
|||
|
|
@ -536,7 +536,7 @@ nir_lower_gs_intrinsics(nir_shader *shader, nir_lower_gs_intrinsics_flags option
|
|||
/* This only works because we have a single main() function. */
|
||||
append_set_vertex_and_primitive_count(impl->end_block, &state);
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
|
||||
return state.progress;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -201,12 +201,7 @@ lower_indirects_impl(nir_function_impl *impl, nir_variable_mode modes,
|
|||
max_lower_array_len);
|
||||
}
|
||||
|
||||
if (progress)
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
else
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_none);
|
||||
}
|
||||
|
||||
/** Lowers indirect variable loads/stores to direct loads/stores.
|
||||
|
|
|
|||
|
|
@ -297,11 +297,7 @@ nir_lower_int_to_float_impl(nir_function_impl *impl)
|
|||
}
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
|
||||
free(float_types);
|
||||
free(int_types);
|
||||
|
|
|
|||
|
|
@ -876,7 +876,7 @@ nir_lower_io_impl(nir_function_impl *impl,
|
|||
|
||||
ralloc_free(state.dead_ctx);
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
|
||||
return progress;
|
||||
}
|
||||
|
|
@ -2473,13 +2473,7 @@ nir_lower_explicit_io_impl(nir_function_impl *impl, nir_variable_mode modes,
|
|||
}
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_none);
|
||||
}
|
||||
|
||||
/** Lower explicitly laid out I/O access to byte offset/address intrinsics
|
||||
|
|
@ -2564,15 +2558,8 @@ nir_lower_vars_to_explicit_types_impl(nir_function_impl *impl,
|
|||
}
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow |
|
||||
nir_metadata_live_defs |
|
||||
nir_metadata_loop_analysis);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl,
|
||||
nir_metadata_control_flow | nir_metadata_live_defs | nir_metadata_loop_analysis);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -3131,10 +3118,7 @@ nir_io_add_const_offset_to_base(nir_shader *nir, nir_variable_mode modes)
|
|||
impl_progress |= add_const_offset_to_base_block(block, &b, modes);
|
||||
}
|
||||
progress |= impl_progress;
|
||||
if (impl_progress)
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
else
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
nir_progress(impl_progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
return progress;
|
||||
|
|
@ -3211,12 +3195,7 @@ nir_lower_color_inputs(nir_shader *nir)
|
|||
}
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -3290,7 +3269,7 @@ nir_io_add_intrinsic_xfb_info(nir_shader *nir)
|
|||
}
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
nir_no_progress(impl);
|
||||
return progress;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -351,11 +351,7 @@ lower_io_arrays_to_elements(nir_shader *shader, nir_variable_mode mask,
|
|||
}
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -340,8 +340,7 @@ nir_lower_io_to_temporaries(nir_shader *shader, nir_function_impl *entrypoint,
|
|||
shader->info.stage != MESA_SHADER_TESS_EVAL &&
|
||||
shader->info.stage != MESA_SHADER_GEOMETRY &&
|
||||
shader->info.stage != MESA_SHADER_FRAGMENT) {
|
||||
nir_metadata_preserve(entrypoint, nir_metadata_all);
|
||||
return false;
|
||||
return nir_no_progress(entrypoint);
|
||||
}
|
||||
|
||||
state.shader = shader;
|
||||
|
|
@ -381,7 +380,7 @@ nir_lower_io_to_temporaries(nir_shader *shader, nir_function_impl *entrypoint,
|
|||
if (outputs)
|
||||
emit_output_copies_impl(&state, impl);
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
nir_progress(true, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
exec_list_append(&shader->variables, &state.old_inputs);
|
||||
|
|
|
|||
|
|
@ -596,11 +596,7 @@ nir_lower_io_to_vector_impl(nir_function_impl *impl, nir_variable_mode modes)
|
|||
nir_fixup_deref_modes(b.shader);
|
||||
util_dynarray_fini(&demote_vars);
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -74,13 +74,7 @@ nir_lower_load_const_to_scalar_impl(nir_function_impl *impl)
|
|||
}
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -301,7 +301,7 @@ impl(nir_function_impl *impl, uint8_t bool_bitsize)
|
|||
lower_locals_to_regs_block(block, &state);
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
nir_progress(true, impl, nir_metadata_control_flow);
|
||||
|
||||
_mesa_hash_table_destroy(state.regs_table, NULL);
|
||||
|
||||
|
|
|
|||
|
|
@ -147,11 +147,7 @@ nir_recompute_io_bases(nir_shader *nir, nir_variable_mode modes)
|
|||
}
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
nir_progress(changed, impl, nir_metadata_control_flow);
|
||||
|
||||
if (modes & nir_var_shader_in)
|
||||
nir->num_inputs = BITSET_COUNT(inputs);
|
||||
|
|
@ -285,13 +281,7 @@ nir_lower_mediump_io(nir_shader *nir, nir_variable_mode modes,
|
|||
if (changed && use_16bit_slots)
|
||||
nir_recompute_io_bases(nir, modes);
|
||||
|
||||
if (changed) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return changed;
|
||||
return nir_progress(changed, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -346,13 +336,7 @@ nir_force_mediump_io(nir_shader *nir, nir_variable_mode modes,
|
|||
}
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return changed;
|
||||
return nir_progress(changed, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -391,13 +375,7 @@ nir_unpack_16bit_varying_slots(nir_shader *nir, nir_variable_mode modes)
|
|||
if (changed)
|
||||
nir_recompute_io_bases(nir, modes);
|
||||
|
||||
if (changed) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return changed;
|
||||
return nir_progress(changed, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -557,13 +535,7 @@ nir_lower_mediump_vars_impl(nir_function_impl *impl, nir_variable_mode modes,
|
|||
}
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -176,12 +176,9 @@ lower_memcpy_impl(nir_function_impl *impl)
|
|||
}
|
||||
|
||||
if (found_non_const_memcpy) {
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
} else if (found_const_memcpy) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
} else
|
||||
nir_progress(found_const_memcpy, impl, nir_metadata_control_flow);
|
||||
|
||||
return found_const_memcpy || found_non_const_memcpy;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -240,12 +240,8 @@ nir_lower_memory_model(nir_shader *shader)
|
|||
modes = 0;
|
||||
foreach_list_typed_reverse(nir_cf_node, cf_node, node, cf_list)
|
||||
impl_progress |= lower_make_available(cf_node, &modes);
|
||||
|
||||
if (impl_progress)
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
else
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
progress |= impl_progress;
|
||||
progress |= nir_progress(impl_progress, impl,
|
||||
nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
return progress;
|
||||
|
|
|
|||
|
|
@ -326,6 +326,5 @@ nir_lower_multiview(nir_shader *shader, nir_lower_multiview_options options)
|
|||
|
||||
_mesa_hash_table_destroy(out_derefs, NULL);
|
||||
|
||||
nir_metadata_preserve(entrypoint, nir_metadata_none);
|
||||
return true;
|
||||
return nir_progress(true, entrypoint, nir_metadata_none);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -451,10 +451,7 @@ nir_lower_non_uniform_access_impl(nir_function_impl *impl,
|
|||
|
||||
_mesa_hash_table_destroy(state.accesses, NULL);
|
||||
|
||||
if (progress)
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_none);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ lower_impl(nir_function_impl *impl)
|
|||
.base = shader->num_outputs++,
|
||||
.io_semantics.location = VARYING_SLOT_EDGE);
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
nir_progress(true, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -89,9 +89,7 @@ nir_lower_patch_vertices(nir_shader *nir,
|
|||
}
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
}
|
||||
nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
return progress;
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ lower_phis_to_scalar_impl(nir_function_impl *impl, bool lower_all)
|
|||
progress = lower_phis_to_scalar_block(block, &state) || progress;
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
nir_progress(true, impl, nir_metadata_control_flow);
|
||||
|
||||
nir_instr_free_list(&state.dead_instrs);
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ nir_lower_pntc_ytransform(nir_shader *shader,
|
|||
nir_foreach_block(block, impl) {
|
||||
lower_pntc_ytransform_block(&state, block);
|
||||
}
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
nir_progress(true, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
return state.pntc_transform != NULL;
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ nir_lower_point_size_mov(nir_shader *shader,
|
|||
lower_point_size_mov_after(&b, in);
|
||||
shader->info.outputs_written |= VARYING_BIT_PSIZ;
|
||||
progress = true;
|
||||
nir_metadata_preserve(impl, preserved);
|
||||
nir_progress(true, impl, preserved);
|
||||
}
|
||||
return progress;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,8 +128,7 @@ nir_lower_reg_intrinsics_to_ssa_impl(nir_function_impl *impl)
|
|||
}
|
||||
}
|
||||
if (!need_lower_reg) {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
return false;
|
||||
return nir_no_progress(impl);
|
||||
}
|
||||
|
||||
nir_metadata_require(impl, nir_metadata_control_flow);
|
||||
|
|
@ -170,8 +169,7 @@ nir_lower_reg_intrinsics_to_ssa_impl(nir_function_impl *impl)
|
|||
|
||||
ralloc_free(dead_ctx);
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
return true;
|
||||
return nir_progress(true, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -286,11 +286,11 @@ nir_lower_returns_impl(nir_function_impl *impl)
|
|||
progress = progress || state.removed_unreachable_code;
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
nir_rematerialize_derefs_in_use_blocks_impl(impl);
|
||||
nir_repair_ssa_impl(impl);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
nir_no_progress(impl);
|
||||
}
|
||||
|
||||
return progress;
|
||||
|
|
|
|||
|
|
@ -219,12 +219,8 @@ nir_lower_vars_to_scratch(nir_shader *shader,
|
|||
}
|
||||
}
|
||||
|
||||
if (impl_progress) {
|
||||
progress = true;
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
progress |= nir_progress(impl_progress, impl,
|
||||
nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
_mesa_set_destroy(set, NULL);
|
||||
|
|
|
|||
|
|
@ -57,13 +57,7 @@ move_system_values_to_top(nir_shader *shader)
|
|||
}
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -894,7 +888,7 @@ duplicate_loop_bodies(nir_function_impl *impl, nir_instr *resume_instr)
|
|||
}
|
||||
|
||||
if (resume_reg != NULL)
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
|
||||
return resume_reg != NULL;
|
||||
}
|
||||
|
|
@ -1289,7 +1283,7 @@ lower_resume(nir_shader *shader, int call_idx)
|
|||
|
||||
ralloc_free(mem_ctx);
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
|
||||
nir_validate_shader(shader, "after flatten_resume_if_ladder in "
|
||||
"nir_lower_shader_calls");
|
||||
|
|
@ -1589,10 +1583,8 @@ nir_opt_trim_stack_values(nir_shader *shader)
|
|||
}
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl,
|
||||
progress ? (nir_metadata_control_flow |
|
||||
nir_metadata_loop_analysis)
|
||||
: nir_metadata_all);
|
||||
nir_progress(progress, impl,
|
||||
nir_metadata_control_flow | nir_metadata_loop_analysis);
|
||||
|
||||
_mesa_hash_table_u64_destroy(value_id_to_mask);
|
||||
|
||||
|
|
@ -1834,10 +1826,8 @@ nir_opt_stack_loads(nir_shader *shader)
|
|||
}
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl,
|
||||
func_progress ? (nir_metadata_control_flow |
|
||||
nir_metadata_loop_analysis)
|
||||
: nir_metadata_all);
|
||||
nir_progress(func_progress, impl,
|
||||
nir_metadata_control_flow | nir_metadata_loop_analysis);
|
||||
|
||||
progress |= func_progress;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,9 +143,7 @@ nir_lower_nv_task_count(nir_shader *shader)
|
|||
nir_builder builder = nir_builder_create(impl);
|
||||
|
||||
append_launch_mesh_workgroups_to_nv_task(&builder, &state);
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
|
||||
return true;
|
||||
return nir_progress(true, impl, nir_metadata_none);
|
||||
}
|
||||
|
||||
static nir_intrinsic_op
|
||||
|
|
@ -446,7 +444,7 @@ nir_lower_task_shader(nir_shader *shader,
|
|||
nir_block *last_block = nir_impl_last_block(impl);
|
||||
builder.cursor = nir_after_block_before_jump(last_block);
|
||||
nir_launch_mesh_workgroups(&builder, nir_imm_zero(&builder, 3, 32));
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
nir_progress(true, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
bool atomics = options.payload_to_shared_for_atomics;
|
||||
|
|
|
|||
|
|
@ -85,13 +85,7 @@ nir_lower_terminate_impl(nir_function_impl *impl)
|
|||
nir_builder b = nir_builder_create(impl);
|
||||
bool progress = nir_lower_terminate_cf_list(&b, &impl->body);
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_none);
|
||||
}
|
||||
|
||||
/** Lowers nir_intrinsic_terminate to demote + halt
|
||||
|
|
|
|||
|
|
@ -1791,7 +1791,7 @@ nir_lower_tex_impl(nir_function_impl *impl,
|
|||
progress |= nir_lower_tex_block(block, &builder, options, compiler_options);
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
nir_progress(true, impl, nir_metadata_control_flow);
|
||||
return progress;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ nir_lower_texcoord_replace_impl(nir_function_impl *impl,
|
|||
}
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
nir_progress(true, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -120,13 +120,8 @@ nir_lower_variable_initializers(nir_shader *shader, nir_variable_mode modes)
|
|||
nir_var_function_temp);
|
||||
}
|
||||
|
||||
if (impl_progress) {
|
||||
progress = true;
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow |
|
||||
nir_metadata_live_defs);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
progress |= nir_progress(impl_progress, impl,
|
||||
nir_metadata_control_flow | nir_metadata_live_defs);
|
||||
}
|
||||
|
||||
return progress;
|
||||
|
|
@ -201,9 +196,8 @@ nir_zero_initialize_shared_memory(nir_shader *shader,
|
|||
nir_barrier(&b, SCOPE_WORKGROUP, SCOPE_WORKGROUP, NIR_MEMORY_ACQ_REL,
|
||||
nir_var_mem_shared);
|
||||
|
||||
nir_metadata_preserve(nir_shader_get_entrypoint(shader), nir_metadata_none);
|
||||
|
||||
return true;
|
||||
return nir_progress(true, nir_shader_get_entrypoint(shader),
|
||||
nir_metadata_none);
|
||||
}
|
||||
|
||||
/** Clears all shared memory to zero at the end of the shader
|
||||
|
|
@ -294,7 +288,6 @@ nir_clear_shared_memory(nir_shader *shader,
|
|||
nir_builder_instr_insert(&b, &offset_phi->instr);
|
||||
}
|
||||
|
||||
nir_metadata_preserve(nir_shader_get_entrypoint(shader), nir_metadata_none);
|
||||
|
||||
return true;
|
||||
return nir_progress(true, nir_shader_get_entrypoint(shader),
|
||||
nir_metadata_none);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -833,8 +833,7 @@ nir_lower_vars_to_ssa_impl(nir_function_impl *impl)
|
|||
}
|
||||
|
||||
if (!progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
return false;
|
||||
return nir_no_progress(impl);
|
||||
}
|
||||
|
||||
nir_metadata_require(impl, nir_metadata_dominance);
|
||||
|
|
@ -882,7 +881,7 @@ nir_lower_vars_to_ssa_impl(nir_function_impl *impl)
|
|||
|
||||
nir_phi_builder_finish(state.phi_builder);
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
nir_progress(true, impl, nir_metadata_control_flow);
|
||||
|
||||
ralloc_free(state.dead_ctx);
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ void
|
|||
nir_shader_preserve_all_metadata(nir_shader *shader)
|
||||
{
|
||||
nir_foreach_function_impl(impl, shader) {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
nir_no_progress(impl);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -92,6 +92,5 @@ nir_move_output_stores_to_end(nir_shader *nir)
|
|||
progress = true;
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl, progress ? nir_metadata_control_flow : nir_metadata_all);
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ nir_move_vec_src_uses_to_dest_impl(nir_shader *shader, nir_function_impl *impl,
|
|||
progress |= move_vec_src_uses_to_dest_block(block, skip_const_srcs);
|
||||
}
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
nir_progress(true, impl, nir_metadata_control_flow);
|
||||
|
||||
return progress;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -277,14 +277,8 @@ opt_access_impl(struct access_state *state,
|
|||
}
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl,
|
||||
nir_metadata_control_flow |
|
||||
nir_metadata_live_defs |
|
||||
nir_metadata_loop_analysis);
|
||||
}
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl,
|
||||
nir_metadata_control_flow | nir_metadata_live_defs | nir_metadata_loop_analysis);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -323,12 +317,8 @@ nir_opt_access(nir_shader *shader, const nir_opt_access_options *options)
|
|||
progress |= opt_access_impl(&state, impl);
|
||||
|
||||
/* If we make a change to the uniforms, update all the impls. */
|
||||
if (var_progress) {
|
||||
nir_metadata_preserve(impl,
|
||||
nir_metadata_control_flow |
|
||||
nir_metadata_live_defs |
|
||||
nir_metadata_loop_analysis);
|
||||
}
|
||||
nir_progress(var_progress, impl,
|
||||
nir_metadata_control_flow | nir_metadata_live_defs | nir_metadata_loop_analysis);
|
||||
}
|
||||
|
||||
progress |= var_progress;
|
||||
|
|
|
|||
|
|
@ -70,14 +70,8 @@ nir_opt_combine_barriers_impl(nir_function_impl *impl,
|
|||
}
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow |
|
||||
nir_metadata_live_defs);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl,
|
||||
nir_metadata_control_flow | nir_metadata_live_defs);
|
||||
}
|
||||
|
||||
/* Combine adjacent scoped barriers. */
|
||||
|
|
@ -235,13 +229,9 @@ nir_opt_barrier_modes(nir_shader *shader)
|
|||
nir_metadata_require(impl, nir_metadata_dominance |
|
||||
nir_metadata_instr_index);
|
||||
|
||||
if (nir_opt_barrier_modes_impl(impl)) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow |
|
||||
nir_metadata_live_defs);
|
||||
progress = true;
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
bool impl_progress = nir_opt_barrier_modes_impl(impl);
|
||||
progress |= nir_progress(impl_progress, impl,
|
||||
nir_metadata_control_flow | nir_metadata_live_defs);
|
||||
}
|
||||
|
||||
return progress;
|
||||
|
|
|
|||
|
|
@ -245,8 +245,7 @@ nir_minimize_call_live_states_impl(nir_function_impl *impl)
|
|||
|
||||
ralloc_free(mem_ctx);
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_block_index |
|
||||
nir_metadata_dominance);
|
||||
nir_progress(true, impl, nir_metadata_block_index | nir_metadata_dominance);
|
||||
return progress;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -401,11 +401,8 @@ combine_stores_impl(struct combine_stores_state *state, nir_function_impl *impl)
|
|||
nir_foreach_block(block, impl)
|
||||
combine_stores_block(state, block);
|
||||
|
||||
if (state->progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
bool impl_progress = state->progress;
|
||||
nir_progress(impl_progress, impl, nir_metadata_control_flow);
|
||||
|
||||
return state->progress;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -384,13 +384,7 @@ nir_opt_comparison_pre_impl(nir_function_impl *impl)
|
|||
|
||||
block_queue_finish(&bq);
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -1510,11 +1510,8 @@ nir_copy_prop_vars_impl(nir_function_impl *impl)
|
|||
|
||||
copy_prop_vars_cf_node(&state, NULL, &impl->cf_node);
|
||||
|
||||
if (state.progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
bool impl_progress = state.progress;
|
||||
nir_progress(impl_progress, impl, nir_metadata_control_flow);
|
||||
|
||||
ralloc_free(mem_ctx);
|
||||
return state.progress;
|
||||
|
|
|
|||
|
|
@ -157,13 +157,7 @@ nir_copy_prop_impl(nir_function_impl *impl)
|
|||
}
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -53,11 +53,7 @@ nir_opt_cse_impl(nir_function_impl *impl)
|
|||
}
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
|
||||
nir_instr_set_destroy(instr_set);
|
||||
return progress;
|
||||
|
|
|
|||
|
|
@ -237,13 +237,7 @@ nir_opt_dce_impl(nir_function_impl *impl)
|
|||
|
||||
nir_instr_free_list(&dead_instrs);
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_control_flow);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return progress;
|
||||
return nir_progress(progress, impl, nir_metadata_control_flow);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -388,7 +388,7 @@ opt_dead_cf_impl(nir_function_impl *impl)
|
|||
bool progress = dead_cf_list(&impl->body, &dummy);
|
||||
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
nir_progress(true, impl, nir_metadata_none);
|
||||
nir_rematerialize_derefs_in_use_blocks_impl(impl);
|
||||
|
||||
/* The CF manipulation code called by this pass is smart enough to keep
|
||||
|
|
@ -402,7 +402,7 @@ opt_dead_cf_impl(nir_function_impl *impl)
|
|||
*/
|
||||
nir_repair_ssa_impl(impl);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
nir_no_progress(impl);
|
||||
}
|
||||
|
||||
return progress;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue