Commit 24937ea
authored
[SYCL] Allow buitin_assume_aligned to be called from device code. (#6705)
Prior to this PR, if there is a direct call to __builtin_assume_aligned
from within the device code, we would get the following error:
`error: SYCL kernel cannot call a variadic function`
This PR allows `__builtin_assume_aligned` to be invoked from within
device code.
The reason for doing so is, for example, if we load a float* pointer
from a data structure, the compiler has no way of knowing the underlying
alignment of the data the pointer points to, and therefore it cannot
combine the load/stores and one ends up with many unnecessary load/store
instructions plus lots of unnecessary pointer arithmetic plus increased
register pressure. We see this all over the place in our kernels. With
`__builtin_assume_aligned` we can tell the compiler to safely assume a
certain alignment, therefore implicitly forcing coalescing.1 parent 2086035 commit 24937ea
File tree
4 files changed
+31
-4
lines changed- clang
- include/clang/Sema
- lib/Sema
- test/SemaSYCL
4 files changed
+31
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13982 | 13982 | | |
13983 | 13983 | | |
13984 | 13984 | | |
13985 | | - | |
| 13985 | + | |
13986 | 13986 | | |
13987 | 13987 | | |
13988 | 13988 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5967 | 5967 | | |
5968 | 5968 | | |
5969 | 5969 | | |
5970 | | - | |
5971 | | - | |
| 5970 | + | |
| 5971 | + | |
5972 | 5972 | | |
5973 | 5973 | | |
5974 | 5974 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
367 | | - | |
| 367 | + | |
368 | 368 | | |
369 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
370 | 376 | | |
371 | 377 | | |
372 | 378 | | |
| |||
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
0 commit comments