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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to