Skip to content

Commit eb9cb9e

Browse files
authored
[SYCL] Relax checks in host_acc_opt LIT test (#7027)
It turns out to be non-robust to expect compiler to vectorize the code. The code can be optmized in different ways. So relax the checks to verify that there are no calls to accessor helper methods (getOffset and getMemoryRange) in the loop. Absence of these calls should be enough to optimize the code.
1 parent 116db44 commit eb9cb9e

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
1-
// RUN: %clangxx -O2 -std=c++17 -I %sycl_include/sycl -I %sycl_include -S -emit-llvm %s -o - | FileCheck %s
1+
// RUN: %clangxx -O2 -isystem %sycl_include/sycl -isystem %sycl_include -S -emit-llvm %s -o - | FileCheck %s
22

33
// The test verifies that the accessor::operator[] implementation is
44
// good enough for compiler to optimize away calls to getOffset and
5-
// getMemoryRange and vectorize the loop.
5+
// getMemoryRange.
66

77
#include <sycl/sycl.hpp>
88

99
// CHECK: define {{.*}}foo{{.*}} {
1010
// CHECK-NOT: call
1111
// CHECK-NOT: invoke
12-
// CHECK: load <4 x i32>
13-
// CHECK-NOT: call
14-
// CHECK-NOT: invoke
15-
// CHECK: store <4 x i32>
16-
// CHECK-NOT: call
17-
// CHECK-NOT: invoke
1812
// CHECK: }
1913
void foo(sycl::accessor<int, 1, sycl::access::mode::read_write,
2014
sycl::target::host_buffer> &Acc,
2115
int *Src) {
2216
for (size_t I = 0; I < 64; ++I)
23-
Acc[I] = Src[I];
17+
Acc[I] += Src[I];
2418
}

0 commit comments

Comments
 (0)