aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGOpenMPRuntime.cpp6
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp2
-rw-r--r--clang/lib/CodeGen/CodeGenModule.h6
-rw-r--r--clang/lib/CodeGen/CodeGenPGO.cpp2
4 files changed, 6 insertions, 10 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index 06a652c..b706fa3 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -2614,8 +2614,7 @@ void CGOpenMPRuntime::emitDistributeStaticInit(
llvm::Value *ThreadId = getThreadID(CGF, Loc);
llvm::FunctionCallee StaticInitFunction;
bool isGPUDistribute =
- CGM.getLangOpts().OpenMPIsTargetDevice &&
- (CGM.getTriple().isAMDGCN() || CGM.getTriple().isNVPTX());
+ CGM.getLangOpts().OpenMPIsTargetDevice && CGM.getTriple().isGPU();
StaticInitFunction = OMPBuilder.createForStaticInitFunction(
Values.IVSize, Values.IVSigned, isGPUDistribute);
@@ -2644,8 +2643,7 @@ void CGOpenMPRuntime::emitForStaticFinish(CodeGenFunction &CGF,
getThreadID(CGF, Loc)};
auto DL = ApplyDebugLocation::CreateDefaultArtificial(CGF, Loc);
if (isOpenMPDistributeDirective(DKind) &&
- CGM.getLangOpts().OpenMPIsTargetDevice &&
- (CGM.getTriple().isAMDGCN() || CGM.getTriple().isNVPTX()))
+ CGM.getLangOpts().OpenMPIsTargetDevice && CGM.getTriple().isGPU())
CGF.EmitRuntimeCall(
OMPBuilder.getOrCreateRuntimeFunction(
CGM.getModule(), OMPRTL___kmpc_distribute_static_fini),
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 96ab4dd..5dbd50b 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -843,7 +843,7 @@ static void setVisibilityFromDLLStorageClass(const clang::LangOptions &LO,
static bool isStackProtectorOn(const LangOptions &LangOpts,
const llvm::Triple &Triple,
clang::LangOptions::StackProtectorMode Mode) {
- if (Triple.isAMDGPU() || Triple.isNVPTX())
+ if (Triple.isGPU())
return false;
return LangOpts.getStackProtector() == Mode;
}
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index 6deb467..46de3d86 100644
--- a/clang/lib/CodeGen/CodeGenModule.h
+++ b/clang/lib/CodeGen/CodeGenModule.h
@@ -1073,10 +1073,8 @@ public:
// Return whether RTTI information should be emitted for this target.
bool shouldEmitRTTI(bool ForEH = false) {
- return (ForEH || getLangOpts().RTTI) && !getLangOpts().CUDAIsDevice &&
- !(getLangOpts().OpenMP && getLangOpts().OpenMPIsTargetDevice &&
- (getTriple().isNVPTX() || getTriple().isAMDGPU() ||
- getTriple().isSPIRV()));
+ return (ForEH || getLangOpts().RTTI) &&
+ (!getLangOpts().isTargetDevice() || !getTriple().isGPU());
}
/// Get the address of the RTTI descriptor for the given type.
diff --git a/clang/lib/CodeGen/CodeGenPGO.cpp b/clang/lib/CodeGen/CodeGenPGO.cpp
index ff8b133..83a5f20 100644
--- a/clang/lib/CodeGen/CodeGenPGO.cpp
+++ b/clang/lib/CodeGen/CodeGenPGO.cpp
@@ -1357,7 +1357,7 @@ void CodeGenPGO::setProfileVersion(llvm::Module &M) {
IRLevelVersionVariable->setVisibility(llvm::GlobalValue::HiddenVisibility);
llvm::Triple TT(M.getTargetTriple());
- if (TT.isAMDGPU() || TT.isNVPTX())
+ if (TT.isGPU())
IRLevelVersionVariable->setVisibility(
llvm::GlobalValue::ProtectedVisibility);
if (TT.supportsCOMDAT()) {