[clang] [X86][clang-cl] Add CL option /vlen (PR #166375)

Phoebe Wang via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 7 06:25:34 PST 2025


================
@@ -8266,6 +8266,31 @@ void Clang::AddClangCLArgs(const ArgList &Args, types::ID InputType,
                                                      << "/kernel";
  }
 
+  if (const Arg *A = Args.getLastArg(options::OPT__SLASH_vlen,
+                                     options::OPT__SLASH_vlen_EQ_256,
+                                     options::OPT__SLASH_vlen_EQ_512)) {
+    llvm::SmallSet<std::string, 4> Arch512 = {"AVX512F", "AVX512"};
+    llvm::SmallSet<std::string, 4> Arch256 = {"AVX", "AVX2"};
+
+    StringRef Arch = Args.getLastArgValue(options::OPT__SLASH_arch);
+
+    if (A->getOption().matches(options::OPT__SLASH_vlen_EQ_512)) {
+      if (Arch512.contains(Arch.str()))
----------------
phoebewang wrote:

We will add `AVX10.1`, `AVX10.2` soon, but I can change it for now.

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


More information about the cfe-commits mailing list