Skip to content

Commit 953d3cc

Browse files
MacDueAnthony Tran
authored andcommitted
[AArch64][SME] Use reportFatalUsageError rather than assert (NFC) (llvm#145491)
Fixes llvm#144351
1 parent 1419533 commit 953d3cc

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

llvm/lib/Target/AArch64/AArch64TargetMachine.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,8 @@ AArch64TargetMachine::getSubtargetImpl(const Function &F) const {
481481
MaxSVEVectorSize, IsStreaming, IsStreamingCompatible, HasMinSize);
482482
}
483483

484-
assert((!IsStreaming || I->hasSME()) && "Expected SME to be available");
484+
if (IsStreaming && !I->hasSME())
485+
reportFatalUsageError("streaming SVE functions require SME");
485486

486487
return I.get();
487488
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
; RUN: not llc -mtriple aarch64-none-linux-gnu %s 2>&1 | FileCheck %s
2+
3+
; CHECK: LLVM ERROR: streaming SVE functions require SME
4+
define void @streaming(i64 noundef %n) "aarch64_pstate_sm_enabled" nounwind {
5+
entry:
6+
ret void
7+
}

0 commit comments

Comments
 (0)