[PATCH] D138636: [LSR] Hoist IVInc to loop header if its all uses are in the loop header

chenglin.bi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 23 21:03:55 PST 2022


bcl5980 created this revision.
bcl5980 added reviewers: fhahn, nikic, craig.topper, dmgreen, reames, Meinersbur.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
bcl5980 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

When the latch block is different from header block, IVInc will be expanded in the latch loop. We can't generate the post index load/store this case.
But if the IVInc only used in the loop, actually we still can use the post index load/store because when exit loop we don't care the last IVInc value.
So, trying to hoist IVInc to help backend to generate more post index load/store.

Fix #53625


https://reviews.llvm.org/D138636

Files:
  llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
  llvm/test/Transforms/LoopStrengthReduce/AArch64/pr53625.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138636.477680.patch
Type: text/x-patch
Size: 5369 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221124/d2b7602e/attachment-0001.bin>


More information about the llvm-commits mailing list