From: Caio Marcelo de Oliveira Filho Date: Sat, 26 Jan 2019 09:05:14 +0000 (-0800) Subject: nir: keep the phi order when splitting blocks X-Git-Tag: upstream/19.3.0~10047 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=51547bbc5a6d889d1d1824c88ac7d0a4b172df55;p=platform%2Fupstream%2Fmesa.git nir: keep the phi order when splitting blocks All things being equal is better to keep the original order. Since the new block is empty, push the phis in order to tail. Reviewed-by: Jason Ekstrand Reviewed-by: Daniel Schürmann --- diff --git a/src/compiler/nir/nir_control_flow.c b/src/compiler/nir/nir_control_flow.c index ddba2e5..252aaf3 100644 --- a/src/compiler/nir/nir_control_flow.c +++ b/src/compiler/nir/nir_control_flow.c @@ -195,8 +195,7 @@ split_block_beginning(nir_block *block) } /* Any phi nodes must stay part of the new block, or else their - * sourcse will be messed up. This will reverse the order of the phis, but - * order shouldn't matter. + * sources will be messed up. */ nir_foreach_instr_safe(instr, block) { if (instr->type != nir_instr_type_phi) @@ -204,7 +203,7 @@ split_block_beginning(nir_block *block) exec_node_remove(&instr->node); instr->block = new_block; - exec_list_push_head(&new_block->instr_list, &instr->node); + exec_list_push_tail(&new_block->instr_list, &instr->node); } return new_block;