[PATCH] D125810: [LV] Do not LoopSimplify/LCSSA after generating main vector loop.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 17 09:59:46 PDT 2022


fhahn created this revision.
fhahn added reviewers: bmahjour, gilr, Ayal, Meinersbur.
Herald added subscribers: rogfer01, bollu, hiraditya, nemanjai.
Herald added a project: All.
fhahn requested review of this revision.
Herald added subscribers: llvm-commits, vkmr.
Herald added a project: LLVM.

At the moment LV runs LoopSimplify and reconstructs LCSSA form after
generating the main vector loop and before generating the epilogue
vector loop.

In practice, this adds a new exit block for the scalar loop because the
middle block now also branches to the original exit block of the scalar
loop. It also requires adding a new LCSSA phi in the newly created exit
block.

This complicates things when modeling exit values in VPlan, because we
would need to update the VPlan for the epilogue loop to update the newly
created LCSSA phi node.

But none of that should be necessary, as all analysis requiring
loop-simplify form is already done at this point and LCSSA form of the
original loop is not broken.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125810

Files:
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Transforms/LoopVectorize/AArch64/sve-epilog-vect-inloop-reductions.ll
  llvm/test/Transforms/LoopVectorize/AArch64/sve-epilog-vect-reductions.ll
  llvm/test/Transforms/LoopVectorize/AArch64/sve-epilog-vect-strict-reductions.ll
  llvm/test/Transforms/LoopVectorize/AArch64/sve-epilog-vect.ll
  llvm/test/Transforms/LoopVectorize/PowerPC/optimal-epilog-vectorization.ll
  llvm/test/Transforms/LoopVectorize/X86/invariant-load-gather.ll
  llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
  llvm/test/Transforms/LoopVectorize/X86/limit-vf-by-tripcount.ll
  llvm/test/Transforms/LoopVectorize/X86/masked_load_store.ll
  llvm/test/Transforms/LoopVectorize/epilog-vectorization-reductions.ll
  llvm/test/Transforms/LoopVectorize/optimal-epilog-vectorization-liveout.ll
  llvm/test/Transforms/LoopVectorize/optimal-epilog-vectorization.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125810.430104.patch
Type: text/x-patch
Size: 89853 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220517/105040f0/attachment.bin>


More information about the llvm-commits mailing list