Skip to content

Commit 32a8bb3

Browse files
committed
Improve SME check, add runline to test for it
1 parent 5ca3a48 commit 32a8bb3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5584,7 +5584,8 @@ InstructionCost AArch64TTIImpl::getShuffleCost(
55845584
}
55855585

55865586
// Segmented shuffle matching.
5587-
if ((ST->hasSVE2p1() || ST->hasSME2p1()) &&
5587+
if ((ST->hasSVE2p1() ||
5588+
(ST->hasSME2p1() && ST->isSVEorStreamingSVEAvailable())) &&
55885589
Kind == TTI::SK_PermuteSingleSrc && isa<FixedVectorType>(Tp) &&
55895590
Tp->getPrimitiveSizeInBits().isKnownMultipleOf(
55905591
AArch64::SVEBitsPerBlock)) {

llvm/test/Analysis/CostModel/AArch64/segmented-shufflevector-patterns.ll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 5
2-
; RUN: opt -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output -mtriple=aarch64--linux-gnu < %s | FileCheck %s
2+
; RUN: opt -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output -mtriple=aarch64--linux-gnu -mattr=+sve2p1 < %s | FileCheck %s
3+
; RUN: opt -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output -mtriple=aarch64--linux-gnu -mattr=+sme2p1 -force-streaming < %s | FileCheck %s
34

45
;; Broadcast indexed lane within 128b segments (dupq zd.t, zn.t[idx])
56
define void @dup_within_each_segment() #0 {
@@ -22,4 +23,4 @@ define void @dup_within_each_segment() #0 {
2223
ret void
2324
}
2425

25-
attributes #0 = { noinline vscale_range(2,2) "target-features"="+sve2p1" }
26+
attributes #0 = { noinline vscale_range(2,2) }

0 commit comments

Comments
 (0)