nir/opt_if: Use block_ends_in_jump
authorFaith Ekstrand <faith.ekstrand@collabora.com>
Tue, 23 May 2023 19:37:21 +0000 (14:37 -0500)
committerMarge Bot <emma+marge@anholt.net>
Thu, 22 Jun 2023 19:55:49 +0000 (19:55 +0000)
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23782>

src/compiler/nir/nir_opt_if.c

index f640baf..6711645 100644 (file)
@@ -195,8 +195,7 @@ opt_peel_loop_initial_if(nir_loop *loop)
     */
    foreach_list_typed(nir_cf_node, cf_node, node, entry_list) {
       nir_foreach_block_in_cf_node(block, cf_node) {
-         nir_instr *last_instr = nir_block_last_instr(block);
-         if (last_instr && last_instr->type == nir_instr_type_jump)
+         if (nir_block_ends_in_jump(block))
             return false;
       }
    }