[all-commits] [llvm/llvm-project] 95ac3d: [AArch64][GlobalISel] Add G_VECREDUCE fewerElement...

Amara Emerson via All-commits all-commits at lists.llvm.org
Thu Aug 19 16:39:09 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 95ac3d15e9fe86d9b51b51d02cb3c1640bf30dee
      https://github.com/llvm/llvm-project/commit/95ac3d15e9fe86d9b51b51d02cb3c1640bf30dee
  Author: Amara Emerson <amara at apple.com>
  Date:   2021-08-19 (Thu, 19 Aug 2021)

  Changed paths:
    M llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
    M llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
    M llvm/lib/CodeGen/MachineVerifier.cpp
    M llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
    A llvm/test/CodeGen/AArch64/GlobalISel/legalize-reduce-or.mir
    M llvm/test/CodeGen/AArch64/GlobalISel/legalizer-info-validation.mir
    M llvm/test/CodeGen/AArch64/reduce-or.ll
    M llvm/test/MachineVerifier/test_vector_reductions.mir

  Log Message:
  -----------
  [AArch64][GlobalISel] Add G_VECREDUCE fewerElements support for full scalarization.

For some reductions like G_VECREDUCE_OR on AArch64, we need to scalarize
completely if the source is <= 64b. This change adds support for that in
the legalizer. If the source has a pow-2 num elements, then we can do
a tree reduction using the scalar operation in the individual elements.
Otherwise, we just create a sequential chain of operations.

For AArch64, we only need to scalarize if the input is <64b. If it's great than
64b then we can first do a fewElements step to 64b, taking advantage of vector
instructions until we reach the point of scalarization.

I also had to relax the verifier checks for reductions because the intrinsics
support <1 x EltTy> types, which we lower to scalars for GlobalISel.

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




More information about the All-commits mailing list