[all-commits] [llvm/llvm-project] bfedf6: [LoopVectorize] Add support for reverse loops in i...
David Sherwood via All-commits
all-commits at lists.llvm.org
Wed Jan 15 04:48:06 PST 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: bfedf6460c2cad6e6f966b457d8d27084579dcd8
https://github.com/llvm/llvm-project/commit/bfedf6460c2cad6e6f966b457d8d27084579dcd8
Author: David Sherwood <david.sherwood at arm.com>
Date: 2025-01-15 (Wed, 15 Jan 2025)
Changed paths:
M llvm/include/llvm/Analysis/LoopAccessAnalysis.h
M llvm/lib/Analysis/Loads.cpp
M llvm/lib/Analysis/LoopAccessAnalysis.cpp
M llvm/test/Transforms/LoopVectorize/X86/load-deref-pred.ll
M llvm/test/Transforms/LoopVectorize/load-deref-pred-align.ll
Log Message:
-----------
[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.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list