[PATCH] D108114: [LoopPeel] Peel if it turns invariant loads dereferenceable.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 8 02:23:00 PDT 2021
fhahn updated this revision to Diff 378137.
fhahn added a comment.
In D108114#3050318 <https://reviews.llvm.org/D108114#3050318>, @nikic wrote:
> Shouldn't there be a check somewhere whether the load is already dereferenceable, in which case we presumably don't want to peel it?
I added a check using `isDereferenceablePointer` to catch some cases where the load is guaranteed to be dereferenceable. This is still quite weak, but in practice I think most dereferenceable loads should be moved out of the loop before we check for peeling (especailly given the restriction to read only loops at the moment).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D108114/new/
https://reviews.llvm.org/D108114
Files:
llvm/include/llvm/Transforms/Utils/LoopPeel.h
llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
llvm/lib/Transforms/Utils/LoopPeel.cpp
llvm/test/Transforms/LoopUnroll/peel-to-turn-invariant-accesses-dereferenceable.ll
llvm/test/Transforms/PhaseOrdering/AArch64/peel-multiple-unreachable-exits-for-vectorization.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108114.378137.patch
Type: text/x-patch
Size: 28737 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211008/27469c9b/attachment.bin>
More information about the llvm-commits
mailing list