diff --git a/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp b/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp index 8150e91c8ba52..281a1457fe57e 100644 --- a/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp +++ b/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp @@ -481,7 +481,8 @@ AArch64TargetMachine::getSubtargetImpl(const Function &F) const { MaxSVEVectorSize, IsStreaming, IsStreamingCompatible, HasMinSize); } - assert((!IsStreaming || I->hasSME()) && "Expected SME to be available"); + if (IsStreaming && !I->hasSME()) + reportFatalUsageError("streaming SVE functions require SME"); return I.get(); } diff --git a/llvm/test/CodeGen/AArch64/streaming-func-no-sme.ll b/llvm/test/CodeGen/AArch64/streaming-func-no-sme.ll new file mode 100644 index 0000000000000..968adcb7cc21b --- /dev/null +++ b/llvm/test/CodeGen/AArch64/streaming-func-no-sme.ll @@ -0,0 +1,7 @@ +; RUN: not llc -mtriple aarch64-none-linux-gnu %s 2>&1 | FileCheck %s + +; CHECK: LLVM ERROR: streaming SVE functions require SME +define void @streaming(i64 noundef %n) "aarch64_pstate_sm_enabled" nounwind { +entry: + ret void +}