<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/108704>108704</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] The VecLib bitfield in CodeGenOptions.def is too small for 9 different vector libraries
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
pawosm-arm
</td>
</tr>
</table>
<pre>
The VecLib bitfield is defined in `clang/include/clang/Basic/CodeGenOptions.def` as such:
```
// Vector functions library to use.
ENUM_CODEGENOPT(VecLib, llvm::driver::VectorLibrary, 3, llvm::driver::VectorLibrary::NoLibrary)
```
When this bitfield had been introduced, there were not many of the Vector Libraries to choose. Now we have 9 of them, as defined in `Options.td`:
```
def fveclib : Joined<["-"], "fveclib=">, Group<f_Group>,
Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
HelpText<"Use the given vector functions library">,
Values<"Accelerate,libmvec,MASSV,SVML,SLEEF,Darwin_libsystem_m,ArmPL,AMDLIBM,none">,
NormalizedValuesScope<"llvm::driver::VectorLibrary">,
NormalizedValues<["Accelerate", "LIBMVEC", "MASSV", "SVML", "SLEEF",
"Darwin_libsystem_m", "ArmPL", "AMDLIBM", "NoLibrary"]>,
MarshallingInfoEnum<CodeGenOpts<"VecLib">, "NoLibrary">;
```
In effect, they are not encoded correclty resulting in mysterious cases of the lost vectorization opportunity.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVdFu4joTfhrnZlQUnJDCRS5oIP37q9CV2uVcVo49IT5ybGQ7cNinPzJJYNvtWS1CSTye-WbmmxmbOSf3GjEnswcyW0Ws842x-YGdjGvvmG2jyohz_tYg7JA_ywoq6WuJSoB0ILCWGgVIDSSLuWJ6T2gpNVedQELLUfLAnOSEloUR-Ij65eCl0W4isCZZDMyB63hDkiWJVyRekiwe_v2SloSWwb03FupO84s1KFlZZs_gDXQOJ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