nir/tests: add tests for umod/imod/irem optimizations

Both nir_opt_algebraic and nir_opt_idiv_const have optimizations for
umod/imod/irem by constants.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12039>
This commit is contained in:
Rhys Perry
2021-07-27 19:33:34 +01:00
committed by Marge Bot
parent e008eb1224
commit d764de6460
2 changed files with 199 additions and 0 deletions

View File

@@ -519,4 +519,17 @@ if with_tests
),
suite : ['compiler', 'nir'],
)
test(
'algebraic',
executable(
'algebraic',
files('tests/algebraic_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