[all-commits] [llvm/llvm-project] c42bb3: [LoopVectorize] Permit fixed-width epilogue loops ...

david-arm via All-commits all-commits at lists.llvm.org
Mon Nov 8 01:41:27 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c42bb30b9e2950efd1d1bd2df9ab8e5b098e65c7
      https://github.com/llvm/llvm-project/commit/c42bb30b9e2950efd1d1bd2df9ab8e5b098e65c7
  Author: David Sherwood <david.sherwood at arm.com>
  Date:   2021-11-08 (Mon, 08 Nov 2021)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    A llvm/test/Transforms/LoopVectorize/AArch64/sve-epilog-vect.ll
    M llvm/test/Transforms/LoopVectorize/optimal-epilog-vectorization-scalable.ll

  Log Message:
  -----------
  [LoopVectorize] Permit fixed-width epilogue loops for scalable vector bodies

At the moment in LoopVectorizationCostModel::selectEpilogueVectorizationFactor
we bail out if the main vector loop uses a scalable VF. This patch adds
support for generating epilogue vector loops using a fixed-width VF when the
main vector loop uses a scalable VF.

I've changed LoopVectorizationCostModel::selectEpilogueVectorizationFactor
so that we convert the scalable VF into a fixed-width VF and do profitability
checks on that instead. In addition, since the scalable and fixed-width VFs
live in different VPlans that means I had to change the calls to
LVP.hasPlanWithVFs so that we only pass in the fixed-width VF.

New tests added here:

  Transforms/LoopVectorize/AArch64/sve-epilog-vect.ll

Differential Revision: https://reviews.llvm.org/D109432




More information about the All-commits mailing list