This revision was automatically updated to reflect the committed changes. Closed by commit rG92d8ad02e92f: [HIP] Fix rocm not found on rocm3.5 (authored by yaxunl). Herald added a project: clang.
Changed prior to commit: https://reviews.llvm.org/D81713?vs=270298&id=271689#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81713/new/ https://reviews.llvm.org/D81713 Files: clang/lib/Driver/ToolChains/AMDGPU.cpp Index: clang/lib/Driver/ToolChains/AMDGPU.cpp =================================================================== --- clang/lib/Driver/ToolChains/AMDGPU.cpp +++ clang/lib/Driver/ToolChains/AMDGPU.cpp @@ -25,6 +25,7 @@ assert(!LibDevicePath.empty()); const StringRef Suffix(".bc"); + const StringRef Suffix2(".amdgcn.bc"); std::error_code EC; for (llvm::vfs::directory_iterator @@ -36,7 +37,11 @@ if (!FileName.endswith(Suffix)) continue; - StringRef BaseName = FileName.drop_back(Suffix.size()); + StringRef BaseName; + if (FileName.endswith(Suffix2)) + BaseName = FileName.drop_back(Suffix2.size()); + else if (FileName.endswith(Suffix)) + BaseName = FileName.drop_back(Suffix.size()); if (BaseName == "ocml") { OCML = FilePath;
Index: clang/lib/Driver/ToolChains/AMDGPU.cpp =================================================================== --- clang/lib/Driver/ToolChains/AMDGPU.cpp +++ clang/lib/Driver/ToolChains/AMDGPU.cpp @@ -25,6 +25,7 @@ assert(!LibDevicePath.empty()); const StringRef Suffix(".bc"); + const StringRef Suffix2(".amdgcn.bc"); std::error_code EC; for (llvm::vfs::directory_iterator @@ -36,7 +37,11 @@ if (!FileName.endswith(Suffix)) continue; - StringRef BaseName = FileName.drop_back(Suffix.size()); + StringRef BaseName; + if (FileName.endswith(Suffix2)) + BaseName = FileName.drop_back(Suffix2.size()); + else if (FileName.endswith(Suffix)) + BaseName = FileName.drop_back(Suffix.size()); if (BaseName == "ocml") { OCML = FilePath;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits