[clang] [OpenMP][clang] disable __llvm_omp_indirect_call_lookup codegen for n… (PR #184369)

Jason Van Beusekom via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 3 08:22:04 PST 2026


https://github.com/Jason-Van-Beusekom created https://github.com/llvm/llvm-project/pull/184369

Fix from https://github.com/llvm/llvm-project/commit/b23438661c1056bae385daba1501afb762d1e336 to fix formatting error and test failure: https://lab.llvm.org/staging/#/builders/105/builds/43970

>From 0dc7dd7065464f0fb3c7b170c5396726b48deee6 Mon Sep 17 00:00:00 2001
From: Jason Van Beusekom <jason.van-beusekom at hpe.com>
Date: Tue, 3 Mar 2026 10:14:54 -0600
Subject: [PATCH] [OpenMP][clang] disable __llvm_omp_indirect_call_lookup
 codegen for non GPU

---
 clang/lib/CodeGen/CGExpr.cpp          | 2 +-
 clang/lib/Serialization/ASTWriter.cpp | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 3fe2850e4587e..eebb36276e0eb 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -7026,7 +7026,7 @@ RValue CodeGenFunction::EmitCall(QualType CalleeType,
   //
   // This is used for the indirect function case, virtual function case is
   // handled in ItaniumCXXABI.cpp
-  if (getLangOpts().OpenMPIsTargetDevice &&
+  if (getLangOpts().OpenMPIsTargetDevice && CGM.getTriple().isGPU() &&
       (!TargetDecl || !isa<FunctionDecl>(TargetDecl))) {
     const Expr *CalleeExpr = E->getCallee()->IgnoreParenImpCasts();
     const DeclRefExpr *DRE = nullptr;
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index 2d0f257d02d6d..814f4e42e9c9b 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -7825,7 +7825,8 @@ void ASTWriter::DeclarationMarkedOpenMPAllocate(const Decl *D, const Attr *A) {
 }
 
 void ASTWriter::DeclarationMarkedOpenMPIndirectCall(const Decl *D) {
-  if (Chain && Chain->isProcessingUpdateRecords()) return;
+  if (Chain && Chain->isProcessingUpdateRecords())
+    return;
   assert(!WritingAST && "Already writing the AST!");
   if (!D->isFromASTFile())
     return;



More information about the cfe-commits mailing list