[clang] [llvm] [openmp] [OpenMP][clang] Indirect and Virtual function call mapping from host to device (PR #159857)
Alexey Bataev via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 21 10:04:27 PST 2026
================
@@ -6824,6 +6824,26 @@ RValue CodeGenFunction::EmitCall(QualType CalleeType,
Address(Handle, Handle->getType(), CGM.getPointerAlign()));
Callee.setFunctionPointer(Stub);
}
+
+ // Insert function pointer lookup if this is a target call
+ //
+ // This is used for the indirect function case, virtual function case is
+ // handled in ItaniumCXXABI.cpp
+ if (getLangOpts().OpenMPIsTargetDevice &&
+ getContext().OMPTargetCalls.contains(E)) {
+ auto *PtrTy = CGM.VoidPtrTy;
+ llvm::Type *RtlFnArgs[] = {PtrTy};
+ llvm::FunctionCallee DeviceRtlFn = CGM.CreateRuntimeFunction(
+ llvm::FunctionType::get(PtrTy, RtlFnArgs, false),
+ "__llvm_omp_indirect_call_lookup");
----------------
alexey-bataev wrote:
Should this be __kmpc_omp_indirect_call_lookup?
https://github.com/llvm/llvm-project/pull/159857
More information about the cfe-commits
mailing list