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

Nathan Gauër via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 13 03:34:27 PDT 2024


================
@@ -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) {
----------------
Keenuts wrote:

Good to know! I'd be in favor to implement this map once we have a merged use case.
-> This way, we can have an independent NFC PR which focuses on this optimization/refactoring by adding either an analysis or the bits in `llvm::BasicBlock` to quickly fetch those.

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


More information about the llvm-commits mailing list