[clang] [clang] ``noconvergent`` does not affect calls to convergent functions (PR #132701)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 24 05:14:51 PDT 2025


================
@@ -1677,7 +1676,8 @@ being treated as convergent when it's safe.
 
   __device__ int example(void) {
     float x;
-    [[clang::noconvergent]] x = bar(x);
+    [[clang::noconvergent]] x = bar(x); // no effect on convergence
+    [[clang::noconvergent]] { asm volatile ("nop"); } // the asm call is non-convergent
   }
----------------
arsenm wrote:

Maybe should have an example of an undefined usage 

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


More information about the cfe-commits mailing list