diff options
author | David Sherwood <david.sherwood@arm.com> | 2025-01-15 12:47:43 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-15 12:47:43 +0000 |
commit | bfedf6460c2cad6e6f966b457d8d27084579dcd8 (patch) | |
tree | 03d0cf5edaba86e2e2fcd828dbf3164959205b24 /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | f9350c9325bccb95e94583685bbb9322a15da610 (diff) | |
download | llvm-bfedf6460c2cad6e6f966b457d8d27084579dcd8.zip llvm-bfedf6460c2cad6e6f966b457d8d27084579dcd8.tar.gz llvm-bfedf6460c2cad6e6f966b457d8d27084579dcd8.tar.bz2 |
[LoopVectorize] Add support for reverse loops in isDereferenceableAndAlignedInLoop (#96752)
Currently when we encounter a negative step in the induction
variable isDereferenceableAndAlignedInLoop bails out because
the element size is signed greater than the step. This patch
adds support for negative steps in cases where we detect the
start address for the load is of the form base + offset. In
this case the address decrements in each iteration so we need
to calculate the access size differently. I have done this by
caling getStartAndEndForAccess from LoopAccessAnalysis.cpp.
The motivation for this patch comes from PR #88385 where a
reviewer requested reusing isDereferenceableAndAlignedInLoop,
but that PR itself does support reverse loops.
The changed test in LoopVectorize/X86/load-deref-pred.ll now
passes because previously we were calculating the total access
size incorrectly, whereas now it is 412 bytes and fits
perfectly into the alloca.
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions