Skip to content

Commit 254e98e

Browse files
author
Martin Wehking
committed
Create one bitcode library for AMD and NVPTX
Enable compilation of libdevice for AMD by adding AMDGCN to macro guarded code parts in libdevice for enabling e.g. standard library math function. Add compilation workflow to SYCLLibdevice.cmake for AMD. Create single bitcode libraries for AMD and NVPTX by compiling each libdev file into bitcode first, linking these together and running opt on them. Strip away metadata by reusing prepare_builtins from libclc and making the resulting library architecture independent. Remove NVPTX bundles from the libdev object files and remove any unbundling action spawned by the Clang driver for the SYCL toolchain when compiling for the NVPTX backend. Make the driver link against the single bitcode libraries for AMD and NVPTX for the SYCL toolchain when device library linkage is not excluded. Ensure that the clang tests check for the correctness of the new clang driver actions and check if the driver still links the device code against the itt device libraries when device library linkage has been excluded. Refactor SYCLLibdevice.cmake by creating functions and grouping e.g. the same compilation flags for a filetype together in one variable. Reuse these variables and call functions to remove redundancies. Fix a compilation error of Intel math function libraries for MSVC when targeting AMD. Include "device.h" before including "device_imf.hpp" to avoid the inclusion of <type_traits>, which failed with a redefinition of symbols error.
1 parent de0260f commit 254e98e

35 files changed

+612
-618
lines changed

clang/lib/Driver/Driver.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5533,7 +5533,7 @@ class OffloadingActionBuilder final {
55335533
// AOT compilation.
55345534
bool SYCLDeviceLibLinked = false;
55355535
Action *NativeCPULib = nullptr;
5536-
if (IsSPIR || IsNVPTX || IsSYCLNativeCPU) {
5536+
if (IsSPIR || IsNVPTX || IsAMDGCN|| IsSYCLNativeCPU) {
55375537
bool UseJitLink =
55385538
IsSPIR &&
55395539
Args.hasFlag(options::OPT_fsycl_device_lib_jit_link,
@@ -5848,10 +5848,9 @@ class OffloadingActionBuilder final {
58485848
++NumOfDeviceLibLinked;
58495849
Arg *InputArg = MakeInputArg(Args, C.getDriver().getOpts(),
58505850
Args.MakeArgString(LibName));
5851-
if (TC->getTriple().isNVPTX() ||
5852-
(TC->getTriple().isSPIR() &&
5851+
if (TC->getTriple().isSPIR() &&
58535852
TC->getTriple().getSubArch() ==
5854-
llvm::Triple::SPIRSubArch_fpga)) {
5853+
llvm::Triple::SPIRSubArch_fpga) {
58555854
auto *SYCLDeviceLibsInputAction =
58565855
C.MakeAction<InputAction>(*InputArg, types::TY_Object);
58575856
auto *SYCLDeviceLibsUnbundleAction =

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 41 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,10 @@ static bool selectBfloatLibs(const llvm::Triple &Triple, const Compilation &C,
165165

166166
// spir64 target is actually JIT compilation, so we defer selection of
167167
// bfloat16 libraries to runtime. For AOT we need libraries, but skip
168-
// for Nvidia.
168+
// for Nvidia and AMD.
169169
NeedLibs =
170-
Triple.getSubArch() != llvm::Triple::NoSubArch && !Triple.isNVPTX();
170+
Triple.getSubArch() != llvm::Triple::NoSubArch && !Triple.isNVPTX()
171+
&& !Triple.isAMDGCN();
171172
UseNative = false;
172173
if (NeedLibs && Triple.getSubArch() == llvm::Triple::SPIRSubArch_gen &&
173174
C.hasOffloadToolChain<Action::OFK_SYCL>()) {
@@ -212,12 +213,17 @@ SYCL::getDeviceLibraries(const Compilation &C, const llvm::Triple &TargetTriple,
212213
SmallVector<std::string, 8> LibraryList;
213214
const llvm::opt::ArgList &Args = C.getArgs();
214215

216+
// For NVPTX and AMDGCN we only use one single bitcode library and ignore
217+
// manually specified SYCL device libraries.
218+
bool ignore_single_libs = TargetTriple.isNVPTX() || TargetTriple.isAMDGCN();
219+
215220
struct DeviceLibOptInfo {
216221
StringRef DeviceLibName;
217222
StringRef DeviceLibOption;
218223
};
219224

220225
bool NoDeviceLibs = false;
226+
221227
// Currently, all SYCL device libraries will be linked by default. Linkage
222228
// of "internal" libraries cannot be affected via -fno-sycl-device-lib.
223229
llvm::StringMap<bool> DeviceLibLinkInfo = {
@@ -233,10 +239,12 @@ SYCL::getDeviceLibraries(const Compilation &C, const llvm::Triple &TargetTriple,
233239
if (A->getOption().matches(options::OPT_fno_sycl_device_lib_EQ))
234240
NoDeviceLibs = true;
235241

242+
bool printUnusedLibWarning = false;
236243
for (StringRef Val : A->getValues()) {
237244
if (Val == "all") {
238245
for (const auto &K : DeviceLibLinkInfo.keys())
239-
DeviceLibLinkInfo[K] = true && (!NoDeviceLibs || K == "internal");
246+
DeviceLibLinkInfo[K] = (!ignore_single_libs && !NoDeviceLibs) || (K == "internal" && NoDeviceLibs) ;
247+
printUnusedLibWarning = false;
240248
break;
241249
}
242250
auto LinkInfoIter = DeviceLibLinkInfo.find(Val);
@@ -247,10 +255,25 @@ SYCL::getDeviceLibraries(const Compilation &C, const llvm::Triple &TargetTriple,
247255
C.getDriver().Diag(diag::err_drv_unsupported_option_argument)
248256
<< A->getSpelling() << Val;
249257
}
250-
DeviceLibLinkInfo[Val] = true && !NoDeviceLibs;
258+
DeviceLibLinkInfo[Val] = true && !NoDeviceLibs && !ignore_single_libs;
259+
printUnusedLibWarning = ignore_single_libs && !NoDeviceLibs && true;
251260
}
261+
if (printUnusedLibWarning)
262+
C.getDriver().Diag(diag::warn_ignored_clang_option)
263+
<< A->getSpelling() << A->getAsString(Args);
252264
}
253265
}
266+
267+
if (TargetTriple.isNVPTX() && !NoDeviceLibs) {
268+
LibraryList.push_back(Args.MakeArgString("devicelib--cuda.bc"));
269+
}
270+
if (TargetTriple.isAMDGCN() && !NoDeviceLibs) {
271+
LibraryList.push_back(Args.MakeArgString("devicelib--amd.bc"));
272+
}
273+
274+
if (ignore_single_libs && !NoDeviceLibs)
275+
return LibraryList;
276+
254277
using SYCLDeviceLibsList = SmallVector<DeviceLibOptInfo, 5>;
255278

256279
const SYCLDeviceLibsList SYCLDeviceWrapperLibs = {
@@ -304,10 +327,9 @@ SYCL::getDeviceLibraries(const Compilation &C, const llvm::Triple &TargetTriple,
304327
C.getDefaultToolChain().getTriple().isWindowsMSVCEnvironment();
305328
bool IsNewOffload = C.getDriver().getUseNewOffloadingDriver();
306329
StringRef LibSuffix = ".bc";
307-
if (TargetTriple.isNVPTX() ||
308-
(TargetTriple.isSPIR() &&
330+
if ((TargetTriple.isSPIR() &&
309331
TargetTriple.getSubArch() == llvm::Triple::SPIRSubArch_fpga))
310-
// For NVidia or FPGA, we are unbundling objects.
332+
// For FPGA, we are unbundling objects.
311333
LibSuffix = IsWindowsMSVCEnv ? ".obj" : ".o";
312334
if (IsNewOffload)
313335
// For new offload model, we use packaged .bc files.
@@ -323,7 +345,7 @@ SYCL::getDeviceLibraries(const Compilation &C, const llvm::Triple &TargetTriple,
323345
};
324346

325347
addLibraries(SYCLDeviceWrapperLibs);
326-
if (IsSpirvAOT || TargetTriple.isNVPTX())
348+
if (IsSpirvAOT)
327349
addLibraries(SYCLDeviceFallbackLibs);
328350

329351
bool NativeBfloatLibs;
@@ -482,35 +504,19 @@ void SYCL::populateSYCLDeviceTraitsMacrosArgs(
482504
// The list should match pre-built SYCL device library files located in
483505
// compiler package. Once we add or remove any SYCL device library files,
484506
// the list should be updated accordingly.
485-
static llvm::SmallVector<StringRef, 16> SYCLDeviceLibList{
486-
"bfloat16",
487-
"crt",
488-
"cmath",
489-
"cmath-fp64",
490-
"complex",
491-
"complex-fp64",
507+
static llvm::SmallVector<StringRef, 16> SYCLDeviceLibList {
508+
"bfloat16", "crt", "cmath", "cmath-fp64", "complex", "complex-fp64",
492509
#if defined(_WIN32)
493-
"msvc-math",
510+
"msvc-math",
494511
#else
495-
"sanitizer",
512+
"sanitizer",
496513
#endif
497-
"imf",
498-
"imf-fp64",
499-
"imf-bf16",
500-
"itt-compiler-wrappers",
501-
"itt-stubs",
502-
"itt-user-wrappers",
503-
"fallback-cassert",
504-
"fallback-cstring",
505-
"fallback-cmath",
506-
"fallback-cmath-fp64",
507-
"fallback-complex",
508-
"fallback-complex-fp64",
509-
"fallback-imf",
510-
"fallback-imf-fp64",
511-
"fallback-imf-bf16",
512-
"fallback-bfloat16",
513-
"native-bfloat16"};
514+
"imf", "imf-fp64", "imf-bf16", "itt-compiler-wrappers", "itt-stubs",
515+
"itt-user-wrappers", "fallback-cassert", "fallback-cstring",
516+
"fallback-cmath", "fallback-cmath-fp64", "fallback-complex",
517+
"fallback-complex-fp64", "fallback-imf", "fallback-imf-fp64",
518+
"fallback-imf-bf16", "fallback-bfloat16", "native-bfloat16"
519+
};
514520

515521
const char *SYCL::Linker::constructLLVMLinkCommand(
516522
Compilation &C, const JobAction &JA, const InputInfo &Output,
@@ -551,7 +557,7 @@ const char *SYCL::Linker::constructLLVMLinkCommand(
551557
this->getToolChain().getTriple().getSubArch() ==
552558
llvm::Triple::SPIRSubArch_fpga;
553559
StringRef LibPostfix = ".bc";
554-
if (IsNVPTX || IsFPGA) {
560+
if (IsFPGA) {
555561
LibPostfix = ".o";
556562
if (HostTC->getTriple().isWindowsMSVCEnvironment() &&
557563
C.getDriver().IsCLMode())

clang/test/Driver/sycl-offload-amdgcn.cpp

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,19 @@
3737
// CHK-PHASES-NO-CC: 7: backend, {6}, assembler, (host-sycl)
3838
// CHK-PHASES-NO-CC: 8: assembler, {7}, object, (host-sycl)
3939
// CHK-PHASES-NO-CC: 9: linker, {4}, ir, (device-sycl, gfx906)
40-
// CHK-PHASES-NO-CC: 10: sycl-post-link, {9}, ir, (device-sycl, gfx906)
41-
// CHK-PHASES-NO-CC: 11: file-table-tform, {10}, ir, (device-sycl, gfx906)
42-
// CHK-PHASES-NO-CC: 12: backend, {11}, assembler, (device-sycl, gfx906)
43-
// CHK-PHASES-NO-CC: 13: assembler, {12}, object, (device-sycl, gfx906)
44-
// CHK-PHASES-NO-CC: 14: linker, {13}, image, (device-sycl, gfx906)
45-
// CHK-PHASES-NO-CC: 15: linker, {14}, hip-fatbin, (device-sycl, gfx906)
46-
// CHK-PHASES-NO-CC: 16: foreach, {11, 15}, hip-fatbin, (device-sycl, gfx906)
47-
// CHK-PHASES-NO-CC: 17: file-table-tform, {10, 16}, tempfiletable, (device-sycl, gfx906)
48-
// CHK-PHASES-NO-CC: 18: clang-offload-wrapper, {17}, object, (device-sycl, gfx906)
49-
// CHK-PHASES-NO-CC: 19: offload, "device-sycl (amdgcn-amd-amdhsa:gfx906)" {18}, object
50-
// CHK-PHASES-NO-CC: 20: linker, {8, 19}, image, (host-sycl)
40+
// CHK-PHASES-NO-CC: 10: input, "{{.*}}", ir, (device-sycl, gfx906)
41+
// CHK-PHASES-NO-CC: 11: linker, {9, 10}, ir, (device-sycl, gfx906)
42+
// CHK-PHASES-NO-CC: 12: sycl-post-link, {11}, ir, (device-sycl, gfx906)
43+
// CHK-PHASES-NO-CC: 13: file-table-tform, {12}, ir, (device-sycl, gfx906)
44+
// CHK-PHASES-NO-CC: 14: backend, {13}, assembler, (device-sycl, gfx906)
45+
// CHK-PHASES-NO-CC: 15: assembler, {14}, object, (device-sycl, gfx906)
46+
// CHK-PHASES-NO-CC: 16: linker, {15}, image, (device-sycl, gfx906)
47+
// CHK-PHASES-NO-CC: 17: linker, {16}, hip-fatbin, (device-sycl, gfx906)
48+
// CHK-PHASES-NO-CC: 18: foreach, {13, 17}, hip-fatbin, (device-sycl, gfx906)
49+
// CHK-PHASES-NO-CC: 19: file-table-tform, {12, 18}, tempfiletable, (device-sycl, gfx906)
50+
// CHK-PHASES-NO-CC: 20: clang-offload-wrapper, {19}, object, (device-sycl, gfx906)
51+
// CHK-PHASES-NO-CC: 21: offload, "device-sycl (amdgcn-amd-amdhsa:gfx906)" {20}, object
52+
// CHK-PHASES-NO-CC: 22: linker, {8, 21}, image, (host-sycl)
5153

5254
/// Check that we only unbundle an archive once.
5355
// RUN: %clangxx -### -target x86_64-unknown-linux-gnu -fsycl -nogpulib \

clang/test/Driver/sycl-offload-nvptx.cpp

Lines changed: 32 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -53,28 +53,22 @@
5353
// CHK-PHASES-NO-CC: 7: backend, {6}, assembler, (host-sycl)
5454
// CHK-PHASES-NO-CC: 8: assembler, {7}, object, (host-sycl)
5555
// CHK-PHASES-NO-CC: 9: linker, {4}, ir, (device-sycl, sm_50)
56-
// CHK-PHASES-NO-CC: 10: input, "{{.*}}libsycl-itt-user-wrappers.o{{.*}}", object
57-
// CHK-PHASES-NO-CC: 11: clang-offload-unbundler, {10}, object
58-
// CHK-PHASES-NO-CC: 12: offload, " (nvptx64-nvidia-cuda)" {11}, object
59-
// CHK-PHASES-NO-CC: 13: input, "{{.*}}libsycl-itt-compiler-wrappers.o{{.*}}", object
60-
// CHK-PHASES-NO-CC: 14: clang-offload-unbundler, {13}, object
61-
// CHK-PHASES-NO-CC: 15: offload, " (nvptx64-nvidia-cuda)" {14}, object
62-
// CHK-PHASES-NO-CC: 16: input, "{{.*}}libsycl-itt-stubs.o{{.*}}", object
63-
// CHK-PHASES-NO-CC: 17: clang-offload-unbundler, {16}, object
64-
// CHK-PHASES-NO-CC: 18: offload, " (nvptx64-nvidia-cuda)" {17}, object
65-
// CHK-PHASES-NO-CC: 19: input, "{{.*}}nvidiacl{{.*}}", ir, (device-sycl, sm_50)
66-
// CHK-PHASES-NO-CC: 20: input, "{{.*}}libdevice{{.*}}", ir, (device-sycl, sm_50)
67-
// CHK-PHASES-NO-CC: 21: linker, {9, 12, 15, 18, 19, 20}, ir, (device-sycl, sm_50)
68-
// CHK-PHASES-NO-CC: 22: sycl-post-link, {21}, ir, (device-sycl, sm_50)
69-
// CHK-PHASES-NO-CC: 23: file-table-tform, {22}, ir, (device-sycl, sm_50)
70-
// CHK-PHASES-NO-CC: 24: backend, {23}, assembler, (device-sycl, sm_50)
71-
// CHK-PHASES-NO-CC: 25: assembler, {24}, object, (device-sycl, sm_50)
72-
// CHK-PHASES-NO-CC: 26: linker, {24, 25}, cuda-fatbin, (device-sycl, sm_50)
73-
// CHK-PHASES-NO-CC: 27: foreach, {23, 26}, cuda-fatbin, (device-sycl, sm_50)
74-
// CHK-PHASES-NO-CC: 28: file-table-tform, {22, 27}, tempfiletable, (device-sycl, sm_50)
75-
// CHK-PHASES-NO-CC: 29: clang-offload-wrapper, {28}, object, (device-sycl, sm_50)
76-
// CHK-PHASES-NO-CC: 30: offload, "device-sycl (nvptx64-nvidia-cuda:sm_50)" {29}, object
77-
// CHK-PHASES-NO-CC: 31: linker, {8, 30}, image, (host-sycl)
56+
// CHK-PHASES-NO-CC: 10: input, "{{.*}}libsycl-itt-user-wrappers.bc", ir, (device-sycl, sm_50)
57+
// CHK-PHASES-NO-CC: 11: input, "{{.*}}libsycl-itt-compiler-wrappers.bc", ir, (device-sycl, sm_50)
58+
// CHK-PHASES-NO-CC: 12: input, "{{.*}}libsycl-itt-stubs.bc", ir, (device-sycl, sm_50)
59+
// CHK-PHASES-NO-CC: 13: input, "{{.*}}nvidiacl{{.*}}", ir, (device-sycl, sm_50)
60+
// CHK-PHASES-NO-CC: 14: input, "{{.*}}libdevice{{.*}}", ir, (device-sycl, sm_50)
61+
// CHK-PHASES-NO-CC: 15: linker, {9, 10, 11, 12, 13, 14}, ir, (device-sycl, sm_50)
62+
// CHK-PHASES-NO-CC: 16: sycl-post-link, {15}, ir, (device-sycl, sm_50)
63+
// CHK-PHASES-NO-CC: 17: file-table-tform, {16}, ir, (device-sycl, sm_50)
64+
// CHK-PHASES-NO-CC: 18: backend, {17}, assembler, (device-sycl, sm_50)
65+
// CHK-PHASES-NO-CC: 19: assembler, {18}, object, (device-sycl, sm_50)
66+
// CHK-PHASES-NO-CC: 20: linker, {18, 19}, cuda-fatbin, (device-sycl, sm_50)
67+
// CHK-PHASES-NO-CC: 21: foreach, {17, 20}, cuda-fatbin, (device-sycl, sm_50)
68+
// CHK-PHASES-NO-CC: 22: file-table-tform, {16, 21}, tempfiletable, (device-sycl, sm_50)
69+
// CHK-PHASES-NO-CC: 23: clang-offload-wrapper, {22}, object, (device-sycl, sm_50)
70+
// CHK-PHASES-NO-CC: 24: offload, "device-sycl (nvptx64-nvidia-cuda:sm_50)" {23}, object
71+
// CHK-PHASES-NO-CC: 25: linker, {8, 24}, image, (host-sycl)
7872
//
7973
/// Check phases specifying a compute capability.
8074
// RUN: %clangxx -ccc-print-phases --sysroot=%S/Inputs/SYCL -std=c++11 \
@@ -97,28 +91,22 @@
9791
// CHK-PHASES: 7: backend, {6}, assembler, (host-sycl)
9892
// CHK-PHASES: 8: assembler, {7}, object, (host-sycl)
9993
// CHK-PHASES: 9: linker, {4}, ir, (device-sycl, sm_35)
100-
// CHK-PHASES: 10: input, "{{.*}}libsycl-itt-user-wrappers.o", object
101-
// CHK-PHASES: 11: clang-offload-unbundler, {10}, object
102-
// CHK-PHASES: 12: offload, " (nvptx64-nvidia-cuda)" {11}, object
103-
// CHK-PHASES: 13: input, "{{.*}}libsycl-itt-compiler-wrappers.o", object
104-
// CHK-PHASES: 14: clang-offload-unbundler, {13}, object
105-
// CHK-PHASES: 15: offload, " (nvptx64-nvidia-cuda)" {14}, object
106-
// CHK-PHASES: 16: input, "{{.*}}libsycl-itt-stubs.o", object
107-
// CHK-PHASES: 17: clang-offload-unbundler, {16}, object
108-
// CHK-PHASES: 18: offload, " (nvptx64-nvidia-cuda)" {17}, object
109-
// CHK-PHASES: 19: input, "{{.*}}nvidiacl{{.*}}", ir, (device-sycl, sm_35)
110-
// CHK-PHASES: 20: input, "{{.*}}libdevice{{.*}}", ir, (device-sycl, sm_35)
111-
// CHK-PHASES: 21: linker, {9, 12, 15, 18, 19, 20}, ir, (device-sycl, sm_35)
112-
// CHK-PHASES: 22: sycl-post-link, {21}, ir, (device-sycl, sm_35)
113-
// CHK-PHASES: 23: file-table-tform, {22}, ir, (device-sycl, sm_35)
114-
// CHK-PHASES: 24: backend, {23}, assembler, (device-sycl, sm_35)
115-
// CHK-PHASES: 25: assembler, {24}, object, (device-sycl, sm_35)
116-
// CHK-PHASES: 26: linker, {24, 25}, cuda-fatbin, (device-sycl, sm_35)
117-
// CHK-PHASES: 27: foreach, {23, 26}, cuda-fatbin, (device-sycl, sm_35)
118-
// CHK-PHASES: 28: file-table-tform, {22, 27}, tempfiletable, (device-sycl, sm_35)
119-
// CHK-PHASES: 29: clang-offload-wrapper, {28}, object, (device-sycl, sm_35)
120-
// CHK-PHASES: 30: offload, "device-sycl (nvptx64-nvidia-cuda:sm_35)" {29}, object
121-
// CHK-PHASES: 31: linker, {8, 30}, image, (host-sycl)
94+
// CHK-PHASES: 10: input, "{{.*}}libsycl-itt-user-wrappers.bc", ir, (device-sycl, sm_35)
95+
// CHK-PHASES: 11: input, "{{.*}}libsycl-itt-compiler-wrappers.bc", ir, (device-sycl, sm_35)
96+
// CHK-PHASES: 12: input, "{{.*}}libsycl-itt-stubs.bc", ir, (device-sycl, sm_35)
97+
// CHK-PHASES: 13: input, "{{.*}}nvidiacl{{.*}}", ir, (device-sycl, sm_35)
98+
// CHK-PHASES: 14: input, "{{.*}}libdevice{{.*}}", ir, (device-sycl, sm_35)
99+
// CHK-PHASES: 15: linker, {9, 10, 11, 12, 13, 14}, ir, (device-sycl, sm_35)
100+
// CHK-PHASES: 16: sycl-post-link, {15}, ir, (device-sycl, sm_35)
101+
// CHK-PHASES: 17: file-table-tform, {16}, ir, (device-sycl, sm_35)
102+
// CHK-PHASES: 18: backend, {17}, assembler, (device-sycl, sm_35)
103+
// CHK-PHASES: 19: assembler, {18}, object, (device-sycl, sm_35)
104+
// CHK-PHASES: 20: linker, {18, 19}, cuda-fatbin, (device-sycl, sm_35)
105+
// CHK-PHASES: 21: foreach, {17, 20}, cuda-fatbin, (device-sycl, sm_35)
106+
// CHK-PHASES: 22: file-table-tform, {16, 21}, tempfiletable, (device-sycl, sm_35)
107+
// CHK-PHASES: 23: clang-offload-wrapper, {22}, object, (device-sycl, sm_35)
108+
// CHK-PHASES: 24: offload, "device-sycl (nvptx64-nvidia-cuda:sm_35)" {23}, object
109+
// CHK-PHASES: 25: linker, {8, 24}, image, (host-sycl)
122110

123111
/// Check calling preprocessor only
124112
// RUN: %clangxx -E -fsycl -fsycl-targets=nvptx64-nvidia-cuda -ccc-print-phases %s 2>&1 \

libclc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ if( ENABLE_RUNTIME_SUBNORMAL )
233233
foreach( file subnormal_use_default subnormal_disable )
234234
link_bc(
235235
TARGET ${file}
236+
RSP_DIR ${LIBCLC_ARCH_OBJFILE_DIR}
236237
INPUTS ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/${file}.ll
237238
)
238239
install( FILES $<TARGET_PROPERTY:${file},TARGET_FILE> ARCHIVE
@@ -405,7 +406,6 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
405406
# Enable SPIR-V builtin function declarations, so they don't
406407
# have to be explicity declared in the soruce.
407408
list( APPEND flags -Xclang -fdeclare-spirv-builtins)
408-
409409
set( LIBCLC_ARCH_OBJFILE_DIR "${LIBCLC_OBJFILE_DIR}/${arch_suffix}" )
410410
file( MAKE_DIRECTORY ${LIBCLC_ARCH_OBJFILE_DIR} )
411411

0 commit comments

Comments
 (0)