"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/compiler/nir/nir_opt_if.c" between
mesa-20.1.7.tar.xz and mesa-20.1.8.tar.xz

About: Mesa is an open-source implementation of the OpenGL specification - a system for rendering interactive 3D graphics (main library code). Latest release.

nir_opt_if.c  (mesa-20.1.7.tar.xz):nir_opt_if.c  (mesa-20.1.8.tar.xz)
skipping to change at line 1131 skipping to change at line 1131
static bool static bool
propagate_condition_eval(nir_builder *b, nir_if *nif, nir_src *use_src, propagate_condition_eval(nir_builder *b, nir_if *nif, nir_src *use_src,
nir_src *alu_use, nir_alu_instr *alu, nir_src *alu_use, nir_alu_instr *alu,
bool is_if_condition) bool is_if_condition)
{ {
bool bool_value; bool bool_value;
b->cursor = nir_before_src(alu_use, is_if_condition); b->cursor = nir_before_src(alu_use, is_if_condition);
if (!evaluate_if_condition(nif, b->cursor, &bool_value)) if (!evaluate_if_condition(nif, b->cursor, &bool_value))
return false; return false;
nir_ssa_def *def[4] = {0}; nir_ssa_def *def[NIR_MAX_VEC_COMPONENTS] = {0};
for (unsigned i = 0; i < nir_op_infos[alu->op].num_inputs; i++) { for (unsigned i = 0; i < nir_op_infos[alu->op].num_inputs; i++) {
if (alu->src[i].src.ssa == use_src->ssa) { if (alu->src[i].src.ssa == use_src->ssa) {
def[i] = nir_imm_bool(b, bool_value); def[i] = nir_imm_bool(b, bool_value);
} else { } else {
def[i] = alu->src[i].src.ssa; def[i] = alu->src[i].src.ssa;
} }
} }
nir_ssa_def *nalu = clone_alu_and_replace_src_defs(b, alu, def); nir_ssa_def *nalu = clone_alu_and_replace_src_defs(b, alu, def);
skipping to change at line 1279 skipping to change at line 1279
* *
* Note: This only merges if-statements when the block between them * Note: This only merges if-statements when the block between them
* is empty. The reason we don't try to merge ifs that just have phis * is empty. The reason we don't try to merge ifs that just have phis
* between them is because this can results in increased register * between them is because this can results in increased register
* pressure. For example when merging if ladders created by indirect * pressure. For example when merging if ladders created by indirect
* indexing. * indexing.
*/ */
if (nif->condition.ssa == next_if->condition.ssa && if (nif->condition.ssa == next_if->condition.ssa &&
exec_list_is_empty(&next_blk->instr_list)) { exec_list_is_empty(&next_blk->instr_list)) {
/* This optimization isn't made to work in this case and
* opt_if_evaluate_condition_use will optimize it later.
*/
if (nir_block_ends_in_jump(nir_if_last_then_block(nif)) ||
nir_block_ends_in_jump(nir_if_last_else_block(nif)))
return false;
simple_merge_if(nif, next_if, true, true); simple_merge_if(nif, next_if, true, true);
simple_merge_if(nif, next_if, false, false); simple_merge_if(nif, next_if, false, false);
nir_block *new_then_block = nir_if_last_then_block(nif); nir_block *new_then_block = nir_if_last_then_block(nif);
nir_block *new_else_block = nir_if_last_else_block(nif); nir_block *new_else_block = nir_if_last_else_block(nif);
nir_block *old_then_block = nir_if_last_then_block(next_if); nir_block *old_then_block = nir_if_last_then_block(next_if);
nir_block *old_else_block = nir_if_last_else_block(next_if); nir_block *old_else_block = nir_if_last_else_block(next_if);
/* Rewrite the predecessor block for any phis following the second /* Rewrite the predecessor block for any phis following the second
 End of changes. 2 change blocks. 
1 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)