aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorDavid Sherwood <david.sherwood@arm.com>2025-01-15 12:47:43 +0000
committerGitHub <noreply@github.com>2025-01-15 12:47:43 +0000
commitbfedf6460c2cad6e6f966b457d8d27084579dcd8 (patch)
tree03d0cf5edaba86e2e2fcd828dbf3164959205b24 /flang/lib/Frontend/CompilerInvocation.cpp
parentf9350c9325bccb95e94583685bbb9322a15da610 (diff)
downloadllvm-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