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::sys::fs::directory_iterator LI(LibDevicePath, EC), LE; @@ -34,7 +35,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;