[all-commits] [llvm/llvm-project] b794dc: [SystemZ] Add custom handling of legal vectors wit...

Dominik Steenken via All-commits all-commits at lists.llvm.org
Fri Apr 12 09:11:00 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b794dc23255505dd7735f995b8ff1192305a072e
      https://github.com/llvm/llvm-project/commit/b794dc23255505dd7735f995b8ff1192305a072e
  Author: Dominik Steenken <dost at de.ibm.com>
  Date:   2024-04-12 (Fri, 12 Apr 2024)

  Changed paths:
    M llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
    M llvm/lib/Target/SystemZ/SystemZISelLowering.h
    M llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
    M llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h
    M llvm/test/Analysis/CostModel/SystemZ/reduce-add.ll
    A llvm/test/CodeGen/SystemZ/vec-reduce-add-01.ll

  Log Message:
  -----------
  [SystemZ] Add custom handling of legal vectors with reduce-add. (#88495)

This commit skips the expansion of the `vector.reduce.add` intrinsic on
vector-enabled SystemZ targets in order to introduce custom handling of
`vector.reduce.add` for legal vector types using the VSUM instructions.
This is limited to full vectors with scalar types up to `i32` due to
performance concerns.

It also adds testing for the generation of such custom handling, and
adapts the related cost computation, as well as the testing for that.

The expected result is a performance boost in certain benchmarks that
make heavy use of `vector.reduce.add` with other benchmarks remaining
constant.

For instance, the assembly for `vector.reduce.add<4 x i32>` changes from
```hlasm
        vmrlg   %v0, %v24, %v24
        vaf     %v0, %v24, %v0
        vrepf   %v1, %v0, 1
        vaf     %v0, %v0, %v1
        vlgvf   %r2, %v0, 0
```
to
```hlasm
        vgbm    %v0, 0
        vsumqf  %v0, %v24, %v0
        vlgvf   %r2, %v0, 3
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list