[all-commits] [llvm/llvm-project] 38d18d: [SVE] Add support to vectorize_width loop pragma f...

david-arm via All-commits all-commits at lists.llvm.org
Fri Jan 8 04:04:09 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 38d18d93534d290d045bbbfa86337e70f1139dc2
      https://github.com/llvm/llvm-project/commit/38d18d93534d290d045bbbfa86337e70f1139dc2
  Author: David Sherwood <david.sherwood at arm.com>
  Date:   2021-01-08 (Fri, 08 Jan 2021)

  Changed paths:
    M clang/docs/LanguageExtensions.rst
    M clang/include/clang/Basic/Attr.td
    M clang/include/clang/Basic/DiagnosticParseKinds.td
    M clang/lib/AST/AttrImpl.cpp
    M clang/lib/CodeGen/CGLoopInfo.cpp
    M clang/lib/CodeGen/CGLoopInfo.h
    M clang/lib/Parse/ParsePragma.cpp
    M clang/lib/Sema/SemaStmtAttr.cpp
    M clang/test/AST/ast-print-pragmas.cpp
    M clang/test/CodeGenCXX/pragma-loop-pr27643.cpp
    M clang/test/CodeGenCXX/pragma-loop.cpp
    M clang/test/Parser/pragma-loop.cpp

  Log Message:
  -----------
  [SVE] Add support to vectorize_width loop pragma for scalable vectors

This patch adds support for two new variants of the vectorize_width
pragma:

1. vectorize_width(X[, fixed|scalable]) where an optional second
parameter is passed to the vectorize_width pragma, which indicates if
the user wishes to use fixed width or scalable vectorization. For
example the user can now write something like:

  #pragma clang loop vectorize_width(4, fixed)
or
  #pragma clang loop vectorize_width(4, scalable)

In the absence of a second parameter it is assumed the user wants
fixed width vectorization, in order to maintain compatibility with
existing code.
2. vectorize_width(fixed|scalable) where the width is left unspecified,
but the user hints what type of vectorization they prefer, either
fixed width or scalable.

I have implemented this by making use of the LLVM loop hint attribute:

  llvm.loop.vectorize.scalable.enable

Tests were added to

  clang/test/CodeGenCXX/pragma-loop.cpp

for both the 'fixed' and 'scalable' optional parameter.

See this thread for context: http://lists.llvm.org/pipermail/cfe-dev/2020-November/067262.html

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




More information about the All-commits mailing list