Skip to content

Commit 3bd6b44

Browse files
[SYCL] Refactor check_device_code/vector LIT tests (#17153)
This PR split `check_device_code/vector` LIT tests into two: one without preview-breaking-flag and one with the flag. This would increase test coverage and also make it easier for us to switch tests during ABI-breaking window.
1 parent 646a508 commit 3bd6b44

8 files changed

+915
-13
lines changed

sycl/test/check_device_code/vector/vector_as.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// NOTE: removed/disabled to re-generate the checks.
44

55
// RUN: %clangxx -O3 -fsycl -fsycl-device-only -fno-discard-value-names -S -emit-llvm -fno-sycl-instrument-device-code -o - %s | FileCheck %s
6-
// RUN: %if preview-breaking-changes-supported %{ \
7-
// RUN: %clangxx -O3 -fsycl -fsycl-device-only -fno-discard-value-names -S -emit-llvm -fno-sycl-instrument-device-code -o - %s -fpreview-breaking-changes | FileCheck %s --check-prefix=CHECK-PREVIEW \
8-
// RUN: %}
96

107
// Windows/linux have some slight differences in IR generation (function
118
// arguments passing and long/long long differences/mangling) that could
@@ -21,10 +18,3 @@ template SYCL_EXTERNAL sycl::vec<int, 4> sycl::vec<float, 4>::as<sycl::vec<int,
2118
// CHECK-NEXT: entry:
2219
// CHECK-NEXT: tail call void @llvm.memcpy.p4.p4.i64(ptr addrspace(4) noundef align 16 dereferenceable(16) [[AGG_RESULT]], ptr addrspace(4) noundef align 16 dereferenceable(16) [[THIS]], i64 16, i1 false)
2320
// CHECK-NEXT: ret void
24-
//
25-
//
26-
// CHECK-PREVIEW-LABEL: define weak_odr dso_local spir_func void @_ZNK4sycl3_V13vecIfLi4EE2asINS1_IiLi4EEEEET_v(
27-
// CHECK-PREVIEW-SAME: ptr addrspace(4) dead_on_unwind noalias writable sret(%"class.sycl::_V1::vec") align 16 [[AGG_RESULT:%.*]], ptr addrspace(4) noundef align 16 dereferenceable_or_null(16) [[THIS:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] comdat align 2 !srcloc [[META5:![0-9]+]] !sycl_fixed_targets [[META6:![0-9]+]] {
28-
// CHECK-PREVIEW-NEXT: entry:
29-
// CHECK-PREVIEW-NEXT: tail call void @llvm.memcpy.p4.p4.i64(ptr addrspace(4) noundef align 16 dereferenceable(16) [[AGG_RESULT]], ptr addrspace(4) noundef align 16 dereferenceable(16) [[THIS]], i64 16, i1 false)
30-
// CHECK-PREVIEW-NEXT: ret void
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --functions "as" --include-generated-funcs --version 4
2+
3+
// RUN: %clangxx -O3 -fsycl -fsycl-device-only -fno-discard-value-names -S -emit-llvm -fno-sycl-instrument-device-code -o - %s -fpreview-breaking-changes
4+
5+
// Windows/linux have some slight differences in IR generation (function
6+
// arguments passing and long/long long differences/mangling) that could
7+
// complicate test updates while not improving test coverage. Limiting to linux
8+
// should be fine.
9+
// REQUIRES: linux && preview-breaking-changes-supported
10+
11+
#include <sycl/sycl.hpp>
12+
13+
template SYCL_EXTERNAL sycl::vec<int, 4>
14+
sycl::vec<float, 4>::as<sycl::vec<int, 4>>() const;
15+
// CHECK-LABEL: define weak_odr dso_local spir_func void @_ZNK4sycl3_V13vecIfLi4EE2asINS1_IiLi4EEEEET_v(
16+
// CHECK-SAME: ptr addrspace(4) dead_on_unwind noalias writable sret(%"class.sycl::_V1::vec") align 16 [[AGG_RESULT:%.*]], ptr addrspace(4) noundef align 16 dereferenceable_or_null(16) [[THIS:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] comdat align 2 !srcloc [[META5:![0-9]+]] !sycl_fixed_targets [[META6:![0-9]+]] {
17+
// CHECK-NEXT: entry:
18+
// CHECK-NEXT: tail call void @llvm.memcpy.p4.p4.i64(ptr addrspace(4) noundef align 16 dereferenceable(16) [[AGG_RESULT]], ptr addrspace(4) noundef align 16 dereferenceable(16) [[THIS]], i64 16, i1 false)
19+
// CHECK-NEXT: ret void

sycl/test/check_device_code/vector/vector_bf16_builtins.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
// Had to increase inline threashold for this test to force inline of the vec<>
55
// math builtins.
6-
// RUN: %clangxx -I %sycl_include -fpreview-breaking-changes -mllvm -inline-threshold=400 -fno-discard-value-names -S -emit-llvm -fno-sycl-instrument-device-code -Xclang -disable-lifetime-markers -O3 -fsycl-device-only %s -o - | FileCheck %s
6+
// RUN: %clangxx -I %sycl_include -mllvm -inline-threshold=400 -fno-discard-value-names -S -emit-llvm -fno-sycl-instrument-device-code -Xclang -disable-lifetime-markers -O3 -fsycl-device-only %s -o - | FileCheck %s
77

88
// Windows/linux have some slight differences in IR generation (function
99
// arguments passing and long/long long differences/mangling) that could

sycl/test/check_device_code/vector/vector_bf16_builtins_preview.cpp

Lines changed: 282 additions & 0 deletions
Large diffs are not rendered by default.

sycl/test/check_device_code/vector/vector_convert_bfloat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --check-globals none --version 4
22
// NOTE: ..., followed by some manual cleanup.
33

4-
// RUN: %clangxx -I %sycl_include -fpreview-breaking-changes -fno-discard-value-names -S -emit-llvm -fno-sycl-instrument-device-code -Xclang -disable-lifetime-markers %s -fsycl-device-only -o - | FileCheck %s
4+
// RUN: %clangxx -I %sycl_include -fno-discard-value-names -S -emit-llvm -fno-sycl-instrument-device-code -Xclang -disable-lifetime-markers %s -fsycl-device-only -o - | FileCheck %s
55
// REQUIRES: linux
66

77
#include <sycl/detail/core.hpp>

0 commit comments

Comments
 (0)