[PATCH] D113183: [LV] Patch up induction phis after VPlan execution.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 4 05:31:12 PDT 2021


fhahn created this revision.
fhahn added reviewers: Ayal, gilr, rengolin.
Herald added subscribers: tschuett, psnobl, rogfer01, bollu, hiraditya.
fhahn requested review of this revision.
Herald added a subscriber: vkmr.
Herald added a project: LLVM.

This patch moves fixing up the incoming value of phis for
VPWidenIntOrFpInductionRecipes to after the VPlan is executed.

At the moment, the code in widenIntOrFpInduction relies on the vector
loop latch being created *before* the VPlan is executed. This prevents
us from modeling the vector latch, preheader and exit blocks in VPlan.

By patching up the incoming values for induction PHIs after VPlan
execution, we remove the need to create the latch up front. This enables
generating the vector latch directly from VPlan, which in turn is
required to enable modeling prehader and exit blocks.

The patch uses a workaround to access both the induction increment and
the vector phi for the recipe. It adds 2 new VPValues which are set to
them. While this is a temporary workaround, this will be removed once
the induction code generation is moved to work on VPlan more directly.
See D111303 <https://reviews.llvm.org/D111303> for the next step, making the induction increment explicit
as VPValue operand.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113183

Files:
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/lib/Transforms/Vectorize/VPlan.cpp
  llvm/lib/Transforms/Vectorize/VPlan.h
  llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113183.384718.patch
Type: text/x-patch
Size: 10874 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211104/7dfdab11/attachment.bin>


More information about the llvm-commits mailing list