Skip to content

Commit 54cdc75

Browse files
authored
clang/AMDGPU: Stop looking for hip.bc in device libs (#134801)
This has been an empty library since January 2023
1 parent e3f5a1b commit 54cdc75

File tree

5 files changed

+5
-17
lines changed

5 files changed

+5
-17
lines changed

clang/lib/Driver/ToolChains/AMDGPU.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ void RocmInstallationDetector::scanLibDevicePath(llvm::StringRef Path) {
5959
OCKL = FilePath;
6060
} else if (BaseName == "opencl") {
6161
OpenCL = FilePath;
62-
} else if (BaseName == "hip") {
63-
HIP = FilePath;
6462
} else if (BaseName == "asanrtl") {
6563
AsanRTL = FilePath;
6664
} else if (BaseName == "oclc_finite_only_off") {

clang/lib/Driver/ToolChains/HIPAMD.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,6 @@ HIPAMDToolChain::getDeviceLibs(const llvm::opt::ArgList &DriverArgs) const {
392392
StringRef GpuArch = getGPUArch(DriverArgs);
393393
assert(!GpuArch.empty() && "Must have an explicit GPU arch.");
394394

395-
// Add the HIP specific bitcode library.
396-
BCLibs.emplace_back(RocmInstallation->getHIPPath());
397-
398395
// Add common device libraries like ocml etc.
399396
for (auto N : getCommonDeviceLibNames(DriverArgs, GpuArch.str()))
400397
BCLibs.emplace_back(N);

clang/lib/Driver/ToolChains/ROCm.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ class RocmInstallationDetector {
129129

130130
// Libraries that are always linked depending on the language
131131
SmallString<0> OpenCL;
132-
SmallString<0> HIP;
133132

134133
// Asan runtime library
135134
SmallString<0> AsanRTL;
@@ -151,7 +150,7 @@ class RocmInstallationDetector {
151150
bool Verbose;
152151

153152
bool allGenericLibsValid() const {
154-
return !OCML.empty() && !OCKL.empty() && !OpenCL.empty() && !HIP.empty() &&
153+
return !OCML.empty() && !OCKL.empty() && !OpenCL.empty() &&
155154
WavefrontSize64.isValid() && FiniteOnly.isValid() &&
156155
UnsafeMath.isValid() && DenormalsAreZero.isValid() &&
157156
CorrectlyRoundedSqrt.isValid();
@@ -231,11 +230,6 @@ class RocmInstallationDetector {
231230
return OpenCL;
232231
}
233232

234-
StringRef getHIPPath() const {
235-
assert(!HIP.empty());
236-
return HIP;
237-
}
238-
239233
/// Returns empty string of Asan runtime library is not available.
240234
StringRef getAsanRTLPath() const { return AsanRTL; }
241235

clang/test/Driver/hip-device-libs.hip

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,9 @@
208208
// ALL-NOT: error:
209209
// ALL: {{"[^"]*clang[^"]*"}}
210210

211-
// RESDIR-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR:[^"]+(/|\\\\)rocm_resource_dir(/|\\\\)lib(64)?(/|\\\\)amdgcn(/|\\\\).*]]hip.bc"
212-
// ROCMDIR-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR:[^"]+(/|\\\\)rocm(/|\\\\)amdgcn(/|\\\\).*]]hip.bc"
211+
// RESDIR-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR:[^"]+(/|\\\\)rocm_resource_dir(/|\\\\)lib(64)?(/|\\\\)amdgcn(/|\\\\).*]]ocml.bc"
212+
// ROCMDIR-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR:[^"]+(/|\\\\)rocm(/|\\\\)amdgcn(/|\\\\).*]]ocml.bc"
213213

214-
// ALL-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR]]ocml.bc"
215214
// ALL-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR]]ockl.bc"
216215

217216
// FLUSHD-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR]]oclc_daz_opt_on.bc"

clang/test/Driver/hip-sanitize-options.hip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@
5252
// CHECK-NOT: {{"[^"]*lld(\.exe){0,1}".* ".*hip.bc"}}
5353
// CHECK: {{"[^"]*clang[^"]*".* "-triple" "x86_64-unknown-linux-gnu".* "-fsanitize=address"}}
5454

55-
// NORDC: {{"[^"]*clang[^"]*".* "-emit-obj".* "-fcuda-is-device".* "-mlink-builtin-bitcode" ".*hip.bc".* "-mlink-bitcode-file" ".*asanrtl.bc".* "-fsanitize=address".*}} "-o" "[[OUT:[^"]*.o]]"
55+
// NORDC: {{"[^"]*clang[^"]*".* "-emit-obj".* "-fcuda-is-device".* .* "-mlink-bitcode-file" ".*asanrtl.bc".* "-fsanitize=address".*}} "-o" "[[OUT:[^"]*.o]]"
5656
// NORDC-NOT: {{"[^"]*lld(\.exe){0,1}".*}} "[[OUT]]" {{".*asanrtl.bc" ".*hip.bc"}}
5757
// NORDC: {{"[^"]*clang[^"]*".* "-triple" "x86_64-unknown-linux-gnu".* "-fsanitize=address"}}
5858

5959
// RDC: {{"[^"]*clang[^"]*".* "-triple" "x86_64-unknown-linux-gnu".* "-fsanitize=address"}}
60-
// RDC: {{"[^"]*clang[^"]*".* "-emit-llvm-bc".* "-fcuda-is-device".* "-mlink-builtin-bitcode" ".*hip.bc".* "-mlink-bitcode-file" ".*asanrtl.bc".* "-fsanitize=address".*}} "-o" "[[OUT:[^"]*.bc]]"
60+
// RDC: {{"[^"]*clang[^"]*".* "-emit-llvm-bc".* "-fcuda-is-device".* "-mlink-bitcode-file" ".*asanrtl.bc".* "-fsanitize=address".*}} "-o" "[[OUT:[^"]*.bc]]"
6161
// RDC-NOT: {{"[^"]*lld(\.exe){0,1}".*}} "[[OUT]]" {{".*asanrtl.bc" ".*hip.bc"}}
6262

6363
// FAIL: error: cannot find ROCm device library for ABI version 5; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library

0 commit comments

Comments
 (0)