[PATCH] D119661: [LV] Support chained phis as incoming values for first-order recurs.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 1 03:52:50 PDT 2022


fhahn updated this revision to Diff 448982.
fhahn added a comment.

Ping.

Rebased the patch and also updated it to remember any header phis. Corresponding tests have been added in ff5ae948a7230 <https://reviews.llvm.org/rGff5ae948a72307fcd6b3be9ddf2d3b9349e02caf> & 6e1ba62d0dd <https://reviews.llvm.org/rG6e1ba62d0dd27686aa7779a122e04ac5abc6cecf>. I have also added additional runtime testing to llvm-test-suite in rT1846f600f7db <https://reviews.llvm.org/rT1846f600f7dbd41e82ee7961ab57556a0240bb25>.

Note that the current handling is geared towards chains for first order recurrences. This means we widen each first-order recurrence separately and use the incoming value of the previous recurrence in the chain for the current one.

This should be different to modeling a whole chain as a 2nd or higher order recurrence, for which we may be able to generate a single recurrence phi for the whole chain. The approach in the current patch focuses on the case where each phi in the chain has other users, so we would need to generate recurrence phis for each phi in the chain anyways. Dedicated higher-order recurrence support can be added as follow-up, but I expect the gains in practice to be limited.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119661/new/

https://reviews.llvm.org/D119661

Files:
  llvm/lib/Analysis/IVDescriptors.cpp
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Transforms/LoopVectorize/first-order-recurrence-chains-vplan.ll
  llvm/test/Transforms/LoopVectorize/first-order-recurrence-chains.ll
  llvm/test/Transforms/LoopVectorize/first-order-recurrence.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119661.448982.patch
Type: text/x-patch
Size: 49675 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220801/d47bfcfb/attachment.bin>


More information about the llvm-commits mailing list