nir: delete not needed for reinserted nir_cf_list
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Thu, 5 Jul 2018 20:02:30 +0000 (13:02 -0700)
committerRafael Antognolli <rafael.antognolli@intel.com>
Thu, 12 Jul 2018 21:03:51 +0000 (14:03 -0700)
It wasn't causing problems since there's nothing to delete, but better
be consistent with the rest of existing codebase.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir_opt_if.c

index ec5bf1c902742b4f980d8a980d5e7eac45e9e2b3..a52de120ad624aec0a708299bf14755ee9bdc98b 100644 (file)
@@ -279,7 +279,6 @@ opt_if_simplification(nir_builder *b, nir_if *nif)
    nir_cf_extract(&tmp, nir_before_cf_list(&nif->else_list),
                         nir_after_cf_list(&nif->else_list));
    nir_cf_reinsert(&tmp, nir_before_cf_list(&nif->then_list));
-   nir_cf_delete(&tmp);
 
    return true;
 }
@@ -345,7 +344,6 @@ opt_if_loop_terminator(nir_if *nif)
    nir_cf_extract(&tmp, nir_before_block(first_continue_from_blk),
                         nir_after_block(continue_from_blk));
    nir_cf_reinsert(&tmp, nir_after_cf_node(&nif->cf_node));
-   nir_cf_delete(&tmp);
 
    return true;
 }