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

Alex Voicu via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 2 14:38:57 PDT 2025


https://github.com/AlexVlx commented:

> First, please take a look at the LLVM coding standard re the use of 'auto'.
> 
> Second: The use of a special type for these builtins is a little novel (though I see the predicate type already exists?), but I guess I'm ok with it.  I have some concerns with how the conversions for it work, particularly being represented always as an `i1`, but the tests you have look about right.
> 
> I would like to see a test that is effectively:
> 
> ```
> bool f() {
> return __builtin_amdgcn_processor_is(...);
> }
> ```
> 
> (and maybe one returning 'auto' to make sure it is deduced properly). 

Apologies, I missed this earlier, and only got around to adding them now. Please do note that for cases where the function return type is `bool` one cannot directly return a predicate value, as it does not get implicitly casted to `bool`. This matches the behaviour of a type with an `explicit` conversion operator, which is what we're modelling.

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


More information about the llvm-commits mailing list