Skip to content

Commit 8146781

Browse files
author
Hugh Delaney
committed
Change flag and fix clang tests.
1 parent 08683ef commit 8146781

File tree

5 files changed

+213
-46
lines changed

5 files changed

+213
-46
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -956,13 +956,12 @@ def cuda_include_ptx_EQ : Joined<["--"], "cuda-include-ptx=">, Flags<[NoXarchOpt
956956
HelpText<"Include PTX for the following GPU architecture (e.g. sm_35) or 'all'. May be specified more than once.">;
957957
def no_cuda_include_ptx_EQ : Joined<["--"], "no-cuda-include-ptx=">, Flags<[NoXarchOption]>,
958958
HelpText<"Do not include PTX for the following GPU architecture (e.g. sm_35) or 'all'. May be specified more than once.">;
959-
def fbundle_no_offload_arch : Flag<["-"], "fbundle-no-offload-arch">, Flags<[CC1Option]>,
959+
def fno_bundle_offload_arch : Flag<["-"], "fno-bundle-offload-arch">,
960960
HelpText<"Specify that the offload bundler should not identify a bundle with "
961-
"any specific arch. When used the bundle for, for instance, "
962-
"`nvptx64-nvidia-cuda-sm_80` becomes instead `nvptx64-nvidia-cuda`. "
961+
"specific arch. For example, the bundle for `nvptx64-nvidia-cuda-sm_80` "
962+
"uses the bundle tag `nvptx64-nvidia-cuda` when used. "
963963
"This allows .o files to contain .bc bundles that are unspecific "
964-
"to a particular arch version.">,
965-
MarshallingInfoFlag<CodeGenOpts<"BundleNoOffloadArch">>;
964+
"to a particular arch version.">;
966965
def offload_arch_EQ : Joined<["--"], "offload-arch=">, Flags<[NoXarchOption]>,
967966
HelpText<"CUDA offloading device architecture (e.g. sm_35), or HIP offloading target ID in the form of a "
968967
"device architecture followed by target ID features delimited by a colon. Each target ID feature "

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8731,7 +8731,7 @@ void OffloadBundler::ConstructJob(Compilation &C, const JobAction &JA,
87318731
if ((CurKind == Action::OFK_HIP || CurKind == Action::OFK_OpenMP ||
87328732
CurKind == Action::OFK_Cuda || CurKind == Action::OFK_SYCL) &&
87338733
!StringRef(CurDep->getOffloadingArch()).empty() &&
8734-
!TCArgs.hasArg(options::OPT_fbundle_no_offload_arch)) {
8734+
!TCArgs.hasArg(options::OPT_fno_bundle_offload_arch)) {
87358735
Triples += '-';
87368736
Triples += CurDep->getOffloadingArch();
87378737
}
@@ -8912,7 +8912,7 @@ void OffloadBundler::ConstructJobMultipleOutputs(
89128912
Dep.DependentOffloadKind == Action::OFK_Cuda ||
89138913
Dep.DependentOffloadKind == Action::OFK_SYCL) &&
89148914
!Dep.DependentBoundArch.empty() &&
8915-
!TCArgs.hasArg(options::OPT_fbundle_no_offload_arch)) {
8915+
!TCArgs.hasArg(options::OPT_fno_bundle_offload_arch)) {
89168916
Triples += '-';
89178917
Triples += Dep.DependentBoundArch;
89188918
}

clang/test/Driver/sycl-cuda-tu-offload.cu

Lines changed: 68 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,71 @@
3737
// DEFAULT-PHASES2: +- 13: assembler, {12}, object, (host-cuda-sycl)
3838
// DEFAULT-PHASES2: +- 14: offload, "host-cuda-sycl (x86_64-unknown-linux-gnu)" {13}, object
3939
// DEFAULT-PHASES2:+- 15: linker, {14}, image, (host-cuda-sycl)
40-
// DEFAULT-PHASES2:| +- 16: offload, "device-cuda (nvptx64-nvidia-cuda:sm_80)" {5}, ir
41-
// DEFAULT-PHASES2:| +- 17: linker, {16}, ir, (device-sycl, sm_80)
42-
// DEFAULT-PHASES2:| +- 18: sycl-post-link, {17}, ir, (device-sycl, sm_80)
43-
// DEFAULT-PHASES2:| | +- 19: file-table-tform, {18}, ir, (device-sycl, sm_80)
44-
// DEFAULT-PHASES2:| | | +- 20: backend, {19}, assembler, (device-sycl, sm_80)
45-
// DEFAULT-PHASES2:| | | |- 21: assembler, {20}, object, (device-sycl, sm_80)
46-
// DEFAULT-PHASES2:| | |- 22: linker, {20, 21}, cuda-fatbin, (device-sycl, sm_80)
47-
// DEFAULT-PHASES2:| |- 23: foreach, {19, 22}, cuda-fatbin, (device-sycl, sm_80)
48-
// DEFAULT-PHASES2:| +- 24: file-table-tform, {18, 23}, tempfiletable, (device-sycl, sm_80)
49-
// DEFAULT-PHASES2:|- 25: clang-offload-wrapper, {24}, object, (device-sycl, sm_80)
50-
// DEFAULT-PHASES2:26: offload, "host-cuda-sycl (x86_64-unknown-linux-gnu)" {15}, "device-sycl (nvptx64-nvidia-cuda:sm_80)" {25}, image
40+
// DEFAULT-PHASES2:| +- 16: offload, "device-cuda (nvptx64-nvidia-cuda:sm_80)" {5}, ir
41+
// DEFAULT-PHASES2:| +- 17: linker, {16}, ir, (device-sycl, sm_80)
42+
// DEFAULT-PHASES2:| | +- 18: input, "{{.*}}", object
43+
// DEFAULT-PHASES2:| | +- 19: clang-offload-unbundler, {18}, object
44+
// DEFAULT-PHASES2:| |- 20: offload, " (nvptx64-nvidia-cuda)" {19}, object
45+
// DEFAULT-PHASES2:| | +- 21: input, "{{.*}}", object
46+
// DEFAULT-PHASES2:| | +- 22: clang-offload-unbundler, {21}, object
47+
// DEFAULT-PHASES2:| |- 23: offload, " (nvptx64-nvidia-cuda)" {22}, object
48+
// DEFAULT-PHASES2:| | +- 24: input, "{{.*}}", object
49+
// DEFAULT-PHASES2:| | +- 25: clang-offload-unbundler, {24}, object
50+
// DEFAULT-PHASES2:| |- 26: offload, " (nvptx64-nvidia-cuda)" {25}, object
51+
// DEFAULT-PHASES2:| | +- 27: input, "{{.*}}", object
52+
// DEFAULT-PHASES2:| | +- 28: clang-offload-unbundler, {27}, object
53+
// DEFAULT-PHASES2:| |- 29: offload, " (nvptx64-nvidia-cuda)" {28}, object
54+
// DEFAULT-PHASES2:| | +- 30: input, "{{.*}}", object
55+
// DEFAULT-PHASES2:| | +- 31: clang-offload-unbundler, {30}, object
56+
// DEFAULT-PHASES2:| |- 32: offload, " (nvptx64-nvidia-cuda)" {31}, object
57+
// DEFAULT-PHASES2:| | +- 33: input, "{{.*}}", object
58+
// DEFAULT-PHASES2:| | +- 34: clang-offload-unbundler, {33}, object
59+
// DEFAULT-PHASES2:| |- 35: offload, " (nvptx64-nvidia-cuda)" {34}, object
60+
// DEFAULT-PHASES2:| | +- 36: input, "{{.*}}", object
61+
// DEFAULT-PHASES2:| | +- 37: clang-offload-unbundler, {36}, object
62+
// DEFAULT-PHASES2:| |- 38: offload, " (nvptx64-nvidia-cuda)" {37}, object
63+
// DEFAULT-PHASES2:| | +- 39: input, "{{.*}}", object
64+
// DEFAULT-PHASES2:| | +- 40: clang-offload-unbundler, {39}, object
65+
// DEFAULT-PHASES2:| |- 41: offload, " (nvptx64-nvidia-cuda)" {40}, object
66+
// DEFAULT-PHASES2:| | +- 42: input, "{{.*}}", object
67+
// DEFAULT-PHASES2:| | +- 43: clang-offload-unbundler, {42}, object
68+
// DEFAULT-PHASES2:| |- 44: offload, " (nvptx64-nvidia-cuda)" {43}, object
69+
// DEFAULT-PHASES2:| | +- 45: input, "{{.*}}", object
70+
// DEFAULT-PHASES2:| | +- 46: clang-offload-unbundler, {45}, object
71+
// DEFAULT-PHASES2:| |- 47: offload, " (nvptx64-nvidia-cuda)" {46}, object
72+
// DEFAULT-PHASES2:| | +- 48: input, "{{.*}}", object
73+
// DEFAULT-PHASES2:| | +- 49: clang-offload-unbundler, {48}, object
74+
// DEFAULT-PHASES2:| |- 50: offload, " (nvptx64-nvidia-cuda)" {49}, object
75+
// DEFAULT-PHASES2:| | +- 51: input, "{{.*}}", object
76+
// DEFAULT-PHASES2:| | +- 52: clang-offload-unbundler, {51}, object
77+
// DEFAULT-PHASES2:| |- 53: offload, " (nvptx64-nvidia-cuda)" {52}, object
78+
// DEFAULT-PHASES2:| | +- 54: input, "{{.*}}", object
79+
// DEFAULT-PHASES2:| | +- 55: clang-offload-unbundler, {54}, object
80+
// DEFAULT-PHASES2:| |- 56: offload, " (nvptx64-nvidia-cuda)" {55}, object
81+
// DEFAULT-PHASES2:| | +- 57: input, "{{.*}}", object
82+
// DEFAULT-PHASES2:| | +- 58: clang-offload-unbundler, {57}, object
83+
// DEFAULT-PHASES2:| |- 59: offload, " (nvptx64-nvidia-cuda)" {58}, object
84+
// DEFAULT-PHASES2:| | +- 60: input, "{{.*}}", object
85+
// DEFAULT-PHASES2:| | +- 61: clang-offload-unbundler, {60}, object
86+
// DEFAULT-PHASES2:| |- 62: offload, " (nvptx64-nvidia-cuda)" {61}, object
87+
// DEFAULT-PHASES2:| | +- 63: input, "{{.*}}", object
88+
// DEFAULT-PHASES2:| | +- 64: clang-offload-unbundler, {63}, object
89+
// DEFAULT-PHASES2:| |- 65: offload, " (nvptx64-nvidia-cuda)" {64}, object
90+
// DEFAULT-PHASES2:| | +- 66: input, "{{.*}}", object
91+
// DEFAULT-PHASES2:| | +- 67: clang-offload-unbundler, {66}, object
92+
// DEFAULT-PHASES2:| |- 68: offload, " (nvptx64-nvidia-cuda)" {67}, object
93+
// DEFAULT-PHASES2:| | +- 69: input, "{{.*}}", object
94+
// DEFAULT-PHASES2:| | +- 70: clang-offload-unbundler, {69}, object
95+
// DEFAULT-PHASES2:| |- 71: offload, " (nvptx64-nvidia-cuda)" {70}, object
96+
// DEFAULT-PHASES2:| |- 72: input, "{{.*}}", object, (device-sycl, sm_80)
97+
// DEFAULT-PHASES2:| |- 73: input, "/opt/cuda/nvvm/libdevice/libdevice.10.bc", object, (device-sycl, sm_80)
98+
// DEFAULT-PHASES2:| +- 74: linker, {17, 20, 23, 26, 29, 32, 35, 38, 41, 44, 47, 50, 53, 56, 59, 62, 65, 68, 71, 72, 73}, ir, (device-sycl, sm_80)
99+
// DEFAULT-PHASES2:| +- 75: sycl-post-link, {74}, ir, (device-sycl, sm_80)
100+
// DEFAULT-PHASES2:| | +- 76: file-table-tform, {75}, ir, (device-sycl, sm_80)
101+
// DEFAULT-PHASES2:| | | +- 77: backend, {76}, assembler, (device-sycl, sm_80)
102+
// DEFAULT-PHASES2:| | | |- 78: assembler, {77}, object, (device-sycl, sm_80)
103+
// DEFAULT-PHASES2:| | |- 79: linker, {77, 78}, cuda-fatbin, (device-sycl, sm_80)
104+
// DEFAULT-PHASES2:| |- 80: foreach, {76, 79}, cuda-fatbin, (device-sycl, sm_80)
105+
// DEFAULT-PHASES2:| +- 81: file-table-tform, {75, 80}, tempfiletable, (device-sycl, sm_80)
106+
// DEFAULT-PHASES2:|- 82: clang-offload-wrapper, {81}, object, (device-sycl, sm_80)
107+
// DEFAULT-PHASES2:83: offload, "host-cuda-sycl (x86_64-unknown-linux-gnu)" {15}, "device-sycl (nvptx64-nvidia-cuda:sm_80)" {82}, image

clang/test/Driver/sycl-instrumentation.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
// RUN: %clangxx -fsycl -fno-sycl-instrument-device-code -fsycl-targets=spir64 -### %s 2>&1 \
2323
// RUN: | FileCheck -check-prefixes=CHECK-NONPASSED %s
2424
// RUN: %clangxx -fsycl -fsycl-targets=nvptx64-nvidia-cuda -fno-sycl-instrument-device-code -nocudalib -### %s 2>&1 \
25-
// RUN: | FileCheck -check-prefixes=CHECK-NONPASSED,CHECK-WARNING %s
25+
// RUN: | FileCheck -check-prefixes=CHECK-NONPASSED %s
2626
// CHECK-NONPASSED-NOT: "-fsycl-instrument-device-code"
2727
// CHECK-NONPASSED-NOT: "-input={{.*}}libsycl-itt-{{.*}}.{{o|obj}}"
28-
// CHECK-WARNING: warning: argument unused during compilation: '-fno-sycl-instrument-device-code'

0 commit comments

Comments
 (0)