diff options
| author | Kerry McLaughlin <kerry.mclaughlin@arm.com> | 2025-10-22 15:21:27 +0100 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-22 15:21:27 +0100 | 
| commit | 45c0b29171633e3977938ded4223d9184af5c07b (patch) | |
| tree | bbaf1a9ebcccdfc44e339983db40d517860487ec /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
| parent | f7bbcdea8e9c0cb17e44c3920631eaad449f3229 (diff) | |
| download | llvm-45c0b29171633e3977938ded4223d9184af5c07b.zip llvm-45c0b29171633e3977938ded4223d9184af5c07b.tar.gz llvm-45c0b29171633e3977938ded4223d9184af5c07b.tar.bz2  | |
[LV] Ignore user-specified interleave count when unsafe. (#153009)
When an VF is specified via a loop hint, it will be clamped to a safe
VF or ignored if it is found to be unsafe. This is not the case for
user-specified interleave counts, which can lead to loops such as
the following with a memory dependence being vectorised with
interleaving:
```
#pragma clang loop interleave_count(4)
for (int i = 4; i < LEN; i++)
    b[i] = b[i - 4] + a[i];
```
According to [1], loop hints are ignored if they are not safe to apply.
This patch adds a check to prevent vectorisation with interleaving if
isSafeForAnyVectorWidth() returns false. This is already checked in
selectInterleaveCount().
[1]
https://llvm.org/docs/LangRef.html#llvm-loop-vectorize-and-llvm-loop-interleave
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions
