Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
{
nir_block *block_begin, *block_end, *block_before, *block_after;
{
nir_block *block_begin, *block_end, *block_before, *block_after;
+ if (nir_cursors_equal(begin, end)) {
+ exec_list_make_empty(&extracted->list);
+ extracted->impl = NULL; /* we shouldn't need this */
+ return;
+ }
+
/* In the case where begin points to an instruction in some basic block and
* end points to the end of the same basic block, we rely on the fact that
* splitting on an instruction moves earlier instructions into a new basic
/* In the case where begin points to an instruction in some basic block and
* end points to the end of the same basic block, we rely on the fact that
* splitting on an instruction moves earlier instructions into a new basic
{
nir_block *before, *after;
{
nir_block *before, *after;
+ if (exec_list_is_empty(&cf_list->list))
+ return;
+
split_block_cursor(cursor, &before, &after);
foreach_list_typed_safe(nir_cf_node, node, node, &cf_list->list) {
split_block_cursor(cursor, &before, &after);
foreach_list_typed_safe(nir_cf_node, node, node, &cf_list->list) {