[flang-commits] [flang] [mlir] [mlir][OpenACC] Error on external calls without acc routine info (PR #223815)

Razvan Lupusoru via flang-commits flang-commits at lists.llvm.org
Wed Sep 16 08:05:07 PDT 2026


================
@@ -198,13 +213,27 @@ class ACCImplicitRoutine
         // regions, skip it
         if (!callee)
           return;
+        // Already a valid symbol for GPU regions (e.g. an existing routine or
+        // an LLVM intrinsic), skip it.
         if (accSupport.isValidSymbolUse(callOp.getOperation(), calleeSymbolRef))
           return;
+        // Without a definition in this compilation unit an implicit routine
+        // cannot be applied, so the call target needs explicit routine
+        // information.
+        if (callee.isExternal()) {
+          callOp->emitError()
+              << "Procedures called in a compute region must have acc routine "
----------------
razvanlupusoru wrote:

nit: this message should likely not say "compute region" but "acc routine".

I would phrase it as: "Calls in acc routine must also be marked with acc routine: "

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


More information about the flang-commits mailing list