[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:27:32 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);
----------------
phoebewang wrote:

Good question. MSVC has a default value for `/arch`. We should match it here. `-mavx512xxx` is a single feature, which is orthogonal to `/arch`. We don't need to check them.

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


More information about the cfe-commits mailing list