[clang] [clang][CUDA] Add 'noconvergent' function and statement attribute (PR #100637)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 29 09:34:40 PDT 2024


darkbuck wrote:

> We should be removing the source level convergent attribute, not adding more uses of it. It was a mistake to define it in the positive direction, and it is completely unusable for end users. Every piece of code that transitively calls the function in the entire program must also be marked convergent. The only way to practically achieve this is if the target/language has convergent operations, every operation must be marked convergent by default (i.e. the ConvergentFunctions language property should be set)
> 
> For optimization hints, we could have a source level noconvergent attribute to opt-out, which would be the inverse of this.
> 
> On the IR level we should pick https://reviews.llvm.org/D69498 back up.

The patch is revised to add a new `convergent` attribute for function decals and statements. As only CUDA-like languages mark func/call `convergent` by default, I added this attribute as an attribute for CUDA and HIP. If required, we could extend this patch to other languages.


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


More information about the cfe-commits mailing list