Skip to content

Conversation

@arnamoy10
Copy link
Contributor

During lowering of atomic and multi-ptr, constructors with pointer type arguments are being called. Here is an example call generated by clang:

call spir_func void @_ZN4sycl3_V19multi_ptrIjLNS0_6access13address_spaceE1ELNS2_9decoratedE1EEC2EPU3AS1j(%"class.sycl::_V1::multi_ptr" addrspace(4)* noundef align 8 dereferenceable_or_null(8) %agg.tmp2.ascast, i32 addrspace(1)* noundef %add.ptr) #8

As can be seen, the second argument is a i32 pointer. Currently our sycl.constructor op (that will be replaced during lowering to this function call) will not allow pointers to be arguments. This PR removes that restriction.

@arnamoy10 arnamoy10 added the sycl-mlir Pull requests or issues for sycl-mlir branch label Nov 18, 2022
@arnamoy10 arnamoy10 requested a review from victor-eds November 18, 2022 20:27
@arnamoy10 arnamoy10 self-assigned this Nov 18, 2022
@arnamoy10 arnamoy10 merged commit 16d5469 into sycl-mlir Nov 21, 2022
@arnamoy10 arnamoy10 deleted the constructor_i32ptr branch November 22, 2022 11:56
etiotto pushed a commit to etiotto/intel-llvm that referenced this pull request Nov 22, 2022
…intel#7455)

During lowering of `atomic` and `multi-ptr`, constructors with pointer
type arguments are being called. Here is an example call generated by
clang:

` call spir_func void
@_ZN4sycl3_V19multi_ptrIjLNS0_6access13address_spaceE1ELNS2_9decoratedE1EEC2EPU3AS1j(%"class.sycl::_V1::multi_ptr"
addrspace(4)* noundef align 8 dereferenceable_or_null(8)
%agg.tmp2.ascast, i32 addrspace(1)* noundef %add.ptr) intel#8`

As can be seen, the second argument is a `i32` pointer. Currently our
`sycl.constructor` op (that will be replaced during lowering to this
function call) will not allow pointers to be arguments. This PR removes
that restriction.

Co-authored-by: arnamoy.bhattacharyya <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sycl-mlir Pull requests or issues for sycl-mlir branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants