Skip to content

Commit 7805227

Browse files
committed
Merge remote-tracking branch 'origin/sycl' into abi/get_backend_info
2 parents 59c9867 + 7e6e803 commit 7805227

File tree

186 files changed

+559
-45678
lines changed

Some content is hidden

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

186 files changed

+559
-45678
lines changed

.github/workflows/sycl-linux-build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ jobs:
204204
--ci-defaults --use-zstd ${{ inputs.build_configure_extra_args }} \
205205
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
206206
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
207-
-DLLVM_INSTALL_UTILS=ON
207+
-DLLVM_INSTALL_UTILS=ON \
208+
-DSYCL_UR_FORCE_FETCH_LEVEL_ZERO=ON
208209
- name: Compile
209210
id: build
210211
# Emulate default value for manual dispatch as we've run out of available arguments.

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13425,8 +13425,9 @@ def err_sycl_add_ir_attribute_invalid_filter : Error<
1342513425
"initializer list in the first argument of %0 must contain only string "
1342613426
"literals">;
1342713427
def warn_sycl_old_and_new_kernel_attributes : Warning<
13428-
"kernel has both attribute %0 and kernel properties; conflicting properties "
13429-
"are ignored">, InGroup<IgnoredAttributes>;
13428+
"kernel has both attribute %0 and kernel properties; if the kernel "
13429+
"properties contains the property \"%1\" it will be ignored">,
13430+
InGroup<IgnoredAttributes>;
1343013431
def err_attribute_argument_is_not_valid : Error<
1343113432
"%0 attribute requires integer constant value 0 or 1">;
1343213433

clang/lib/Sema/SemaSYCLDeclAttr.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3256,14 +3256,19 @@ void SemaSYCL::checkSYCLAddIRAttributesFunctionAttrConflicts(Decl *D) {
32563256
}
32573257

32583258
// If there are potentially conflicting attributes, we issue a warning.
3259-
for (const auto *Attr : std::vector<AttributeCommonInfo *>{
3260-
D->getAttr<SYCLReqdWorkGroupSizeAttr>(),
3261-
D->getAttr<IntelReqdSubGroupSizeAttr>(),
3262-
D->getAttr<SYCLWorkGroupSizeHintAttr>(),
3263-
D->getAttr<SYCLDeviceHasAttr>()})
3259+
for (const auto [Attr, PotentialConflictProp] :
3260+
std::vector<std::pair<AttributeCommonInfo *, StringRef>>{
3261+
{D->getAttr<SYCLReqdWorkGroupSizeAttr>(),
3262+
"sycl::ext::oneapi::experimental::work_group_size"},
3263+
{D->getAttr<IntelReqdSubGroupSizeAttr>(),
3264+
"sycl::ext::oneapi::experimental::sub_group_size"},
3265+
{D->getAttr<SYCLWorkGroupSizeHintAttr>(),
3266+
"sycl::ext::oneapi::experimental::work_group_size_hint"},
3267+
{D->getAttr<SYCLDeviceHasAttr>(),
3268+
"sycl::ext::oneapi::experimental::device_has"}})
32643269
if (Attr)
32653270
Diag(Attr->getLoc(), diag::warn_sycl_old_and_new_kernel_attributes)
3266-
<< Attr;
3271+
<< Attr << PotentialConflictProp;
32673272
}
32683273

32693274
void SemaSYCL::handleSYCLRegisteredKernels(Decl *D, const ParsedAttr &A) {

clang/test/Driver/clang-linker-wrapper.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,20 @@
6363
// CHK-CMDS-AOT-GEN: spirv-to-ir-wrapper{{.*}} -o [[FIRSTLLVMLINKIN:.*]].bc --llvm-spirv-opts --spirv-preserve-auxdata --spirv-target-env=SPV-IR --spirv-builtin-format=global
6464
// CHK-CMDS-AOT-GEN-NEXT: llvm-link{{.*}} --suppress-warnings [[FIRSTLLVMLINKIN]].bc -o [[FIRSTLLVMLINKOUT:.*]].bc
6565
// CHK-CMDS-AOT-GEN-NEXT: llvm-link{{.*}} -only-needed --suppress-warnings [[FIRSTLLVMLINKOUT]].bc {{.*}}.bc -o [[SECONDLLVMLINKOUT:.*]].bc
66-
// CHK-CMDS-AOT-GEN-NEXT: sycl-post-link{{.*}} SYCL_POST_LINK_OPTIONS -o [[SYCLPOSTLINKOUT:.*]].table [[SECONDLLVMLINKOUT]].bc
66+
// Check that target specified by -fsycl-targets is passed to sycl-post-link for filtering.
67+
// CHK-CMDS-AOT-GEN-NEXT: sycl-post-link{{.*}} SYCL_POST_LINK_OPTIONS -o intel_gpu_pvc,[[SYCLPOSTLINKOUT:.*]].table [[SECONDLLVMLINKOUT]].bc
6768
// CHK-CMDS-AOT-GEN-NEXT: llvm-spirv{{.*}} LLVM_SPIRV_OPTIONS -o {{.*}}
6869
// CHK-CMDS-AOT-GEN-NEXT: ocloc{{.*}} -output_no_suffix -spirv_input -device pvc{{.*}} -output {{.*}} -file {{.*}}
6970
// CHK-CMDS-AOT-GEN-NEXT: offload-wrapper: output: [[WRAPPEROUT:.*]].bc, input: {{.*}}, compile-opts: , link-opts:
7071
// CHK-CMDS-AOT-GEN-NEXT: clang{{.*}} -c -o [[LLCOUT:.*]].o [[WRAPPEROUT]].bc
7172
// CHK-CMDS-AOT-GEN-NEXT: "{{.*}}/ld" -- HOST_LINKER_FLAGS -dynamic-linker HOST_DYN_LIB -o a.out [[LLCOUT]].o HOST_LIB_PATH HOST_STAT_LIB {{.*}}.o
7273

74+
// Check that when --gpu-tool-arg is specified in clang-linker-wrapper
75+
// (happen when AOT device is specified via -Xsycl-target-backend '-device pvc' in clang),
76+
// the target is not passed to sycl-post-link for filtering.
77+
// RUN: clang-linker-wrapper -sycl-embed-ir -sycl-device-libraries=%t1.devicelib.o -sycl-post-link-options="SYCL_POST_LINK_OPTIONS" -llvm-spirv-options="LLVM_SPIRV_OPTIONS" "--host-triple=x86_64-unknown-linux-gnu" "--gpu-tool-arg=-device pvc" "--linker-path=/usr/bin/ld" "--" HOST_LINKER_FLAGS "-dynamic-linker" HOST_DYN_LIB "-o" "a.out" HOST_LIB_PATH HOST_STAT_LIB %t1.o --dry-run 2>&1 | FileCheck -check-prefix=CHK-NO-CMDS-AOT-GEN %s
78+
// CHK-NO-CMDS-AOT-GEN-NOT: sycl-post-link{{.*}} -o intel_gpu_pv,{{.*}}
79+
7380
/// Check for list of commands for standalone clang-linker-wrapper run for sycl (AOT for Intel CPU)
7481
// -------
7582
// Generate .o file as linker wrapper input.

0 commit comments

Comments
 (0)