Nathan =?utf-8?q?Gauër?= <brio...@google.com>, Nathan =?utf-8?q?Gauër?= <brio...@google.com>, Nathan =?utf-8?q?Gauër?= <brio...@google.com>, Nathan =?utf-8?q?Gauër?= <brio...@google.com> Message-ID: In-Reply-To: <llvm.org/llvm/llvm-project/pull/80...@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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits