Skip to content

Commit e72d339

Browse files
committed
Improve SME check, add runline to test for it
1 parent 542faf0 commit e72d339

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
@@ -5600,7 +5600,8 @@ AArch64TTIImpl::getShuffleCost(TTI::ShuffleKind Kind, VectorType *DstTy,
56005600
}
56015601

56025602
// Segmented shuffle matching.
5603-
if ((ST->hasSVE2p1() || ST->hasSME2p1()) &&
5603+
if ((ST->hasSVE2p1() ||
5604+
(ST->hasSME2p1() && ST->isSVEorStreamingSVEAvailable())) &&
56045605
Kind == TTI::SK_PermuteSingleSrc && isa<FixedVectorType>(Tp) &&
56055606
Tp->getPrimitiveSizeInBits().isKnownMultipleOf(
56065607
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)