[all-commits] [llvm/llvm-project] a75124: [LV] Prevent vectorization with unsupported elemen...

kmclaughlin-arm via All-commits all-commits at lists.llvm.org
Tue Jul 6 05:33:48 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a7512401e5a2cc7a1d0805fc4daf0c808e9d502d
      https://github.com/llvm/llvm-project/commit/a7512401e5a2cc7a1d0805fc4daf0c808e9d502d
  Author: Kerry McLaughlin <kerry.mclaughlin at arm.com>
  Date:   2021-07-06 (Tue, 06 Jul 2021)

  Changed paths:
    M llvm/include/llvm/Analysis/TargetTransformInfo.h
    M llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
    M llvm/lib/Analysis/TargetTransformInfo.cpp
    M llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
    M llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    M llvm/test/Transforms/LoopVectorize/AArch64/scalable-reductions.ll
    A llvm/test/Transforms/LoopVectorize/AArch64/sve-illegal-type.ll

  Log Message:
  -----------
  [LV] Prevent vectorization with unsupported element types.

This patch adds a TTI function, isElementTypeLegalForScalableVector, to query
whether it is possible to vectorize a given element type. This is called by
isLegalToVectorizeInstTypesForScalable to reject scalable vectorization if
any of the instruction types in the loop are unsupported, e.g:

  int foo(__int128_t* ptr, int N)
    #pragma clang loop vectorize_width(4, scalable)
    for (int i=0; i<N; ++i)
      ptr[i] = ptr[i] + 42;

This example currently crashes if we attempt to vectorize since i128 is not a
supported type for scalable vectorization.

Reviewed By: sdesmalen, david-arm

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




More information about the All-commits mailing list