[PATCH] D98849: [LV] Compute ranges for plans up front (NFC).

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 18 03:14:15 PDT 2021


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

This patch introduces a new helper to compute the ranges of VFs with
matching decisions for all instructions up front. This will be used in a
follow-up patch to get rid of the VF range clamping during recipe
creation, enabling us to move to more granular VPlan construction.

The current version just adds the new helper and adds assertions to
ensure it gives the same result as the current clamping, in order to
catch any potential gaps.

This extra work is only needed temporarily and it appears to be
compile-time neutral:
http://llvm-compile-time-tracker.com/compare.php?from=7c7f4676cd421b1d64145eebfed11e5a3d8935d7&to=80d7088723fcfcd4ac80235bdbd57b70156b997f&stat=instructions

Note that this means the logic to apply the decisions is becoming a bit
more spread out initially. But in future patches, we can do the
decisions exclusively up-front (e.g. by creating a map which contains
whether to widen, scalarize or clone for each instruction in the loop).
This would allow us to untangle recipe creation from the cost-model
specifics as follow-up.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98849

Files:
  llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/lib/Transforms/Vectorize/VPRecipeBuilder.h
  llvm/lib/Transforms/Vectorize/VPlan.h
  llvm/test/Transforms/LoopVectorize/X86/phis-only.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98849.331501.patch
Type: text/x-patch
Size: 15636 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210318/54bde6f2/attachment.bin>


More information about the llvm-commits mailing list