Skip to content

nir/load_store_vectorize: improve vectorization with identical operations

We might have several identical options to vectorize an entry with, but only one might be vectorizable because of writes interfering.

An example of this is a pattern found in some CTS tests:

a = load(0)
b = load(4)
store(0, a)
store(4, b)
a = load(0)
b = load(4)
store(0, a)
store(4, b)
...

It might have attempted to vectorize the first load(0) with the second load(4) without attempting the second load(4) when the first fails. This changes vectorize_entries() to continue even if the first try_vectorize() failed.

fossil-db (Navi):

Totals from 130 (0.10% of 128321) affected shaders:
SGPRs: 8288 -> 8344 (+0.68%); split: -0.10%, +0.77%
VGPRs: 4940 -> 4932 (-0.16%)
CodeSize: 384228 -> 384160 (-0.02%); split: -0.03%, +0.01%
MaxWaves: 1800 -> 1804 (+0.22%)
Instrs: 72299 -> 72287 (-0.02%); split: -0.03%, +0.02%

Merge request reports