radv: Use before/after_cf_list for entrypoints
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Tue, 29 Aug 2023 12:39:50 +0000 (08:39 -0400)
committerMarge Bot <emma+marge@anholt.net>
Wed, 30 Aug 2023 19:30:58 +0000 (19:30 +0000)
Via Coccinelle patch:

    @@
    expression shader;
    @@

    -nir_before_cf_list(&nir_shader_get_entrypoint(shader)->body)
    +nir_before_impl(nir_shader_get_entrypoint(shader))

    @@
    expression shader;
    @@

    -nir_after_cf_list(&nir_shader_get_entrypoint(shader)->body)
    +nir_after_impl(nir_shader_get_entrypoint(shader))

Suggested-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24910>

src/amd/vulkan/radv_pipeline_rt.c

index c86ea3a..9e5e998 100644 (file)
@@ -331,7 +331,7 @@ should_move_rt_instruction(nir_intrinsic_op intrinsic)
 static void
 move_rt_instructions(nir_shader *shader)
 {
-   nir_cursor target = nir_before_cf_list(&nir_shader_get_entrypoint(shader)->body);
+   nir_cursor target = nir_before_impl(nir_shader_get_entrypoint(shader));
 
    nir_foreach_block (block, nir_shader_get_entrypoint(shader)) {
       nir_foreach_instr_safe (instr, block) {
@@ -382,7 +382,7 @@ radv_rt_nir_to_asm(struct radv_device *device, struct vk_pipeline_cache *cache,
    nir_shader **resume_shaders = NULL;
 
    if (stage->stage != MESA_SHADER_INTERSECTION) {
-      nir_builder b = nir_builder_at(nir_after_cf_list(&nir_shader_get_entrypoint(stage->nir)->body));
+      nir_builder b = nir_builder_at(nir_after_impl(nir_shader_get_entrypoint(stage->nir)));
       nir_rt_return_amd(&b);
 
       const nir_lower_shader_calls_options opts = {