https://github.com/Artem-B commented:

> This patch makes it so that builtins for the aux triple only get enabled if 
> they are marked as supported by the current language options. 

I'm not convinced that it's the right fix for the problem.

* `__cpuidex`, uses `Languages = "ALL_MS_LANGUAGES"` which expands to `C_LANG | 
CXX_LANG | OBJC_LANG | MS_LANG `
* the test targets linux, so LangOpts.MicrosoftExt is false.
* for `__cpuidex` or any other MS-specific builtin it would cause 
`builtinIsSupported` to return false, and it would make it unavailable. So far 
so good. That solves part of the problem.

However, the reason we do have those aux builtins visible is that we still need 
to parse the same headers that the host side will see. And those headers may 
assume availability of those builtins.
So, while selectively disabling non-MS builtins during GPU compilation may 
solve this particular issue, it will likely create additional problems if/when 
the headers will need those now-filtered-out builtins from the aux triple.

It may be OK to selectively filter out specific builtins with very narrow use 
cases, like `__cpuidex`, but I think wholesale disabling of the 
platform-specific subset of builtins is not going to work.



https://github.com/llvm/llvm-project/pull/154217
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to