[llvm] [OPT] Search whole BB for convergence token. (PR #112728)

Steven Perron via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 28 08:29:48 PDT 2024


================
@@ -2438,15 +2451,10 @@ llvm::InlineResult llvm::InlineFunction(CallBase &CB, InlineFunctionInfo &IFI,
   // fully implements convergence control tokens, there is no mixing of
   // controlled and uncontrolled convergent operations in the whole program.
   if (CB.isConvergent()) {
-    auto *I = CalledFunc->getEntryBlock().getFirstNonPHI();
-    if (auto *IntrinsicCall = dyn_cast<IntrinsicInst>(I)) {
-      if (IntrinsicCall->getIntrinsicID() ==
-          Intrinsic::experimental_convergence_entry) {
-        if (!ConvergenceControlToken) {
-          return InlineResult::failure(
-              "convergent call needs convergencectrl operand");
-        }
-      }
+    auto *I = getConevrgenceEntryIfAny(CalledFunc->getEntryBlock());
+    if (I && !ConvergenceControlToken) {
----------------
s-perron wrote:

Good call. Done.

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


More information about the llvm-commits mailing list