[llvm] [OpenMP] Mute OpenMP Target Enter, Exit and Data codegen for device pass (PR #72287)
Akash Banerjee via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 14 09:34:14 PST 2023
https://github.com/TIFitis updated https://github.com/llvm/llvm-project/pull/72287
>From 4f1fc8ce211d15067cca37290081889fccd039eb Mon Sep 17 00:00:00 2001
From: Akash Banerjee <Akash.Banerjee at amd.com>
Date: Tue, 14 Nov 2023 17:01:38 +0000
Subject: [PATCH] [OpenMP] Mute OpenMP Target Enter, Exit and Data codegen for
device pass
---
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
index 24d15267a65e933..81dfef42651318d 100644
--- a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+++ b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
@@ -4566,6 +4566,10 @@ OpenMPIRBuilder::InsertPointTy OpenMPIRBuilder::createTargetData(
if (!updateToLocation(Loc))
return InsertPointTy();
+ // Disable TargetData CodeGen on Device pass.
+ if (Config.IsTargetDevice.value_or(false))
+ return Builder.saveIP();
+
Builder.restoreIP(CodeGenIP);
bool IsStandAlone = !BodyGenCB;
MapInfosTy *MapInfo;
More information about the llvm-commits
mailing list