nir: intel/compiler: Move ufind_msb lowering to NIR

Fossil-db results:

All Intel platforms had similar results. (Ice Lake shown)
Cycles in all programs: 9098346105 -> 9098333765 (-0.0%)
Cycles helped: 6

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
This commit is contained in:
Ian Romanick
2022-10-10 13:21:52 -07:00
committed by Marge Bot
parent a4052e70ea
commit 28311f9d02
5 changed files with 7 additions and 53 deletions

View File

@@ -3413,6 +3413,8 @@ typedef struct nir_shader_compiler_options {
bool lower_find_msb_to_reverse;
/** Lowers ifind_msb to uclz and logic ops*/
bool lower_ifind_msb_to_uclz;
/** Lowers ufind_msb to 31-uclz */
bool lower_ufind_msb_to_uclz;
/** Lowers find_lsb to ufind_msb and logic ops */
bool lower_find_lsb;
bool lower_uadd_carry;

View File

@@ -2041,6 +2041,10 @@ optimizations.extend([
('ufind_msb_rev', 'value')),
'options->lower_find_msb_to_reverse'),
(('ufind_msb', 'value@32'),
('isub', 31, ('uclz', 'value')),
'options->lower_ufind_msb_to_uclz'),
(('uclz', a), ('umin', 32, ('ufind_msb_rev', a)), 'options->lower_uclz'),
(('find_lsb', 'value'),