nir/opt_algebraic: add redundant u2u32/unpack_64_2x32_split_x patterns

reduces hello world kernel 57 -> 44 inst on jay. why do we have two opcodes that
do literally the same thing? :/

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41085>
This commit is contained in:
Alyssa Rosenzweig 2026-04-21 13:59:42 -04:00 committed by Marge Bot
parent e65e62b17f
commit 6a43e6c9e0

View file

@ -2231,9 +2231,13 @@ optimizations.extend([
# Reduce intermediate precision with int64.
(('u2u32', ('iadd(is_used_once)', 'a@64', b)),
('iadd', ('u2u32', a), ('u2u32', b))),
(('unpack_64_2x32_split_x', ('iadd(is_used_once)', 'a@64', b)),
('iadd', ('u2u32', a), ('u2u32', b))),
(('u2u32', ('imul(is_used_once)', 'a@64', b)),
('imul', ('u2u32', a), ('u2u32', b))),
(('unpack_64_2x32_split_x', ('imul(is_used_once)', 'a@64', b)),
('imul', ('u2u32', a), ('u2u32', b))),
(('u2f32', ('u2u64', 'a@32')), ('u2f32', a)),