Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2256,6 +2256,12 @@ linkAndWrapDeviceFiles(ArrayRef<SmallVector<OffloadFile>> LinkerInputFiles,

auto &SplitModules = *SplitModulesOrErr;
const llvm::Triple Triple(LinkerArgs.getLastArgValue(OPT_triple_EQ));
StringRef Arch = LinkerArgs.getLastArgValue(OPT_arch_EQ);
if (Arch.empty())
Arch = "native";
// TODO: Take into account Arch values considered as JIT: "native",
// "spir64", "spir", "spirv32" and "spirv64" for SPIR targets.
// For now we only consider NoSubArch target as JIT.
bool IsJIT = Triple.isSPIROrSPIRV() &&
Triple.getSubArch() == llvm::Triple::NoSubArch;
if ((Triple.isNVPTX() || Triple.isAMDGCN()) &&
Expand All @@ -2273,9 +2279,6 @@ linkAndWrapDeviceFiles(ArrayRef<SmallVector<OffloadFile>> LinkerInputFiles,
}
for (size_t I = 0, E = SplitModules.size(); I != E; ++I) {
SmallVector<StringRef> Files = {SplitModules[I].ModuleFilePath};
StringRef Arch = LinkerArgs.getLastArgValue(OPT_arch_EQ);
if (Arch.empty())
Arch = "native";
SmallVector<std::pair<StringRef, StringRef>, 4> BundlerInputFiles;
auto ClangOutputOrErr =
linkDevice(Files, LinkerArgs, true /* IsSYCLKind */,
Expand Down
Loading