[PATCH] D113122: [NFC][LoopVectorize] Make the createStepForVF interface more caller-friendly

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 3 09:10:25 PDT 2021


david-arm created this revision.
david-arm added reviewers: sdesmalen, kmclaughlin, RosieSumpter, bmahjour.
Herald added a subscriber: hiraditya.
david-arm requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The common use case for calling createStepForVF is currently something
like:

  Value *Step = createStepForVF(Builder, ConstantInt::get(Ty, UF), VF);

and it makes more sense to reduce overall lines of code and change the
function to let it create the constant instead. With my patch this
becomes:

  Value *Step = createStepForVF(Builder, Ty, VF, UF);

and the ConstantInt is created instead createStepForVF. A side-effect of
this is that the code in createStepForVF is also becomes simpler.

As part of this patch I've also replaced some calls to getRuntimeVF
with calls to createStepForVF, i.e.

  getRuntimeVF(Builder, Count->getType(), VFactor * UFactor) ->
  createStepForVF(Builder, Count->getType(), VFactor, UFactor)

because this feels semantically better.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113122

Files:
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113122.384471.patch
Type: text/x-patch
Size: 4509 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211103/baf48d62/attachment.bin>


More information about the llvm-commits mailing list