Skip to content

Commit 289a0f2

Browse files
committed
[OpenMP] Remove SPMD specific handling during globalization
Globalization and SPMD are different things that used to be conflated. Some leftover crossover interactions remain, trying to remove them now.
1 parent 331085b commit 289a0f2

5 files changed

+386
-413
lines changed

clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,10 +1046,8 @@ llvm::Function *CGOpenMPRuntimeGPU::emitTeamsOutlinedFunction(
10461046
}
10471047

10481048
void CGOpenMPRuntimeGPU::emitGenericVarsProlog(CodeGenFunction &CGF,
1049-
SourceLocation Loc,
1050-
bool WithSPMDCheck) {
1051-
if (getDataSharingMode() != CGOpenMPRuntimeGPU::DS_Generic &&
1052-
getExecutionMode() != CGOpenMPRuntimeGPU::EM_SPMD)
1049+
SourceLocation Loc) {
1050+
if (getDataSharingMode() != CGOpenMPRuntimeGPU::DS_Generic)
10531051
return;
10541052

10551053
CGBuilderTy &Bld = CGF.Builder;
@@ -1158,10 +1156,8 @@ void CGOpenMPRuntimeGPU::getKmpcFreeShared(
11581156
{AddrSizePair.first, AddrSizePair.second});
11591157
}
11601158

1161-
void CGOpenMPRuntimeGPU::emitGenericVarsEpilog(CodeGenFunction &CGF,
1162-
bool WithSPMDCheck) {
1163-
if (getDataSharingMode() != CGOpenMPRuntimeGPU::DS_Generic &&
1164-
getExecutionMode() != CGOpenMPRuntimeGPU::EM_SPMD)
1159+
void CGOpenMPRuntimeGPU::emitGenericVarsEpilog(CodeGenFunction &CGF) {
1160+
if (getDataSharingMode() != CGOpenMPRuntimeGPU::DS_Generic)
11651161
return;
11661162

11671163
const auto I = FunctionGlobalizedDecls.find(CGF.CurFn);
@@ -3350,13 +3346,13 @@ void CGOpenMPRuntimeGPU::emitFunctionProlog(CodeGenFunction &CGF,
33503346
Data.insert(std::make_pair(VD, MappedVarData()));
33513347
}
33523348
if (!NeedToDelayGlobalization) {
3353-
emitGenericVarsProlog(CGF, D->getBeginLoc(), /*WithSPMDCheck=*/true);
3349+
emitGenericVarsProlog(CGF, D->getBeginLoc());
33543350
struct GlobalizationScope final : EHScopeStack::Cleanup {
33553351
GlobalizationScope() = default;
33563352

33573353
void Emit(CodeGenFunction &CGF, Flags flags) override {
33583354
static_cast<CGOpenMPRuntimeGPU &>(CGF.CGM.getOpenMPRuntime())
3359-
.emitGenericVarsEpilog(CGF, /*WithSPMDCheck=*/true);
3355+
.emitGenericVarsEpilog(CGF);
33603356
}
33613357
};
33623358
CGF.EHStack.pushCleanup<GlobalizationScope>(NormalAndEHCleanup);

clang/lib/CodeGen/CGOpenMPRuntimeGPU.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,10 @@ class CGOpenMPRuntimeGPU : public CGOpenMPRuntime {
6868
bool IsSPMD);
6969

7070
/// Helper for generic variables globalization prolog.
71-
void emitGenericVarsProlog(CodeGenFunction &CGF, SourceLocation Loc,
72-
bool WithSPMDCheck = false);
71+
void emitGenericVarsProlog(CodeGenFunction &CGF, SourceLocation Loc);
7372

7473
/// Helper for generic variables globalization epilog.
75-
void emitGenericVarsEpilog(CodeGenFunction &CGF, bool WithSPMDCheck = false);
74+
void emitGenericVarsEpilog(CodeGenFunction &CGF);
7675

7776
//
7877
// Base class overrides.

0 commit comments

Comments
 (0)