Skip to content

Commit 48e786a

Browse files
committed
Merge branch 'sycl' into jtodd/bfloat16_support
2 parents f21f62e + a9be546 commit 48e786a

File tree

93 files changed

+2478
-1093
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+2478
-1093
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
fetch-depth: 1
6666
- name: Get subprojects that have doc changes
6767
id: docs-changed-subprojects
68-
uses: tj-actions/changed-files@v44
68+
uses: tj-actions/changed-files@v45
6969
with:
7070
files_yaml: |
7171
llvm:

.github/workflows/pr-code-format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232

3333
- name: Get changed files
3434
id: changed-files
35-
uses: tj-actions/changed-files@v44
35+
uses: tj-actions/changed-files@v45
3636
with:
3737
separator: ","
3838
skip_initial_fetch: true

.github/workflows/release-binaries.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ jobs:
428428

429429
- name: Attest Build Provenance
430430
id: provenance
431-
uses: actions/attest-build-provenance@897ed5eab6ed058a474202017ada7f40bfa52940 # v1.0.0
431+
uses: actions/attest-build-provenance@1c608d11d69870c2092266b3f9a6f3abbf17002c # v1.4.3
432432
with:
433433
subject-path: ${{ needs.prepare.outputs.release-binary-filename }}
434434

.github/workflows/release-sources.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
- name: Attest Build Provenance
9393
if: github.event_name != 'pull_request'
9494
id: provenance
95-
uses: actions/attest-build-provenance@897ed5eab6ed058a474202017ada7f40bfa52940 # v1.0.0
95+
uses: actions/attest-build-provenance@1c608d11d69870c2092266b3f9a6f3abbf17002c # v1.4.3
9696
with:
9797
subject-path: "*.xz"
9898
- if: github.event_name != 'pull_request'

.github/workflows/scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
persist-credentials: false
3737

3838
- name: "Run analysis"
39-
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
39+
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
4040
with:
4141
results_file: results.sarif
4242
results_format: sarif
@@ -57,6 +57,6 @@ jobs:
5757

5858
# Upload the results to GitHub's code scanning dashboard.
5959
- name: "Upload to code-scanning"
60-
uses: github/codeql-action/upload-sarif@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
60+
uses: github/codeql-action/upload-sarif@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
6161
with:
6262
sarif_file: results.sarif

.github/workflows/sycl-nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ jobs:
198198
echo "TAG=$(date +'%Y-%m-%d')-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
199199
fi
200200
- name: Upload binaries
201-
uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0
201+
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
202202
with:
203203
files: |
204204
sycl_linux.tar.gz

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,10 @@ SYCL::getDeviceLibraries(const Compilation &C, const llvm::Triple &TargetTriple,
296296
}
297297

298298
if (TargetTriple.isNVPTX() && IgnoreSingleLibs)
299-
LibraryList.push_back(Args.MakeArgString("devicelib--cuda.bc"));
299+
LibraryList.push_back(Args.MakeArgString("devicelib-nvptx64-nvidia-cuda.bc"));
300300

301301
if (TargetTriple.isAMDGCN() && IgnoreSingleLibs)
302-
LibraryList.push_back(Args.MakeArgString("devicelib--amd.bc"));
302+
LibraryList.push_back(Args.MakeArgString("devicelib-amdgcn-amd-amdhsa.bc"));
303303

304304
if (IgnoreSingleLibs)
305305
return LibraryList;
@@ -1033,7 +1033,7 @@ static OclocInfo PVCDevices[] = {
10331033

10341034
// Determine if any of the given arguments contain any PVC based values for
10351035
// the -device option.
1036-
static bool hasPVCDevice(const ArgStringList &CmdArgs) {
1036+
static bool hasPVCDevice(const ArgStringList &CmdArgs, std::string &DevArg) {
10371037
bool DeviceSeen = false;
10381038
StringRef DeviceArg;
10391039
for (StringRef Arg : CmdArgs) {
@@ -1074,16 +1074,22 @@ static bool hasPVCDevice(const ArgStringList &CmdArgs) {
10741074
// Check for device, version or hex (literal values)
10751075
for (unsigned int I = 0; I < std::size(PVCDevices); I++) {
10761076
if (SingleArg.equals_insensitive(PVCDevices[I].DeviceName) ||
1077-
SingleArg.equals_insensitive(PVCDevices[I].Version))
1077+
SingleArg.equals_insensitive(PVCDevices[I].Version)) {
1078+
DevArg = SingleArg.str();
10781079
return true;
1080+
}
10791081
for (int HexVal : PVCDevices[I].HexValues) {
10801082
int Value = 0;
1081-
if (!SingleArg.getAsInteger(0, Value) && Value == HexVal)
1083+
if (!SingleArg.getAsInteger(0, Value) && Value == HexVal) {
1084+
DevArg = SingleArg.str();
10821085
return true;
1086+
}
10831087
}
10841088
if (CheckShortVersion &&
1085-
StringRef(PVCDevices[I].Version).starts_with(SingleArg))
1089+
StringRef(PVCDevices[I].Version).starts_with(SingleArg)) {
1090+
DevArg = SingleArg.str();
10861091
return true;
1092+
}
10871093
}
10881094
}
10891095
return false;
@@ -1659,8 +1665,13 @@ void SYCLToolChain::AddImpliedTargetArgs(const llvm::Triple &Triple,
16591665
Args.AddAllArgValues(TargArgs, options::OPT_Xs, options::OPT_Xs_separate);
16601666
Args.AddAllArgValues(TargArgs, options::OPT_Xsycl_backend);
16611667
// Check for any -device settings.
1662-
if (IsJIT || Device == "pvc" || hasPVCDevice(TargArgs)) {
1668+
std::string DevArg;
1669+
if (IsJIT || Device == "pvc" || hasPVCDevice(TargArgs, DevArg)) {
1670+
// The -device option passed in by the user may not be 'pvc'. Use the
1671+
// value provided by the user if it was specified.
16631672
StringRef DeviceName = "pvc";
1673+
if (!DevArg.empty())
1674+
DeviceName = DevArg;
16641675
StringRef BackendOptName = SYCL::gen::getGenGRFFlag("auto");
16651676
if (IsGen)
16661677
PerDeviceArgs.push_back(

clang/test/Driver/sycl-device-lib-amdgcn.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
// RUN: -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx906 %s 2>&1 \
1111
// RUN: | FileCheck -check-prefix=CHK-NO-DEVLIB %s
1212

13-
// CHK-NO-DEVLIB-NOT: {{[0-9]+}}: input, "{{.*}}devicelib--amd.bc", ir, (device-sycl, gfx906)
13+
// CHK-NO-DEVLIB-NOT: {{[0-9]+}}: input, "{{.*}}devicelib-amdgcn-amd-amdhsa.bc", ir, (device-sycl, gfx906)
1414
// CHK-NO-DEVLIB: [[LIB1:[0-9]+]]: input, "{{.*}}libsycl-itt-user-wrappers.bc", ir, (device-sycl, gfx906)
15-
// CHK-NO-DEVLIB-NOT: {{[0-9]+}}: input, "{{.*}}devicelib--amd.bc", ir, (device-sycl, gfx906)
15+
// CHK-NO-DEVLIB-NOT: {{[0-9]+}}: input, "{{.*}}devicelib-amdgcn-amd-amdhsa.bc", ir, (device-sycl, gfx906)
1616
// CHK-NO-DEVLIB: [[LIB2:[0-9]+]]: input, "{{.*}}libsycl-itt-compiler-wrappers.bc", ir, (device-sycl, gfx906)
17-
// CHK-NO-DEVLIB-NOT: {{[0-9]+}}: input, "{{.*}}devicelib--amd.bc", ir, (device-sycl, gfx906)
17+
// CHK-NO-DEVLIB-NOT: {{[0-9]+}}: input, "{{.*}}devicelib-amdgcn-amd-amdhsa.bc", ir, (device-sycl, gfx906)
1818
// CHK-NO-DEVLIB: [[LIB3:[0-9]+]]: input, "{{.*}}libsycl-itt-stubs.bc", ir, (device-sycl, gfx906)
19-
// CHK-NO-DEVLIB-NOT: {{[0-9]+}}: input, "{{.*}}devicelib--amd.bc", ir, (device-sycl, gfx906)
19+
// CHK-NO-DEVLIB-NOT: {{[0-9]+}}: input, "{{.*}}devicelib-amdgcn-amd-amdhsa.bc", ir, (device-sycl, gfx906)
2020
// CHK-NO-DEVLIB: {{[0-9]+}}: linker, {{{.*}}[[LIB1]], [[LIB2]], [[LIB3]]{{.*}}}, ir, (device-sycl, gfx906)
2121

2222
// Check that the -fsycl-device-lib flag has no effect when "all" is specified.
@@ -39,7 +39,7 @@
3939
// RUN: | FileCheck -check-prefixes=CHK-UNUSED-WARN,CHK-ALL %s
4040

4141
// CHK-UNUSED-WARN: warning: argument unused during compilation: '-fno-sycl-device-lib='
42-
// CHK-ALL: [[DEVLIB:[0-9]+]]: input, "{{.*}}devicelib--amd.bc", ir, (device-sycl, gfx906)
42+
// CHK-ALL: [[DEVLIB:[0-9]+]]: input, "{{.*}}devicelib-amdgcn-amd-amdhsa.bc", ir, (device-sycl, gfx906)
4343
// CHK-ALL: {{[0-9]+}}: linker, {{{.*}}[[DEVLIB]]{{.*}}}, ir, (device-sycl, gfx906)
4444

4545
// Check that llvm-link uses the "-only-needed" flag.
@@ -48,4 +48,4 @@
4848
// RUN: -fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx906 %s 2>&1 \
4949
// RUN: | FileCheck -check-prefix=CHK-ONLY-NEEDED %s
5050

51-
// CHK-ONLY-NEEDED: llvm-link"{{.*}}"-only-needed"{{.*}}"{{.*}}devicelib--amd.bc"{{.*}}
51+
// CHK-ONLY-NEEDED: llvm-link"{{.*}}"-only-needed"{{.*}}"{{.*}}devicelib-amdgcn-amd-amdhsa.bc"{{.*}}

0 commit comments

Comments
 (0)