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

Sameer Sahasrabuddhe via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 12 20:52:58 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>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/80680 at github.com>


================
@@ -1130,8 +1130,96 @@ struct BitTest {
 
   static BitTest decodeBitTestBuiltin(unsigned BuiltinID);
 };
+
+// Returns the first convergence entry/loop/anchor instruction found in |BB|.
+// std::nullopt otherwise.
+std::optional<llvm::IntrinsicInst *> getConvergenceToken(llvm::BasicBlock *BB) {
+  for (auto &I : *BB) {
----------------
ssahasra wrote:

This kind of map will be needed in more places as we continue to introduces uses of these convergence tokens. I have a simple Analysis in my upstreaming pipeline that produces such a map, but it's really very simple. You can wait for that, or just feel free to start your own.

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


More information about the cfe-commits mailing list