[PATCH] D119638: [OpenMP][NFC] Simplify identifying the device bitcode library
Joseph Huber via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Feb 12 11:56:12 PST 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa0e8077d285a: [OpenMP][NFC] Simplify identifying the device bitcode library (authored by jhuber6).
Changed prior to commit:
https://reviews.llvm.org/D119638?vs=408193&id=408208#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119638/new/
https://reviews.llvm.org/D119638
Files:
clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Driver/ToolChains/CommonArgs.cpp
clang/lib/Driver/ToolChains/Cuda.cpp
Index: clang/lib/Driver/ToolChains/Cuda.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Cuda.cpp
+++ clang/lib/Driver/ToolChains/Cuda.cpp
@@ -748,9 +748,7 @@
if (getDriver().isUsingLTO(/* IsOffload */ true))
return;
- std::string BitcodeSuffix = "nvptx-" + GpuArch.str();
-
- addOpenMPDeviceRTL(getDriver(), DriverArgs, CC1Args, BitcodeSuffix,
+ addOpenMPDeviceRTL(getDriver(), DriverArgs, CC1Args, GpuArch.str(),
getTriple());
AddStaticDeviceLibsPostLinking(getDriver(), DriverArgs, CC1Args, "nvptx",
GpuArch, /*isBitCodeSDL=*/true,
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===================================================================
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -2011,8 +2011,9 @@
Triple.isAMDGCN() ? options::OPT_libomptarget_amdgpu_bc_path_EQ
: options::OPT_libomptarget_nvptx_bc_path_EQ;
- StringRef ArchPrefix = Triple.isAMDGCN() ? "amdgcn" : "nvptx";
- std::string LibOmpTargetName = "libomptarget-" + BitcodeSuffix.str() + ".bc";
+ StringRef ArchPrefix = Triple.isAMDGCN() ? "amdgpu" : "nvptx";
+ std::string LibOmpTargetName =
+ ("libomptarget-" + ArchPrefix + "-" + BitcodeSuffix + ".bc").str();
// First check whether user specifies bc library
if (const Arg *A = DriverArgs.getLastArg(LibomptargetBCPathOpt)) {
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -8212,15 +8212,8 @@
const ArgList &TCArgs = C.getArgsForToolChain(TC, "", Action::OFK_OpenMP);
StringRef Arch = TCArgs.getLastArgValue(options::OPT_march_EQ);
- std::string BitcodeSuffix;
- if (TC->getTriple().isNVPTX())
- BitcodeSuffix += "nvptx-";
- else if (TC->getTriple().isAMDGPU())
- BitcodeSuffix += "amdgpu-";
- BitcodeSuffix += Arch;
-
ArgStringList BitcodeLibrary;
- addOpenMPDeviceRTL(TCDriver, TCArgs, BitcodeLibrary, BitcodeSuffix,
+ addOpenMPDeviceRTL(TCDriver, TCArgs, BitcodeLibrary, Arch,
TC->getTriple());
if (!BitcodeLibrary.empty())
Index: clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
===================================================================
--- clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
+++ clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
@@ -289,10 +289,7 @@
if (getDriver().isUsingLTO(/* IsOffload */ true))
return;
- std::string BitcodeSuffix = "amdgpu-" + GPUArch;
-
- addOpenMPDeviceRTL(getDriver(), DriverArgs, CC1Args, BitcodeSuffix,
- getTriple());
+ addOpenMPDeviceRTL(getDriver(), DriverArgs, CC1Args, GPUArch, getTriple());
}
llvm::opt::DerivedArgList *AMDGPUOpenMPToolChain::TranslateArgs(
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119638.408208.patch
Type: text/x-patch
Size: 2976 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220212/ac2eff46/attachment.bin>
More information about the cfe-commits
mailing list