diff options
-rw-r--r-- | src/compiler/nir/nir_opt_algebraic.py | 4 | ||||
-rw-r--r-- | src/compiler/nir/nir_search_helpers.h | 15 |
2 files changed, 1 insertions, 18 deletions
diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index b9565cea7b7..96232f0e549 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -208,9 +208,7 @@ optimizations = [ # fmax. If b is > 1.0, the bcsel will be replaced with a b2f. (('fmin', ('b2f', a), '#b'), ('bcsel', a, ('fmin', b, 1.0), ('fmin', b, 0.0))), - # ignore this opt when the result is used by a bcsel or if so we can make - # use of conditional modifiers on supported hardware. - (('flt(is_not_used_by_conditional)', ('fadd(is_used_once)', a, ('fneg', b)), 0.0), ('flt', a, b)), + (('flt', ('fadd(is_used_once)', a, ('fneg', b)), 0.0), ('flt', a, b)), (('fge', ('fneg', ('fabs', a)), 0.0), ('feq', a, 0.0)), (('~bcsel', ('flt', b, a), b, a), ('fmin', a, b)), diff --git a/src/compiler/nir/nir_search_helpers.h b/src/compiler/nir/nir_search_helpers.h index 2e3bd137d6d..2d399bd5dcd 100644 --- a/src/compiler/nir/nir_search_helpers.h +++ b/src/compiler/nir/nir_search_helpers.h @@ -170,19 +170,4 @@ is_not_used_by_if(nir_alu_instr *instr) return list_empty(&instr->dest.dest.ssa.if_uses); } -static inline bool -is_not_used_by_conditional(nir_alu_instr *instr) -{ - if (!is_not_used_by_if(instr)) - return false; - - nir_foreach_use(use, &instr->dest.dest.ssa) { - if (use->parent_instr->type == nir_instr_type_alu && - nir_instr_as_alu(use->parent_instr)->op == nir_op_bcsel) - return false; - } - - return true; -} - #endif /* _NIR_SEARCH_ */ |