[clang] [AArch64] Add option -msve-streaming-vector-bits= . (PR #144611)

Sander de Smalen via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 23 03:35:05 PDT 2025


================
@@ -1666,30 +1666,43 @@ void Clang::AddAArch64TargetArgs(const ArgList &Args,
   }
 
   // Handle -msve_vector_bits=<bits>
-  if (Arg *A = Args.getLastArg(options::OPT_msve_vector_bits_EQ)) {
+  auto HandleVectorBits = [&](Arg *A, bool Streaming) {
     StringRef Val = A->getValue();
     const Driver &D = getToolChain().getDriver();
     if (Val == "128" || Val == "256" || Val == "512" || Val == "1024" ||
         Val == "2048" || Val == "128+" || Val == "256+" || Val == "512+" ||
         Val == "1024+" || Val == "2048+") {
       unsigned Bits = 0;
       if (!Val.consume_back("+")) {
-        bool Invalid = Val.getAsInteger(10, Bits); (void)Invalid;
+        bool Invalid = Val.getAsInteger(10, Bits);
+        (void)Invalid;
         assert(!Invalid && "Failed to parse value");
+        StringRef VScaleMax =
+            Streaming ? "-mvscale-streaming-max=" : "-mvscale-max=";
----------------
sdesmalen-arm wrote:

nit: Maybe just pass VScaleMin/Max as StringRefs, rather than a bool?

https://github.com/llvm/llvm-project/pull/144611


More information about the cfe-commits mailing list