Skip to content

Commit 767b342

Browse files
authored
[OpenMP] Mute OpenMP Target Enter, Exit and Data codegen for device pass (#72287)
1 parent da90fd7 commit 767b342

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4566,6 +4566,10 @@ OpenMPIRBuilder::InsertPointTy OpenMPIRBuilder::createTargetData(
45664566
if (!updateToLocation(Loc))
45674567
return InsertPointTy();
45684568

4569+
// Disable TargetData CodeGen on Device pass.
4570+
if (Config.IsTargetDevice.value_or(false))
4571+
return Builder.saveIP();
4572+
45694573
Builder.restoreIP(CodeGenIP);
45704574
bool IsStandAlone = !BodyGenCB;
45714575
MapInfosTy *MapInfo;

0 commit comments

Comments
 (0)