mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 03:40:10 +01:00
nir: Optimize useless comparisons against true/false.
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com> [v1]
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
v2: Move new rule to Boolean simplification section
Add a a@bool != true simplification
Suggested-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
parent
9e9e6fc8f1
commit
3a7f95b3aa
1 changed files with 4 additions and 2 deletions
|
|
@ -184,8 +184,10 @@ optimizations = [
|
|||
(('fsqrt', a), ('frcp', ('frsq', a)), 'options->lower_fsqrt'),
|
||||
(('frcp', ('frsq', a)), ('fsqrt', a), '!options->lower_fsqrt'),
|
||||
# Boolean simplifications
|
||||
(('ine', 'a@bool', 0), 'a'),
|
||||
(('ieq', 'a@bool', 0), ('inot', 'a')),
|
||||
(('ieq', 'a@bool', True), a),
|
||||
(('ine', 'a@bool', True), ('inot', a)),
|
||||
(('ine', 'a@bool', False), a),
|
||||
(('ieq', 'a@bool', False), ('inot', 'a')),
|
||||
(('bcsel', a, True, False), ('ine', a, 0)),
|
||||
(('bcsel', a, False, True), ('ieq', a, 0)),
|
||||
(('bcsel', True, b, c), b),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue