Skip to content

[DO NOT MERGE] CI Testing #2419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 21 commits into from
Closed

[DO NOT MERGE] CI Testing #2419

wants to merge 21 commits into from

Conversation

jtmott-intel
Copy link
Contributor

No description provided.

premanandrao and others added 19 commits April 23, 2020 12:23
…names

When std::nullptr_t is used as a kernel type, the generated
integration header uses 'nullptr_t'.  This causes lookup
errors.  Use 'std::nullptr_t' instead.

std::max_align_t is defined (in one implementation) as a typedef
of an anonymous struct.  This causes errors when attempting to
forward declare the type in the integration header.  Diagnose
such cases earlier.

Signed-off-by: Premanand M Rao <[email protected]>
# Conflicts:
#	clang/include/clang/Basic/DiagnosticSemaKinds.td
# Conflicts:
#	sycl/test/sub_group/reduce.cpp
#	sycl/test/sub_group/scan.cpp
# Conflicts:
#	sycl/test/reduction/reduction_ctor.cpp
#	sycl/test/reduction/reduction_nd_s1_rw.cpp
#	sycl/test/reduction/reduction_transparent.cpp
# Conflicts:
#	sycl/test/sub_group/generic-shuffle.cpp
# Conflicts:
#	sycl/test/sub_group/generic-shuffle.cpp
#	sycl/test/sub_group/reduce.hpp
#	sycl/test/sub_group/scan.hpp
# Conflicts:
#	clang/test/SemaSYCL/unnamed-kernel.cpp
#	sycl/test/group-algorithm/exclusive_scan.cpp
#	sycl/test/group-algorithm/inclusive_scan.cpp
#	sycl/test/group-algorithm/reduce.cpp
#	sycl/test/reduction/reduction_ctor.cpp
#	sycl/test/reduction/reduction_nd_conditional.cpp
#	sycl/test/reduction/reduction_nd_ext_type.hpp
#	sycl/test/reduction/reduction_nd_s0_dw.cpp
#	sycl/test/reduction/reduction_nd_s0_rw.cpp
#	sycl/test/reduction/reduction_nd_s1_dw.cpp
#	sycl/test/reduction/reduction_nd_s1_rw.cpp
#	sycl/test/reduction/reduction_placeholder.cpp
#	sycl/test/reduction/reduction_transparent.cpp
#	sycl/test/reduction/reduction_usm.cpp
#	sycl/test/sub_group/generic-shuffle.cpp
#	sycl/test/sub_group/reduce.hpp
#	sycl/test/sub_group/scan.hpp
@jtmott-intel jtmott-intel requested review from s-kanaev and removed request for s-kanaev September 3, 2020 15:05
@jtmott-intel jtmott-intel deleted the remote_fwd_decl_namespace_x branch September 14, 2020 14:50
jsji pushed a commit that referenced this pull request Mar 26, 2024
The translation of uadd/usub with overflow were problematic.
The returning type of these IR intrinsics are tuples
with a second i1 type. These intrinsics were translated
to OpIAddCarry and OpISubBorrow which, according to standard,
should also return a two element tuple but in that case
both types should be the same. IR i1 type is translated by
default to BoolType which doesn't have the same properties
as i1. There isn't also a possibility to exceptionally override the
default behavior in current architecture.
Finally the translation was implemented but without compliance
with SPIR-V spec - the resulting type of two ops contained
BoolType as second element.
This commit fixes non compliant translation. Instrinsics
uadd/usub_with_overflow are now translated to sequence of
operations which repacks compliant return type into expected
IR type with second element as BoolType.
E.g for i32 uadd_with_overflow:

%0 = alloca {i32, i32}, align 8
call spir_func void @_Z17__spirv_IAddCarryii(ptr sret({i32, i32}) %0, i32 %a, i32 %b)
%1 = load {i32, i32}, ptr %0, align 4
%2 = extractvalue {i32, i32} %1, 0
%3 = extractvalue {i32, i32} %1, 1
%4 = icmp ne i32 %3, 0
%5 = insertvalue {i32, i1} undef, i32 %2, 0
%6 = insertvalue {i32, i1} %5, i1 %4, 1

All uses of original intrinsic value are replaced with the
repacked result (%6 above) which fixes type mismatch.

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@98729ef13ca970b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants