Skip to content

[AArch64][SME] Use reportFatalUsageError rather than assert (NFC) #145491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
7 changes: 7 additions & 0 deletions llvm/test/CodeGen/AArch64/streaming-func-no-sme.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
; RUN: not llc -mtriple aarch64-none-linux-gnu %s 2>&1 | FileCheck %s
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add "-o /dev/null" or something here to avoid opening an output file in the local directory, since it may be write protected?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use -filetype=null

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this to use -filetype=null 9fde72e 👍

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!


; CHECK: LLVM ERROR: streaming SVE functions require SME
define void @streaming(i64 noundef %n) "aarch64_pstate_sm_enabled" nounwind {
entry:
ret void
}
Loading