================
@@ -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:

Yep, but I'm not sure I have any other option outside from some kind of 
caching(either attribute of a BB, or BB->I map). If it's this kind of 
alternative you are thinking about, maybe this should be left in a subsequent 
PR as an optimization?

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

Reply via email to