nir/opt_vectorize_load_store: allow sizes unaligned with high offset for loads

This was added specifically for vectorized stores, so allow for loads.

Without this, the pass will fail to vectorize 2 consecutive 16-bit loads
into a single 32-bit load.

Fixes: 2ed79f80ba ("nir/load_store_vectorize: Skip new bit-sizes that are unaligned with high_offset")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
(cherry picked from commit f6a2d14008)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39828>
This commit is contained in:
Iago Toral Quiroga 2026-02-05 09:34:48 +01:00 committed by Marge Bot
parent 3442ccdcba
commit 6e899b3eba
2 changed files with 2 additions and 2 deletions

View file

@ -1304,7 +1304,7 @@
"description": "nir/opt_vectorize_load_store: allow sizes unaligned with high offset for loads",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "2ed79f80ba894bba0d340708c326ac9d59d5795e",
"notes": null

View file

@ -821,7 +821,7 @@ new_bitsize_acceptable(struct vectorize_ctx *ctx, unsigned new_bit_size,
unsigned high_offset = get_offset_diff(low, high);
/* This can cause issues when combining store data. */
if (high_offset % (new_bit_size / 8) != 0)
if (low->is_store && (high_offset % (new_bit_size / 8) != 0))
return false;
/* check nir_extract_bits limitations */