From 2ada7bb68bef36cd228d1c236e96932efb18daaa Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Tue, 5 Dec 2023 10:08:47 -0800 Subject: [PATCH] [OpenMP][NFCI] Remove effectively unused mutex The only use was already guarded by a different lock in the caller of loadBinary. --- openmp/libomptarget/include/PluginManager.h | 5 ----- openmp/libomptarget/src/device.cpp | 1 - openmp/libomptarget/src/interface.cpp | 5 ----- 3 files changed, 11 deletions(-) diff --git a/openmp/libomptarget/include/PluginManager.h b/openmp/libomptarget/include/PluginManager.h index 0b0974709b52..a0499c37504c 100644 --- a/openmp/libomptarget/include/PluginManager.h +++ b/openmp/libomptarget/include/PluginManager.h @@ -82,11 +82,6 @@ struct PluginAdaptorTy { llvm::DenseSet UsedImages; - // Mutex for thread-safety when calling RTL interface functions. - // It is easier to enforce thread-safety at the libomptarget level, - // so that developers of new RTLs do not have to worry about it. - std::mutex Mtx; - private: /// Number of devices the underling plugins sees. int32_t NumberOfPluginDevices = -1; diff --git a/openmp/libomptarget/src/device.cpp b/openmp/libomptarget/src/device.cpp index 1302c4e3d917..01fc32328876 100644 --- a/openmp/libomptarget/src/device.cpp +++ b/openmp/libomptarget/src/device.cpp @@ -561,7 +561,6 @@ llvm::Error DeviceTy::init() { // Load binary to device. __tgt_target_table *DeviceTy::loadBinary(__tgt_device_image *Img) { - std::lock_guardMtx)> LG(RTL->Mtx); return RTL->load_binary(RTLDeviceID, Img); } diff --git a/openmp/libomptarget/src/interface.cpp b/openmp/libomptarget/src/interface.cpp index d92f40ce1d14..d9e87640161f 100644 --- a/openmp/libomptarget/src/interface.cpp +++ b/openmp/libomptarget/src/interface.cpp @@ -14,10 +14,7 @@ #include "OpenMP/OMPT/Interface.h" #include "OpenMP/OMPT/Callback.h" #include "PluginManager.h" -#include "device.h" -#include "omptarget.h" #include "private.h" -#include "rtl.h" #include "Shared/EnvironmentVar.h" #include "Shared/Profile.h" @@ -28,8 +25,6 @@ #include #include #include -#include -#include #ifdef OMPT_SUPPORT using namespace llvm::omp::target::ompt;