nir: Recognize (a < c || b < c) as min(a, b) < c.
... and (a >= c) || (b >= c) as max(a, b) >= c.
Similar to commit 97e6c1b9
.
total instructions in shared programs: 6182276 -> 6182180 (-0.00%)
instructions in affected programs: 6400 -> 6304 (-1.50%)
helped: 68
HURT: 4
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
This commit is contained in:
parent
ceb8b739ce
commit
f5cf74d8ba
|
@ -101,7 +101,9 @@ optimizations = [
|
||||||
(('fsat', ('fsat', a)), ('fsat', a)),
|
(('fsat', ('fsat', a)), ('fsat', a)),
|
||||||
(('fmin', ('fmax', ('fmin', ('fmax', a, 0.0), 1.0), 0.0), 1.0), ('fmin', ('fmax', a, 0.0), 1.0)),
|
(('fmin', ('fmax', ('fmin', ('fmax', a, 0.0), 1.0), 0.0), 1.0), ('fmin', ('fmax', a, 0.0), 1.0)),
|
||||||
(('ior', ('flt', a, b), ('flt', a, c)), ('flt', a, ('fmax', b, c))),
|
(('ior', ('flt', a, b), ('flt', a, c)), ('flt', a, ('fmax', b, c))),
|
||||||
|
(('ior', ('flt', a, c), ('flt', b, c)), ('flt', ('fmin', a, b), c)),
|
||||||
(('ior', ('fge', a, b), ('fge', a, c)), ('fge', a, ('fmin', b, c))),
|
(('ior', ('fge', a, b), ('fge', a, c)), ('fge', a, ('fmin', b, c))),
|
||||||
|
(('ior', ('fge', a, c), ('fge', b, c)), ('fge', ('fmax', a, b), c)),
|
||||||
(('slt', a, b), ('b2f', ('flt', a, b)), 'options->lower_scmp'),
|
(('slt', a, b), ('b2f', ('flt', a, b)), 'options->lower_scmp'),
|
||||||
(('sge', a, b), ('b2f', ('fge', a, b)), 'options->lower_scmp'),
|
(('sge', a, b), ('b2f', ('fge', a, b)), 'options->lower_scmp'),
|
||||||
(('seq', a, b), ('b2f', ('feq', a, b)), 'options->lower_scmp'),
|
(('seq', a, b), ('b2f', ('feq', a, b)), 'options->lower_scmp'),
|
||||||
|
|
Loading…
Reference in New Issue