[llvm] [AArch64][CostModel] Lower wide fixed-length vector reductions cost (PR #211824)
Sander de Smalen via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 24 08:54:01 PDT 2026
=?utf-8?q?Gaëtan?= Bossu <gaetan.bossu at arm.com>,
=?utf-8?q?Gaëtan?= Bossu <gaetan.bossu at arm.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/211824 at github.com>
================
@@ -0,0 +1,280 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
+; RUN: opt < %s -mtriple=aarch64 -mattr=+sve -passes="print<cost-model>" 2>&1 -disable-output \
+; RUN: -cost-kind=all -aarch64-sve-vector-bits-min=128 \
+; RUN: | FileCheck %s --check-prefixes=VSCALE-1
+; RUN: opt < %s -mtriple=aarch64 -mattr=+sve -passes="print<cost-model>" 2>&1 -disable-output \
+; RUN: -cost-kind=all -aarch64-sve-vector-bits-min=128 -aarch64-sve-vector-bits-max=128 \
+; RUN: | FileCheck %s --check-prefixes=VSCALE-1
+; RUN: opt < %s -mtriple=aarch64 -mattr=+sve -passes="print<cost-model>" 2>&1 -disable-output \
+; RUN: -cost-kind=all -aarch64-sve-vector-bits-min=256 \
+; RUN: | FileCheck %s --check-prefixes=VSCALE-2
+; RUN: opt < %s -mtriple=aarch64 -mattr=+sve -passes="print<cost-model>" 2>&1 -disable-output \
+; RUN: -cost-kind=all -aarch64-sve-vector-bits-min=256 -aarch64-sve-vector-bits-max=256 \
+; RUN: | FileCheck %s --check-prefixes=VSCALE-2
+; RUN: opt < %s -mtriple=aarch64 -mattr=+sve -passes="print<cost-model>" 2>&1 -disable-output \
+; RUN: -cost-kind=all -aarch64-sve-vector-bits-min=512 \
+; RUN: | FileCheck %s --check-prefixes=VSCALE-4
+; RUN: opt < %s -mtriple=aarch64 -mattr=+sve -passes="print<cost-model>" 2>&1 -disable-output \
+; RUN: -cost-kind=all -aarch64-sve-vector-bits-min=512 -aarch64-sve-vector-bits-max=512 \
+; RUN: | FileCheck %s --check-prefixes=VSCALE-4
+
+; This tests the cost of fixed-length reductions for SVE,
+; either for a minimum vscale or a fixed vscale (aka VLS).
+; For the NEON equivalent test, see reduce-*.ll
+; Codegen tests are in sve-fixed-length-int-reduce.ll
+
+define void @reduce_add() {
+; VSCALE-1-LABEL: 'reduce_add'
+; VSCALE-1-NEXT: Cost Model: Found costs of 2 for: %V16i8 = call i8 @llvm.vector.reduce.add.v16i8(<16 x i8> poison)
----------------
sdesmalen-arm wrote:
+1 for splitting these tests up into separate functions.
https://github.com/llvm/llvm-project/pull/211824
More information about the llvm-commits
mailing list