nir/range_analysis: Handle vectors better in ssa_def_bits_used

If a query is made of a vector ssa_def (possibly from an intermediate
result), return all_bits.  If a constant source is a vector, swizzle
the correct component.

Unit tests were added for the constant vector cases.  I don't see a
great way to make unit tests for the other cases.

v2: Add a FINIHSME comment about u16vec2 hardware.

Fixes: 96303a59ea ("nir: Add some range analysis for used bits")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9123>
This commit is contained in:
Ian Romanick
2021-02-17 19:40:07 -08:00
committed by Marge Bot
parent ce649e54f1
commit f2656569c6
3 changed files with 306 additions and 4 deletions

View File

@@ -485,4 +485,17 @@ if with_tests
),
suite : ['compiler', 'nir'],
)
test(
'ssa_def_bits_used',
executable(
'ssa_def_bits_used',
files('tests/ssa_def_bits_used_tests.cpp'),
c_args : [c_msvc_compat_args, no_override_init_args],
gnu_symbol_visibility : 'hidden',
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
),
suite : ['compiler', 'nir'],
)
endif