-
Notifications
You must be signed in to change notification settings - Fork 738
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL][SCLA] Add CodeGen capabilities for `sycl_ext_oneapi_private_al…
…loca` (#12894) The [`sycl_ext_oneapi_private_alloca`](https://github.com/intel/llvm/blob/56e9067ba69809fb6ea1fd4328456ca3a009f984/sycl/doc/extensions/experimental/sycl_ext_oneapi_private_alloca.asciidoc) adds new functions returning a pointer to a specialization constant length SYCL private memory allocation. This commit adds codegen support for these functions. The `sycl::private_alloca` function is implemented as an alias to a new `__builtin_intel_sycl_alloca` builtin. This is needed to guarantee the call will lower to just an `alloca` instruction defining the private memory allocation. This builtin lowers to a SYCL builtin call to `__builtin_sycl_unique_stable_id` and a call to a new `llvm.sycl.alloca` intrinsic. This intrinsic receives three arguments encoding the specialization constant used as array length, a type hint argument encoding the allocation element type and the required alignment. Note the `sycl_ext_oneapi_private_alloca` extension defines two functions: `private_alloca` and `aligned_private_alloca`. This commit adds codegen support only for the first signature, but already prepares support for the aligned flavor by adding an argument encoding the memory allocation alignment to the `llvm.sycl.alloca` intrinsic. The intrinsic is needed as generating an `alloca` instruction right away would lead to optimization passes converting the size argument, which can be of any integral type, and thus difficulting lowering to a single SPIR-V `OpVariable` later in the pipeline. --------- Signed-off-by: Victor Perez <victor.perez@codeplay.com>
- Loading branch information
1 parent
03f61fc
commit a105055
Showing
20 changed files
with
737 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.