Skip to content

Commit b46b307

Browse files
committed
clang/AMDGPU: Stop looking for hip.bc in device libs
This has been an empty library since January 2023
1 parent 0d19efa commit b46b307

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
@@ -127,7 +127,6 @@ class RocmInstallationDetector {
127127

128128
// Libraries that are always linked depending on the language
129129
SmallString<0> OpenCL;
130-
SmallString<0> HIP;
131130

132131
// Asan runtime library
133132
SmallString<0> AsanRTL;
@@ -149,7 +148,7 @@ class RocmInstallationDetector {
149148
bool Verbose;
150149

151150
bool allGenericLibsValid() const {
152-
return !OCML.empty() && !OCKL.empty() && !OpenCL.empty() && !HIP.empty() &&
151+
return !OCML.empty() && !OCKL.empty() && !OpenCL.empty() &&
153152
WavefrontSize64.isValid() && FiniteOnly.isValid() &&
154153
UnsafeMath.isValid() && DenormalsAreZero.isValid() &&
155154
CorrectlyRoundedSqrt.isValid();
@@ -229,11 +228,6 @@ class RocmInstallationDetector {
229228
return OpenCL;
230229
}
231230

232-
StringRef getHIPPath() const {
233-
assert(!HIP.empty());
234-
return HIP;
235-
}
236-
237231
/// Returns empty string of Asan runtime library is not available.
238232
StringRef getAsanRTLPath() const { return AsanRTL; }
239233

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)