[clang] [llvm] [AMDGPU][clang][CodeGen][opt] Add late-resolved feature identifying predicates (PR #134016)

Alex Voicu via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 30 06:00:31 PDT 2025


AlexVlx wrote:

> I mean, I'm not particularly attached to the syntax of the "if". I guess we could designate `if (__builtin_amdgcn_processor_is("gfx900")) {}` as a "processor-feature-if". The point is that we need to know at the AST level which processor features are available for each statement.

I don't quite see how to parse this statement to make it address the actual use case. These are useful because we cannot know, at the AST level (in the FE) which processor features are available. If we knew that we don't really need any additional mechanism, so this is just a different way to type `#if defined` / `__has_builtin`, which is not what is desired.

https://github.com/llvm/llvm-project/pull/134016


More information about the cfe-commits mailing list