[clang] [X86][clang-cl] Add CL option /vlen (PR #166375)
Hans Wennborg via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 6 00:06:01 PST 2025
================
@@ -9218,6 +9218,10 @@ def : CLFlag<"Qscatter-">, Alias<mno_scatter>,
def _SLASH_arch : CLCompileJoined<"arch:">,
HelpText<"Set architecture for code generation">;
+def _SLASH_vlen : CLCompileJoined<"vlen">,
+ HelpText<"Set vector length for autovectorization and other optimizations">;
+def _SLASH_vlen_default : CLFlag<"vlen">,
+ HelpText<"Set default vector length for autovectorization and other optimizations">;
----------------
zmodem wrote:
I think these should be `_SLASH_vlen` (for the default) and `_SLASH_vlen_EQ` for the one ending in = (and that should be included in the flag spelling.
But, since only two values are allowed, it might be simpler to do something like:
```
def _SLASH_vlen : CLFLag<"vlen"> ...
def _SLASH_vlen_EQ_256 : CLFLag<"vlen=256"> ...
def _SLASH_vlen_EQ_512 : CLFlag<"vlen=512"> ...
```
Does Clang provide good diagnostics when passing an `-mprefer-vector-width` that doesn't fit the target architecture?
If so, could we make `_SLASH_vlen_EQ_256` an alias for `-mprefer-vector-width=256` and so on, and not have to add any new driver logic at all?
https://github.com/llvm/llvm-project/pull/166375
More information about the cfe-commits
mailing list