rjmccall wrote:

Yeah, I agree with the other parts of your design, enabling the builtins within 
the guarded statements is a great way to handle it.

On a different point: I don't think this builtin is actually semantically 
different from `__builtin_cpu_is`.  As long as we're not treating it as 
`constexpr`, the fact that it's lowered by the compiler and doesn't need a 
runtime check is just a happy property of GPU targeting rather than a 
fundamental difference. You could certainly imagine targets that *do* simply do 
this with a runtime switch. And the behavior of allowing additional builtin to 
be used within the guarded block seems like a nice feature that other targets 
would probably like to take advantage of.

We could allow `__builtin_processor_is`  as an alternative name for that 
builtin if folks feel weird about having "cpu" in the name for a GPU target.

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

Reply via email to