[Openmp-commits] [clang] [llvm] [openmp] [OpenMP][clang] Indirect and Virtual function call mapping from host to device (PR #159857)

Jason Van Beusekom via Openmp-commits openmp-commits at lists.llvm.org
Tue Jan 27 08:29:40 PST 2026


================
@@ -7360,8 +7360,14 @@ ExprResult SemaOpenMP::ActOnOpenMPCall(ExprResult Call, Scope *Scope,
     return Call;
 
   FunctionDecl *CalleeFnDecl = CE->getDirectCallee();
-  if (!CalleeFnDecl)
+
+  // Mark indirect calls inside target regions, to allow for insertion of
+  // __llvm_omp_indirect_call_lookup calls during codegen.
+  if (!CalleeFnDecl) {
+    if (isInOpenMPTargetExecutionDirective())
+      getASTContext().OMPTargetCalls.insert(CE);
----------------
Jason-Van-Beusekom wrote:

Do we support modules/precompiled headers for OpenMP offload? 

I do not see any tests for modules for OpenMP offload and for precompiled headers I do not see any runtime tests.

I am also not able to compile a basic OpenMP offload program for modules or precompiled headers

```bash
clang -fopenmp -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -o omp_pch_header.pch omp_pch_header.h
clang -fopenmp -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -include-pch omp_pch_h
eader.pch  omp_pch_main.c 
error: Assume convergent functions was disabled in precompiled file 'omp_pch_header.pch' but is currently enabled
error: precompiled file 'omp_pch_header.pch' was compiled for the target 'x86_64-unknown-linux-gnu' but the current
      translation unit is being compiled for target 'amdgcn-amd-amdhsa'
2 errors generated.
```

Do you have an example I could reference? 

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


More information about the Openmp-commits mailing list