[clang] [Clang][AArch64] Add pessimistic vscale_range when sve is in target-f… (PR #137624)
Matthew Devereau via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 30 09:05:54 PDT 2025
MDevereau wrote:
> Normally the way we handle target features is through ASTContext::getFunctionFeatureMap(); does that work here?
It works for AArch64, but it's causing errors in unexpected places.
CodeGen/X86/avx512-error.c and CodeGen/target-avx-abi-diag.c fail with
```
error: 'noevex-warning' diagnostics seen but not expected:
(frontend): invalid feature combination: +avx512bw +avx10.1-256; will be promoted to avx10.1-512
1 error generated.
```
This is just when doing something simple setup:
```c++
if (FD){
getContext().getFunctionFeatureMap(FeatureMap, FD);
IsArmStreaming = IsArmStreamingFunction(FD, true);
}
std::optional<std::pair<unsigned, unsigned>> VScaleRange =
getContext().getTargetInfo().getVScaleRange(
getLangOpts(), IsArmStreaming, &FeatureMap);
if (VScaleRange) {
CurFn->addFnAttr(llvm::Attribute::getWithVScaleRangeArgs(
getLLVMContext(), VScaleRange->first, VScaleRange->second));
}
```
I assume `getFunctionFeatureMap` is initializing some things inside the Target when called which isn't appropriate here.
https://github.com/llvm/llvm-project/pull/137624
More information about the cfe-commits
mailing list