From 2aa0f0a3bd541278b04efcc717e7aa94ef4c1308 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 3 Jul 2025 13:44:38 -0700 Subject: [AArch64] Add option -msve-streaming-vector-bits= . (#144611) This is similar to -msve-vector-bits, but for streaming mode: it constrains the legal values of "vscale", allowing optimizations based on that constraint. This also fixes conversions between SVE vectors and fixed-width vectors in streaming functions with -msve-vector-bits and -msve-streaming-vector-bits. This rejects any use of arm_sve_vector_bits types in streaming functions; if it becomes relevant, we could add arm_sve_streaming_vector_bits types in the future. This doesn't touch the __ARM_FEATURE_SVE_BITS define. --- clang/lib/Frontend/CompilerInvocation.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 0a9e364..9b3200b 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -4620,6 +4620,11 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, if (StringRef(A->getValue()).getAsInteger(10, VScaleMin) || VScaleMin == 0) Diags.Report(diag::err_cc1_unbounded_vscale_min); } + if (Arg *A = Args.getLastArg(options::OPT_mvscale_streaming_min_EQ)) { + unsigned VScaleMin; + if (StringRef(A->getValue()).getAsInteger(10, VScaleMin) || VScaleMin == 0) + Diags.Report(diag::err_cc1_unbounded_vscale_min); + } if (const Arg *A = Args.getLastArg(OPT_frandomize_layout_seed_file_EQ)) { std::ifstream SeedFile(A->getValue(0)); -- cgit v1.1