nir: do not vectorize load/store if offset can overflow and robustness enabled

This prevents vectorization for loads/stores that can overflow if
the low offset is negative and the range greater or equal than 0.

The caller can pass the list of variable modes that matter for
robust access.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4881>
This commit is contained in:
Samuel Pitoiset
2020-05-04 16:02:38 +02:00
committed by Marge Bot
parent 3fba0a7a6f
commit 04718a9cd6
5 changed files with 48 additions and 7 deletions

View File

@@ -881,7 +881,8 @@ brw_vectorize_lower_mem_access(nir_shader *nir,
OPT(nir_opt_load_store_vectorize,
nir_var_mem_ubo | nir_var_mem_ssbo |
nir_var_mem_global | nir_var_mem_shared,
brw_nir_should_vectorize_mem);
brw_nir_should_vectorize_mem,
(nir_variable_mode)0);
}
OPT(brw_nir_lower_mem_access_bit_sizes, devinfo);