[clang] [llvm] [clang][HLSL][SPRI-V] Add convergence intrinsics (PR #80680)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 21 02:32:07 PDT 2024


Nathan =?utf-8?q?Gauër?= <brioche at google.com>,
Nathan =?utf-8?q?Gauër?= <brioche at google.com>,
Nathan =?utf-8?q?Gauër?= <brioche at google.com>,
Nathan =?utf-8?q?Gauër?= <brioche at google.com>,
Nathan =?utf-8?q?Gauër?= <brioche at google.com>,
Nathan =?utf-8?q?Gauër?= <brioche at google.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/80680 at github.com>


================
@@ -1295,11 +1295,13 @@ double4 trunc(double4);
 /// true, across all active lanes in the current wave.
 _HLSL_AVAILABILITY(shadermodel, 6.0)
 _HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_count_bits)
+__attribute__((convergent))
----------------
arsenm wrote:

For today you just have to put convergent on every function, you're just stuck with the crappy IR design decisions we have now. The noconvergent patch cleans this up to be a less bug prone state consistent with all the other optimization attributes, this doesn't need to wait for that. You just have to follow along with OpenCL/HIP/CUDA/OpenMP and say yes for LangOpts.assumeFunctionsAreConvergent

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


More information about the cfe-commits mailing list