Skip to content

Commit

Permalink
Merge pull request #197 from frasercrmck/spirv-ll-fix-signedness-tests
Browse files Browse the repository at this point in the history
[spirv-ll] Fix signed ints and duplicate types in 'Kernel' tests
  • Loading branch information
frasercrmck authored Nov 9, 2023
2 parents efb96c3 + 146f357 commit afcf992
Show file tree
Hide file tree
Showing 633 changed files with 526 additions and 10,869 deletions.
1 change: 1 addition & 0 deletions modules/compiler/spirv-ll/source/builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,7 @@ llvm::Value *spirv_ll::Builder::createOCLBuiltinCall(
case OpenCLLIB::SMul_hi:
case OpenCLLIB::SSub_sat:
case OpenCLLIB::SMul24:
case OpenCLLIB::SMad24:
resMangleInfo = MangleInfo::getSigned(resTyId);
for (auto &arg : argInfo) {
arg.forceSign = MangleInfo::ForceSignInfo::ForceSigned;
Expand Down
212 changes: 0 additions & 212 deletions modules/compiler/spirv-ll/test/spvasm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1086,30 +1086,6 @@ set(SPVASM_FILES
op_opencl_s_add_sat_v8i32.spvasm
op_opencl_s_add_sat_v8i64.spvasm
op_opencl_s_add_sat_v8i8.spvasm
op_opencl_s_bitselect_i16.spvasm
op_opencl_s_bitselect_i32.spvasm
op_opencl_s_bitselect_i64.spvasm
op_opencl_s_bitselect_i8.spvasm
op_opencl_s_bitselect_v16i16.spvasm
op_opencl_s_bitselect_v16i32.spvasm
op_opencl_s_bitselect_v16i64.spvasm
op_opencl_s_bitselect_v16i8.spvasm
op_opencl_s_bitselect_v2i16.spvasm
op_opencl_s_bitselect_v2i32.spvasm
op_opencl_s_bitselect_v2i64.spvasm
op_opencl_s_bitselect_v2i8.spvasm
op_opencl_s_bitselect_v3i16.spvasm
op_opencl_s_bitselect_v3i32.spvasm
op_opencl_s_bitselect_v3i64.spvasm
op_opencl_s_bitselect_v3i8.spvasm
op_opencl_s_bitselect_v4i16.spvasm
op_opencl_s_bitselect_v4i32.spvasm
op_opencl_s_bitselect_v4i64.spvasm
op_opencl_s_bitselect_v4i8.spvasm
op_opencl_s_bitselect_v8i16.spvasm
op_opencl_s_bitselect_v8i32.spvasm
op_opencl_s_bitselect_v8i64.spvasm
op_opencl_s_bitselect_v8i8.spvasm
op_opencl_s_clamp_i16.spvasm
op_opencl_s_clamp_i32.spvasm
op_opencl_s_clamp_i64.spvasm
Expand All @@ -1134,30 +1110,6 @@ set(SPVASM_FILES
op_opencl_s_clamp_v8i32.spvasm
op_opencl_s_clamp_v8i64.spvasm
op_opencl_s_clamp_v8i8.spvasm
op_opencl_s_clz_i16.spvasm
op_opencl_s_clz_i32.spvasm
op_opencl_s_clz_i64.spvasm
op_opencl_s_clz_i8.spvasm
op_opencl_s_clz_v16i16.spvasm
op_opencl_s_clz_v16i32.spvasm
op_opencl_s_clz_v16i64.spvasm
op_opencl_s_clz_v16i8.spvasm
op_opencl_s_clz_v2i16.spvasm
op_opencl_s_clz_v2i32.spvasm
op_opencl_s_clz_v2i64.spvasm
op_opencl_s_clz_v2i8.spvasm
op_opencl_s_clz_v3i16.spvasm
op_opencl_s_clz_v3i32.spvasm
op_opencl_s_clz_v3i64.spvasm
op_opencl_s_clz_v3i8.spvasm
op_opencl_s_clz_v4i16.spvasm
op_opencl_s_clz_v4i32.spvasm
op_opencl_s_clz_v4i64.spvasm
op_opencl_s_clz_v4i8.spvasm
op_opencl_s_clz_v8i16.spvasm
op_opencl_s_clz_v8i32.spvasm
op_opencl_s_clz_v8i64.spvasm
op_opencl_s_clz_v8i8.spvasm
op_opencl_s_hadd_i16.spvasm
op_opencl_s_hadd_i32.spvasm
op_opencl_s_hadd_i64.spvasm
Expand Down Expand Up @@ -1314,78 +1266,6 @@ set(SPVASM_FILES
op_opencl_s_mul_hi_v8i32.spvasm
op_opencl_s_mul_hi_v8i64.spvasm
op_opencl_s_mul_hi_v8i8.spvasm
op_opencl_s_popcount_i16.spvasm
op_opencl_s_popcount_i32.spvasm
op_opencl_s_popcount_i64.spvasm
op_opencl_s_popcount_i8.spvasm
op_opencl_s_popcount_v16i16.spvasm
op_opencl_s_popcount_v16i32.spvasm
op_opencl_s_popcount_v16i64.spvasm
op_opencl_s_popcount_v16i8.spvasm
op_opencl_s_popcount_v2i16.spvasm
op_opencl_s_popcount_v2i32.spvasm
op_opencl_s_popcount_v2i64.spvasm
op_opencl_s_popcount_v2i8.spvasm
op_opencl_s_popcount_v3i16.spvasm
op_opencl_s_popcount_v3i32.spvasm
op_opencl_s_popcount_v3i64.spvasm
op_opencl_s_popcount_v3i8.spvasm
op_opencl_s_popcount_v4i16.spvasm
op_opencl_s_popcount_v4i32.spvasm
op_opencl_s_popcount_v4i64.spvasm
op_opencl_s_popcount_v4i8.spvasm
op_opencl_s_popcount_v8i16.spvasm
op_opencl_s_popcount_v8i32.spvasm
op_opencl_s_popcount_v8i64.spvasm
op_opencl_s_popcount_v8i8.spvasm
op_opencl_s_prefetch_i16_32bit.spvasm
op_opencl_s_prefetch_i16_64bit.spvasm
op_opencl_s_prefetch_i32_32bit.spvasm
op_opencl_s_prefetch_i32_64bit.spvasm
op_opencl_s_prefetch_i64_32bit.spvasm
op_opencl_s_prefetch_i64_64bit.spvasm
op_opencl_s_prefetch_i8_32bit.spvasm
op_opencl_s_prefetch_i8_64bit.spvasm
op_opencl_s_prefetch_v16i16_32bit.spvasm
op_opencl_s_prefetch_v16i16_64bit.spvasm
op_opencl_s_prefetch_v16i32_32bit.spvasm
op_opencl_s_prefetch_v16i32_64bit.spvasm
op_opencl_s_prefetch_v16i64_32bit.spvasm
op_opencl_s_prefetch_v16i64_64bit.spvasm
op_opencl_s_prefetch_v16i8_32bit.spvasm
op_opencl_s_prefetch_v16i8_64bit.spvasm
op_opencl_s_prefetch_v2i16_32bit.spvasm
op_opencl_s_prefetch_v2i16_64bit.spvasm
op_opencl_s_prefetch_v2i32_32bit.spvasm
op_opencl_s_prefetch_v2i32_64bit.spvasm
op_opencl_s_prefetch_v2i64_32bit.spvasm
op_opencl_s_prefetch_v2i64_64bit.spvasm
op_opencl_s_prefetch_v2i8_32bit.spvasm
op_opencl_s_prefetch_v2i8_64bit.spvasm
op_opencl_s_prefetch_v3i16_32bit.spvasm
op_opencl_s_prefetch_v3i16_64bit.spvasm
op_opencl_s_prefetch_v3i32_32bit.spvasm
op_opencl_s_prefetch_v3i32_64bit.spvasm
op_opencl_s_prefetch_v3i64_32bit.spvasm
op_opencl_s_prefetch_v3i64_64bit.spvasm
op_opencl_s_prefetch_v3i8_32bit.spvasm
op_opencl_s_prefetch_v3i8_64bit.spvasm
op_opencl_s_prefetch_v4i16_32bit.spvasm
op_opencl_s_prefetch_v4i16_64bit.spvasm
op_opencl_s_prefetch_v4i32_32bit.spvasm
op_opencl_s_prefetch_v4i32_64bit.spvasm
op_opencl_s_prefetch_v4i64_32bit.spvasm
op_opencl_s_prefetch_v4i64_64bit.spvasm
op_opencl_s_prefetch_v4i8_32bit.spvasm
op_opencl_s_prefetch_v4i8_64bit.spvasm
op_opencl_s_prefetch_v8i16_32bit.spvasm
op_opencl_s_prefetch_v8i16_64bit.spvasm
op_opencl_s_prefetch_v8i32_32bit.spvasm
op_opencl_s_prefetch_v8i32_64bit.spvasm
op_opencl_s_prefetch_v8i64_32bit.spvasm
op_opencl_s_prefetch_v8i64_64bit.spvasm
op_opencl_s_prefetch_v8i8_32bit.spvasm
op_opencl_s_prefetch_v8i8_64bit.spvasm
op_opencl_s_rhadd_i16.spvasm
op_opencl_s_rhadd_i32.spvasm
op_opencl_s_rhadd_i64.spvasm
Expand All @@ -1410,98 +1290,6 @@ set(SPVASM_FILES
op_opencl_s_rhadd_v8i32.spvasm
op_opencl_s_rhadd_v8i64.spvasm
op_opencl_s_rhadd_v8i8.spvasm
op_opencl_s_rotate_i16.spvasm
op_opencl_s_rotate_i32.spvasm
op_opencl_s_rotate_i64.spvasm
op_opencl_s_rotate_i8.spvasm
op_opencl_s_rotate_v16i16.spvasm
op_opencl_s_rotate_v16i32.spvasm
op_opencl_s_rotate_v16i64.spvasm
op_opencl_s_rotate_v16i8.spvasm
op_opencl_s_rotate_v2i16.spvasm
op_opencl_s_rotate_v2i32.spvasm
op_opencl_s_rotate_v2i64.spvasm
op_opencl_s_rotate_v2i8.spvasm
op_opencl_s_rotate_v3i16.spvasm
op_opencl_s_rotate_v3i32.spvasm
op_opencl_s_rotate_v3i64.spvasm
op_opencl_s_rotate_v3i8.spvasm
op_opencl_s_rotate_v4i16.spvasm
op_opencl_s_rotate_v4i32.spvasm
op_opencl_s_rotate_v4i64.spvasm
op_opencl_s_rotate_v4i8.spvasm
op_opencl_s_rotate_v8i16.spvasm
op_opencl_s_rotate_v8i32.spvasm
op_opencl_s_rotate_v8i64.spvasm
op_opencl_s_rotate_v8i8.spvasm
op_opencl_s_select_double.spvasm
op_opencl_s_select_float.spvasm
op_opencl_s_select_i16.spvasm
op_opencl_s_select_i32.spvasm
op_opencl_s_select_i64.spvasm
op_opencl_s_select_i8.spvasm
op_opencl_s_select_v16double.spvasm
op_opencl_s_select_v16float.spvasm
op_opencl_s_select_v16i16.spvasm
op_opencl_s_select_v16i32.spvasm
op_opencl_s_select_v16i64.spvasm
op_opencl_s_select_v16i8.spvasm
op_opencl_s_select_v2double.spvasm
op_opencl_s_select_v2float.spvasm
op_opencl_s_select_v2i16.spvasm
op_opencl_s_select_v2i32.spvasm
op_opencl_s_select_v2i64.spvasm
op_opencl_s_select_v2i8.spvasm
op_opencl_s_select_v3double.spvasm
op_opencl_s_select_v3float.spvasm
op_opencl_s_select_v3i16.spvasm
op_opencl_s_select_v3i32.spvasm
op_opencl_s_select_v3i64.spvasm
op_opencl_s_select_v3i8.spvasm
op_opencl_s_select_v4double.spvasm
op_opencl_s_select_v4float.spvasm
op_opencl_s_select_v4i16.spvasm
op_opencl_s_select_v4i32.spvasm
op_opencl_s_select_v4i64.spvasm
op_opencl_s_select_v4i8.spvasm
op_opencl_s_select_v8double.spvasm
op_opencl_s_select_v8float.spvasm
op_opencl_s_select_v8i16.spvasm
op_opencl_s_select_v8i32.spvasm
op_opencl_s_select_v8i64.spvasm
op_opencl_s_select_v8i8.spvasm
op_opencl_s_shuffle2_v16i16.spvasm
op_opencl_s_shuffle2_v16i32.spvasm
op_opencl_s_shuffle2_v16i64.spvasm
op_opencl_s_shuffle2_v16i8.spvasm
op_opencl_s_shuffle2_v2i16.spvasm
op_opencl_s_shuffle2_v2i32.spvasm
op_opencl_s_shuffle2_v2i64.spvasm
op_opencl_s_shuffle2_v2i8.spvasm
op_opencl_s_shuffle2_v4i16.spvasm
op_opencl_s_shuffle2_v4i32.spvasm
op_opencl_s_shuffle2_v4i64.spvasm
op_opencl_s_shuffle2_v4i8.spvasm
op_opencl_s_shuffle2_v8i16.spvasm
op_opencl_s_shuffle2_v8i32.spvasm
op_opencl_s_shuffle2_v8i64.spvasm
op_opencl_s_shuffle2_v8i8.spvasm
op_opencl_s_shuffle_v16i16.spvasm
op_opencl_s_shuffle_v16i32.spvasm
op_opencl_s_shuffle_v16i64.spvasm
op_opencl_s_shuffle_v16i8.spvasm
op_opencl_s_shuffle_v2i16.spvasm
op_opencl_s_shuffle_v2i32.spvasm
op_opencl_s_shuffle_v2i64.spvasm
op_opencl_s_shuffle_v2i8.spvasm
op_opencl_s_shuffle_v4i16.spvasm
op_opencl_s_shuffle_v4i32.spvasm
op_opencl_s_shuffle_v4i64.spvasm
op_opencl_s_shuffle_v4i8.spvasm
op_opencl_s_shuffle_v8i16.spvasm
op_opencl_s_shuffle_v8i32.spvasm
op_opencl_s_shuffle_v8i64.spvasm
op_opencl_s_shuffle_v8i8.spvasm
op_opencl_s_sub_sat_i16.spvasm
op_opencl_s_sub_sat_i32.spvasm
op_opencl_s_sub_sat_i64.spvasm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
OpName %in_image "in_image"

%void_t = OpTypeVoid
%int_t = OpTypeInt 32 1
%uint_t = OpTypeInt 32 0
%float_t = OpTypeFloat 32
%v2uint_t = OpTypeVector %uint_t 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,12 @@
OpName %f "f"
%void = OpTypeVoid
%3 = OpTypeFunction %void
%struct_float = OpTypeFloat 32
%_ptr_Function_float = OpTypePointer Function %struct_float
%float = OpTypeFloat 32 ; this should be blank if type is Foo
%9 = OpConstant %struct_float 42.42
%float = OpTypeFloat 32
%_ptr_Function_float = OpTypePointer Function %float
%9 = OpConstant %float 42.42
%struct_int = OpTypeInt 32 0
OpTypeForwardPointer %ptr_float Function
%Foo = OpTypeStruct %struct_int %struct_float %ptr_float
%Foo = OpTypeStruct %struct_int %float %ptr_float
%ptr_float = OpTypePointer Function %float ; this should be blank if type is Foo
%ptr_Foo = OpTypePointer Function %Foo
%14 = OpConstant %struct_int 1
Expand All @@ -49,8 +48,8 @@
%res = OpVariable %_ptr_Function_float Function
%f = OpVariable %ptr_Foo Function
%15 = OpInBoundsAccessChain %_ptr_Function_float %f %14
%16 = OpLoad %struct_float %15
%17 = OpFAdd %struct_float %9 %16
%16 = OpLoad %float %15
%17 = OpFAdd %float %9 %16
OpStore %res %17
OpReturn
OpFunctionEnd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@
%_ptr_Function_float = OpTypePointer Function %float
%uint = OpTypeInt 32 0 ; this should be blank if type is Foo
%9 = OpConstant %float 42.42
%struct_int = OpTypeInt 32 0
OpTypeForwardPointer %ptr_uint Function
%Foo = OpTypeStruct %struct_int %float %ptr_uint
%Foo = OpTypeStruct %uint %float %ptr_uint
; CHECK: [[Foo:%[a-zA-Z0-9_]+]] = type { i32, float, ptr }
%ptr_uint = OpTypePointer Function %uint ; this should be blank if type is Foo
%ptr_Foo = OpTypePointer Function %Foo
%14 = OpConstant %struct_int 1
%14 = OpConstant %uint 1
%main = OpFunction %void None %3
; CHECK: define spir_kernel void @main()
%5 = OpLabel
Expand Down
14 changes: 5 additions & 9 deletions modules/compiler/spirv-ll/test/spvasm/op_group_broadcast.spvasm
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,15 @@
OpEntryPoint Kernel %bool_broadcast_fcn "bool_broadcast"

%uint_ty = OpTypeInt 32 0
%int_ty = OpTypeInt 32 1
%float_ty = OpTypeFloat 32
%bool_ty = OpTypeBool
%ptr_CrossWorkgroup_uint_ty = OpTypePointer CrossWorkgroup %uint_ty
%ptr_CrossWorkgroup_int_ty = OpTypePointer CrossWorkgroup %int_ty
%ptr_CrossWorkgroup_float_ty = OpTypePointer CrossWorkgroup %float_ty
%ptr_CrossWorkgroup_bool_ty = OpTypePointer CrossWorkgroup %bool_ty
%void_ty = OpTypeVoid
%uint_fcn_ty = OpTypeFunction %void_ty %ptr_CrossWorkgroup_uint_ty
%uint_uint_fcn_ty = OpTypeFunction %void_ty %ptr_CrossWorkgroup_uint_ty %uint_ty
%int_fcn_ty = OpTypeFunction %void_ty %ptr_CrossWorkgroup_int_ty
%int_fcn_ty = OpTypeFunction %void_ty %ptr_CrossWorkgroup_uint_ty
%float_fcn_ty = OpTypeFunction %void_ty %ptr_CrossWorkgroup_float_ty
%bool_fcn_ty = OpTypeFunction %void_ty %ptr_CrossWorkgroup_bool_ty

Expand Down Expand Up @@ -105,20 +103,18 @@
; CHCK-LABEL: int_broadcast
; CHECK: define spir_kernel void @int_broadcast(ptr addrspace(1) [[IN:%[a-zA-Z0-9_]+]])
%int_broadcast_fcn = OpFunction %void_ty None %int_fcn_ty
%int_broadcast_in = OpFunctionParameter %ptr_CrossWorkgroup_int_ty
%int_broadcast_in = OpFunctionParameter %ptr_CrossWorkgroup_uint_ty
%int_broadcast_bb = OpLabel
; CHECK: [[VAL:%[a-zA-Z0-9_]+]] = load i32, ptr addrspace(1) [[IN]], align 4
%int_broadcast_val = OpLoad %int_ty %int_broadcast_in Aligned 4
; CHECK: [[RES:%[a-zA-Z0-9]+]] = call spir_func i32 @_Z19sub_group_broadcastij(i32 [[VAL]], i32 0)
%int_broadcast_res = OpGroupBroadcast %int_ty %sub_group_scope %int_broadcast_val %zero
%int_broadcast_val = OpLoad %uint_ty %int_broadcast_in Aligned 4
; CHECK: [[RES:%[a-zA-Z0-9]+]] = call spir_func i32 @_Z19sub_group_broadcastjj(i32 [[VAL]], i32 0)
%int_broadcast_res = OpGroupBroadcast %uint_ty %sub_group_scope %int_broadcast_val %zero
; CHECK: store i32 [[RES]], ptr addrspace(1) [[IN]]
OpStore %int_broadcast_in %int_broadcast_res Aligned 4
; CHECK: ret void
OpReturn
OpFunctionEnd

; CHECK: declare spir_func i32 @_Z19sub_group_broadcastij(i32, i32)

; CHCK-LABEL: float_broadcast
; CHECK: define spir_kernel void @float_broadcast(ptr addrspace(1) [[IN:%[a-zA-Z0-9_]+]])
%float_broadcast_fcn = OpFunction %void_ty None %float_fcn_ty
Expand Down
Loading

0 comments on commit afcf992

Please sign in to comment.