| 1 |
; RUN: not llc -O0 -mtriple=spirv32-unknown-unknown %s -o %t.spvt 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR |
| 2 |
; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown --spirv-ext=+SPV_KHR_subgroup_rotate %s -o - | FileCheck %s |
| 3 |
; TODO: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_KHR_subgroup_rotate %s -o - -filetype=obj | spirv-val %} |
| 4 |
|
| 5 |
; CHECK-ERROR: LLVM ERROR: OpGroupNonUniformRotateKHR instruction requires the following SPIR-V extension: SPV_KHR_subgroup_rotate |
| 6 |
|
| 7 |
; CHECK: OpCapability GroupNonUniformRotateKHR |
| 8 |
; CHECK: OpExtension "SPV_KHR_subgroup_rotate" |
| 9 |
|
| 10 |
; CHECK-DAG: %[[TyInt8:.*]] = OpTypeInt 8 0 |
| 11 |
; CHECK-DAG: %[[TyInt16:.*]] = OpTypeInt 16 0 |
| 12 |
; CHECK-DAG: %[[TyInt32:.*]] = OpTypeInt 32 0 |
| 13 |
; CHECK-DAG: %[[TyInt64:.*]] = OpTypeInt 64 0 |
| 14 |
; CHECK-DAG: %[[TyFloat:.*]] = OpTypeFloat 32 |
| 15 |
; CHECK-DAG: %[[TyHalf:.*]] = OpTypeFloat 16 |
| 16 |
; CHECK-DAG: %[[TyDouble:.*]] = OpTypeFloat 64 |
| 17 |
; CHECK-DAG: %[[ScopeSubgroup:.*]] = OpConstant %[[TyInt32]] 3 |
| 18 |
; CHECK-DAG: %[[ConstInt2:.*]] = OpConstant %[[TyInt32]] 2 |
| 19 |
; CHECK-DAG: %[[ConstInt4:.*]] = OpConstant %[[TyInt32]] 4 |
| 20 |
|
| 21 |
target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" |
| 22 |
target triple = "spir" |
| 23 |
|
| 24 |
; Function Attrs: convergent noinline norecurse nounwind optnone |
| 25 |
define dso_local spir_kernel void @testRotateChar(ptr addrspace(1) noundef align 1 %dst) #0 !kernel_arg_addr_space !3 !kernel_arg_access_qual !4 !kernel_arg_type !5 !kernel_arg_base_type !5 !kernel_arg_type_qual !6 { |
| 26 |
entry: |
| 27 |
%dst.addr = alloca ptr addrspace(1), align 4 |
| 28 |
%v = alloca i8, align 1 |
| 29 |
store ptr addrspace(1) %dst, ptr %dst.addr, align 4 |
| 30 |
store i8 0, ptr %v, align 1 |
| 31 |
%value = load i8, ptr %v, align 1 |
| 32 |
; CHECK: OpGroupNonUniformRotateKHR %[[TyInt8]] %[[ScopeSubgroup]] %[[#]] %[[ConstInt2]] |
| 33 |
%call = call spir_func signext i8 @_Z16sub_group_rotateci(i8 noundef signext %value, i32 noundef 2) #2 |
| 34 |
%data = load ptr addrspace(1), ptr %dst.addr, align 4 |
| 35 |
%arrayidx = getelementptr inbounds i8, ptr addrspace(1) %data, i32 0 |
| 36 |
store i8 %call, ptr addrspace(1) %arrayidx, align 1 |
| 37 |
%value_clustered = load i8, ptr %v, align 1 |
| 38 |
; CHECK: OpGroupNonUniformRotateKHR %[[TyInt8]] %[[ScopeSubgroup]] %[[#]] %[[ConstInt2]] %[[ConstInt4]] |
| 39 |
%call1 = call spir_func signext i8 @_Z26sub_group_clustered_rotatecij(i8 noundef signext %value_clustered, i32 noundef 2, i32 noundef 4) #2 |
| 40 |
%data2 = load ptr addrspace(1), ptr %dst.addr, align 4 |
| 41 |
%arrayidx2 = getelementptr inbounds i8, ptr addrspace(1) %data2, i32 1 |
| 42 |
store i8 %call1, ptr addrspace(1) %arrayidx2, align 1 |
| 43 |
ret void |
| 44 |
} |
| 45 |
|
| 46 |
; Function Attrs: convergent nounwind |
| 47 |
declare spir_func signext i8 @_Z16sub_group_rotateci(i8 noundef signext, i32 noundef) #1 |
| 48 |
|
| 49 |
; Function Attrs: convergent nounwind |
| 50 |
declare spir_func signext i8 @_Z26sub_group_clustered_rotatecij(i8 noundef signext, i32 noundef, i32 noundef) #1 |
| 51 |
|
| 52 |
; Function Attrs: convergent noinline norecurse nounwind optnone |
| 53 |
define dso_local spir_kernel void @testRotateUChar(ptr addrspace(1) noundef align 1 %dst) #0 !kernel_arg_addr_space !3 !kernel_arg_access_qual !4 !kernel_arg_type !7 !kernel_arg_base_type !7 !kernel_arg_type_qual !6 { |
| 54 |
entry: |
| 55 |
%dst.addr = alloca ptr addrspace(1), align 4 |
| 56 |
%v = alloca i8, align 1 |
| 57 |
store ptr addrspace(1) %dst, ptr %dst.addr, align 4 |
| 58 |
store i8 0, ptr %v, align 1 |
| 59 |
%value = load i8, ptr %v, align 1 |
| 60 |
; CHECK: OpGroupNonUniformRotateKHR %[[TyInt8]] %[[ScopeSubgroup]] %[[#]] %[[ConstInt2]] |
| 61 |
%call = call spir_func zeroext i8 @_Z16sub_group_rotatehi(i8 noundef zeroext %value, i32 noundef 2) #2 |
| 62 |
%data = load ptr addrspace(1), ptr %dst.addr, align 4 |
| 63 |
%arrayidx = getelementptr inbounds i8, ptr addrspace(1) %data, i32 0 |
| 64 |
store i8 %call, ptr addrspace(1) %arrayidx, align 1 |
| 65 |
%value_clustered = load i8, ptr %v, align 1 |
| 66 |
; CHECK: OpGroupNonUniformRotateKHR %[[TyInt8]] %[[ScopeSubgroup]] %[[#]] %[[ConstInt2]] %[[ConstInt4]] |
| 67 |
%call1 = call spir_func zeroext i8 @_Z26sub_group_clustered_rotatehij(i8 noundef zeroext %value_clustered, i32 noundef 2, i32 noundef 4) #2 |
| 68 |
%data2 = load ptr addrspace(1), ptr %dst.addr, align 4 |
| 69 |
%arrayidx2 = getelementptr inbounds i8, ptr addrspace(1) %data2, i32 1 |
| 70 |
store i8 %call1, ptr addrspace(1) %arrayidx2, align 1 |
| 71 |
ret void |
| 72 |
} |
| 73 |
|
| 74 |
; Function Attrs: convergent nounwind |
| 75 |
declare spir_func zeroext i8 @_Z16sub_group_rotatehi(i8 noundef zeroext, i32 noundef) #1 |
| 76 |
|
| 77 |
; Function Attrs: convergent nounwind |
| 78 |
declare spir_func zeroext i8 @_Z26sub_group_clustered_rotatehij(i8 noundef zeroext, i32 noundef, i32 noundef) #1 |
| 79 |
|
| 80 |
; Function Attrs: convergent noinline norecurse nounwind optnone |
| 81 |
define dso_local spir_kernel void @testRotateShort(ptr addrspace(1) noundef align 2 %dst) #0 !kernel_arg_addr_space !3 !kernel_arg_access_qual !4 !kernel_arg_type !8 !kernel_arg_base_type !8 !kernel_arg_type_qual !6 { |
| 82 |
entry: |
| 83 |
%dst.addr = alloca ptr addrspace(1), align 4 |
| 84 |
%v = alloca i16, align 2 |
| 85 |
store ptr addrspace(1) %dst, ptr %dst.addr, align 4 |
| 86 |
store i16 0, ptr %v, align 2 |
| 87 |
%value = load i16, ptr %v, align 2 |
| 88 |
; CHECK: OpGroupNonUniformRotateKHR %[[TyInt16]] %[[ScopeSubgroup]] %[[#]] %[[ConstInt2]] |
| 89 |
%call = call spir_func signext i16 @_Z16sub_group_rotatesi(i16 noundef signext %value, i32 noundef 2) #2 |
| 90 |
%data = load ptr addrspace(1), ptr %dst.addr, align 4 |
| 91 |
%arrayidx = getelementptr inbounds i16, ptr addrspace(1) %data, i32 0 |
| 92 |
store i16 %call, ptr addrspace(1) %arrayidx, align 2 |
| 93 |
%value_clustered = load i16, ptr %v, align 2 |
| 94 |
; CHECK: OpGroupNonUniformRotateKHR %[[TyInt16]] %[[ScopeSubgroup]] %[[#]] %[[ConstInt2]] %[[ConstInt4]] |
| 95 |
%call1 = call spir_func signext i16 @_Z26sub_group_clustered_rotatesij(i16 noundef signext %value_clustered, i32 noundef 2, i32 noundef 4) #2 |
| 96 |
%data2 = load ptr addrspace(1), ptr %dst.addr, align 4 |
| 97 |
%arrayidx2 = getelementptr inbounds i16, ptr addrspace(1) %data2, i32 1 |
| 98 |
store i16 %call1, ptr addrspace(1) %arrayidx2, align 2 |
| 99 |
ret void |
| 100 |
} |
| 101 |
|
| 102 |
; Function Attrs: convergent nounwind |
| 103 |
declare spir_func signext i16 @_Z16sub_group_rotatesi(i16 noundef signext, i32 noundef) #1 |
| 104 |
|
| 105 |
; Function Attrs: convergent nounwind |
| 106 |
declare spir_func signext i16 @_Z26sub_group_clustered_rotatesij(i16 noundef signext, i32 noundef, i32 noundef) #1 |
| 107 |
|
| 108 |
; Function Attrs: convergent noinline norecurse nounwind optnone |
| 109 |
define dso_local spir_kernel void @testRotateUShort(ptr addrspace(1) noundef align 2 %dst) #0 !kernel_arg_addr_space !3 !kernel_arg_access_qual !4 !kernel_arg_type !9 !kernel_arg_base_type !9 !kernel_arg_type_qual !6 { |
| 110 |
entry: |
| 111 |
%dst.addr = alloca ptr addrspace(1), align 4 |
| 112 |
%v = alloca i16, align 2 |
| 113 |
store ptr addrspace(1) %dst, ptr %dst.addr, align 4 |
| 114 |
store i16 0, ptr %v, align 2 |
| 115 |
%value = load i16, ptr %v, align 2 |
| 116 |
; CHECK: OpGroupNonUniformRotateKHR %[[TyInt16]] %[[ScopeSubgroup]] %[[#]] %[[ConstInt2]] |
| 117 |
%call = call spir_func zeroext i16 @_Z16sub_group_rotateti(i16 noundef zeroext %value, i32 noundef 2) #2 |
| 118 |
%data = load ptr addrspace(1), ptr %dst.addr, align 4 |
| 119 |
%arrayidx = getelementptr inbounds i16, ptr addrspace(1) %data, i32 0 |
| 120 |
store i16 %call, ptr addrspace(1) %arrayidx, align 2 |
| 121 |
%value_clustered = load i16, ptr %v, align 2 |
| 122 |
; CHECK: OpGroupNonUniformRotateKHR %[[TyInt16]] %[[ScopeSubgroup]] %[[#]] %[[ConstInt2]] %[[ConstInt4]] |
| 123 |
%call1 = call spir_func zeroext i16 @_Z26sub_group_clustered_rotatetij(i16 noundef zeroext %value_clustered, i32 noundef 2, i32 noundef 4) #2 |
| 124 |
%data2 = load ptr addrspace(1), ptr %dst.addr, align 4 |
| 125 |
%arrayidx2 = getelementptr inbounds i16, ptr addrspace(1) %data2, i32 1 |
| 126 |
store i16 %call1, ptr addrspace(1) %arrayidx2, align 2 |
| 127 |
ret void |
| 128 |
} |
| 129 |
|
| 130 |
; Function Attrs: convergent nounwind |
| 131 |
declare spir_func zeroext i16 @_Z16sub_group_rotateti(i16 noundef zeroext, i32 noundef) #1 |
| 132 |
|
| 133 |
; Function Attrs: convergent nounwind |
| 134 |
declare spir_func zeroext i16 @_Z26sub_group_clustered_rotatetij(i16 noundef zeroext, i32 noundef, i32 noundef) #1 |
| 135 |
|
| 136 |
; Function Attrs: convergent noinline norecurse nounwind optnone |
| 137 |
define dso_local spir_kernel void @testRotateInt(ptr addrspace(1) noundef align 4 %dst) #0 !kernel_arg_addr_space !3 !kernel_arg_access_qual !4 !kernel_arg_type !10 !kernel_arg_base_type !10 !kernel_arg_type_qual !6 { |
| 138 |
entry: |
| 139 |
%dst.addr = alloca ptr addrspace(1), align 4 |
| 140 |
%v = alloca i32, align 4 |
| 141 |
store ptr addrspace(1) %dst, ptr %dst.addr, align 4 |
| 142 |
store i32 0, ptr %v, align 4 |
| 143 |
%value = load i32, ptr %v, align 4 |
| 144 |
; CHECK: OpGroupNonUniformRotateKHR %[[TyInt32]] %[[ScopeSubgroup]] %[[#]] %[[ConstInt2]] |
| 145 |
%call = call spir_func i32 @_Z16sub_group_rotateii(i32 noundef %value, i32 noundef 2) #2 |
| 146 |
%data = load ptr addrspace(1), ptr %dst.addr, align 4 |
| 147 |
%arrayidx = getelementptr inbounds i32, ptr addrspace(1) %data, i32 0 |
| 148 |
store i32 %call, ptr addrspace(1) %arrayidx, align 4 |
| 149 |
%value_clustered = load i32, ptr %v, align 4 |
| 150 |
; CHECK: OpGroupNonUniformRotateKHR %[[TyInt32]] %[[ScopeSubgroup]] %[[#]] %[[ConstInt2]] %[[ConstInt4]] |
| 151 |
%call1 = call spir_func i32 @_Z26sub_group_clustered_rotateiij(i32 noundef %value_clustered, i32 noundef 2, i32 noundef 4) #2 |
| 152 |
%data2 = load ptr addrspace(1), ptr %dst.addr, align 4 |
| 153 |
%arrayidx2 = getelementptr inbounds i32, ptr addrspace(1) %data2, i32 1 |
| 154 |
store i32 %call1, ptr addrspace(1) %arrayidx2, align 4 |
| 155 |
ret void |
| 156 |
} |
| 157 |
|
| 158 |
; Function Attrs: convergent nounwind |
| 159 |
declare spir_func i32 @_Z16sub_group_rotateii(i32 noundef, i32 noundef) #1 |
| 160 |
|
| 161 |
; Function Attrs: convergent nounwind |
| 162 |
declare spir_func i32 @_Z26sub_group_clustered_rotateiij(i32 noundef, i32 noundef, i32 noundef) #1 |
| 163 |
|
| 164 |
; Function Attrs: convergent noinline norecurse nounwind optnone |
| 165 |
define dso_local spir_kernel void @testRotateUInt(ptr addrspace(1) noundef align 4 %dst) #0 !kernel_arg_addr_space !3 !kernel_arg_access_qual !4 !kernel_arg_type !11 !kernel_arg_base_type !11 !kernel_arg_type_qual !6 { |
| 166 |
entry: |
| 167 |
%dst.addr = alloca ptr addrspace(1), align 4 |
| 168 |
%v = alloca i32, align 4 |
| 169 |
store ptr addrspace(1) %dst, ptr %dst.addr, align 4 |
| 170 |
store i32 0, ptr %v, align 4 |
| 171 |
%value = load i32, ptr %v, align 4 |
| 172 |
; CHECK: OpGroupNonUniformRotateKHR %[[TyInt32]] %[[ScopeSubgroup]] %[[#]] %[[ConstInt2]] |
| 173 |
%call = call spir_func i32 @_Z16sub_group_rotateji(i32 noundef %value, i32 noundef 2) #2 |
| 174 |
%data = load ptr addrspace(1), ptr %dst.addr, align 4 |
| 175 |
%arrayidx = getelementptr inbounds i32, ptr addrspace(1) %data, i32 0 |
| 176 |
store i32 %call, ptr addrspace(1) %arrayidx, align 4 |
| 177 |
%value_clustered = load i32, ptr %v, align 4 |
| 178 |
; CHECK: OpGroupNonUniformRotateKHR %[[TyInt32]] %[[ScopeSubgroup]] %[[#]] %[[ConstInt2]] %[[ConstInt4]] |
| 179 |
%call1 = call spir_func i32 @_Z26sub_group_clustered_rotatejij(i32 noundef %value_clustered, i32 noundef 2, i32 noundef 4) #2 |
| 180 |
%data2 = load ptr addrspace(1), ptr %dst.addr, align 4 |
| 181 |
%arrayidx2 = getelementptr inbounds i32, ptr addrspace(1) %data2, i32 1 |
| 182 |
store i32 %call1, ptr addrspace(1) %arrayidx2, align 4 |
| 183 |
ret void |
| 184 |
} |
| 185 |
|
| 186 |
; Function Attrs: convergent nounwind |
| 187 |
declare spir_func i32 @_Z16sub_group_rotateji(i32 noundef, i32 noundef) #1 |
| 188 |
|
| 189 |
; Function Attrs: convergent nounwind |
| 190 |
declare spir_func i32 @_Z26sub_group_clustered_rotatejij(i32 noundef, i32 noundef, i32 noundef) #1 |
| 191 |
|
| 192 |
; Function Attrs: convergent noinline norecurse nounwind optnone |
| 193 |
define dso_local spir_kernel void @testRotateLong(ptr addrspace(1) noundef align 8 %dst) #0 !kernel_arg_addr_space !3 !kernel_arg_access_qual !4 !kernel_arg_type !12 !kernel_arg_base_type !12 !kernel_arg_type_qual !6 { |
| 194 |
entry: |
| 195 |
%dst.addr = alloca ptr addrspace(1), align 4 |
| 196 |
%v = alloca i64, align 8 |
| 197 |
store ptr addrspace(1) %dst, ptr %dst.addr, align 4 |
| 198 |
store i64 0, ptr %v, align 8 |
| 199 |
%value = load i64, ptr %v, align 8 |
| 200 |
; CHECK: OpGroupNonUniformRotateKHR %[[TyInt64]] %[[ScopeSubgroup]] %[[#]] %[[ConstInt2]] |
| 201 |
%call = call spir_func i64 @_Z16sub_group_rotateli(i64 noundef %value, i32 noundef 2) #2 |
| 202 |
%data = load ptr addrspace(1), ptr %dst.addr, align 4 |
| 203 |
%arrayidx = getelementptr inbounds i64, ptr addrspace(1) %data, i32 0 |
| 204 |
store i64 %call, ptr addrspace(1) %arrayidx, align 8 |
| 205 |
%value_clustered = load i64, ptr %v, align 8 |
| 206 |
; CHECK: OpGroupNonUniformRotateKHR %[[TyInt64]] %[[ScopeSubgroup]] %[[#]] %[[ConstInt2]] %[[ConstInt4]] |
| 207 |
%call1 = call spir_func i64 @_Z26sub_group_clustered_rotatelij(i64 noundef %value_clustered, i32 noundef 2, i32 noundef 4) #2 |
| 208 |
%data2 = load ptr addrspace(1), ptr %dst.addr, align 4 |
| 209 |
%arrayidx2 = getelementptr inbounds i64, ptr addrspace(1) %data2, i32 1 |
| 210 |
store i64 %call1, ptr addrspace(1) %arrayidx2, align 8 |
| 211 |
ret void |
| 212 |
} |
| 213 |
|
| 214 |
; Function Attrs: convergent nounwind |
| 215 |
declare spir_func i64 @_Z16sub_group_rotateli(i64 noundef, i32 noundef) #1 |
| 216 |
|
| 217 |
; Function Attrs: convergent nounwind |
| 218 |
declare spir_func i64 @_Z26sub_group_clustered_rotatelij(i64 noundef, i32 noundef, i32 noundef) #1 |
| 219 |
|
| 220 |
; Function Attrs: convergent noinline norecurse nounwind optnone |
| 221 |
define dso_local spir_kernel void @testRotateULong(ptr addrspace(1) noundef align 8 %dst) #0 !kernel_arg_addr_space !3 !kernel_arg_access_qual !4 !kernel_arg_type !13 !kernel_arg_base_type !13 !kernel_arg_type_qual !6 { |
| 222 |
entry: |
| 223 |
%dst.addr = alloca ptr addrspace(1), align 4 |
| 224 |
%v = alloca i64, align 8 |
| 225 |
store ptr addrspace(1) %dst, ptr %dst.addr, align 4 |
| 226 |
store i64 0, ptr %v, align 8 |
| 227 |
%value = load i64, ptr %v, align 8 |
| 228 |
; CHECK: OpGroupNonUniformRotateKHR %[[TyInt64]] %[[ScopeSubgroup]] %[[#]] %[[ConstInt2]] |
| 229 |
%call = call spir_func i64 @_Z16sub_group_rotatemi(i64 noundef %value, i32 noundef 2) #2 |
| 230 |
%data = load ptr addrspace(1), ptr %dst.addr, align 4 |
| 231 |
%arrayidx = getelementptr inbounds i64, ptr addrspace(1) %data, i32 0 |
| 232 |
store i64 %call, ptr addrspace(1) %arrayidx, align 8 |
| 233 |
%value_clustered = load i64, ptr %v, align 8 |
| 234 |
; CHECK: OpGroupNonUniformRotateKHR %[[TyInt64]] %[[ScopeSubgroup]] %[[#]] %[[ConstInt2]] %[[ConstInt4]] |
| 235 |
%call1 = call spir_func i64 @_Z26sub_group_clustered_rotatemij(i64 noundef %value_clustered, i32 noundef 2, i32 noundef 4) #2 |
| 236 |
%data2 = load ptr addrspace(1), ptr %dst.addr, align 4 |
| 237 |
%arrayidx2 = getelementptr inbounds i64, ptr addrspace(1) %data2, i32 1 |
| 238 |
store i64 %call1, ptr addrspace(1) %arrayidx2, align 8 |
| 239 |
ret void |
| 240 |
} |
| 241 |
|
| 242 |
; Function Attrs: convergent nounwind |
| 243 |
declare spir_func i64 @_Z16sub_group_rotatemi(i64 noundef, i32 noundef) #1 |
| 244 |
|
| 245 |
; Function Attrs: convergent nounwind |
| 246 |
declare spir_func i64 @_Z26sub_group_clustered_rotatemij(i64 noundef, i32 noundef, i32 noundef) #1 |
| 247 |
|
| 248 |
; Function Attrs: convergent noinline norecurse nounwind optnone |
| 249 |
define dso_local spir_kernel void @testRotateFloat(ptr addrspace(1) noundef align 4 %dst) #0 !kernel_arg_addr_space !3 !kernel_arg_access_qual !4 !kernel_arg_type !14 !kernel_arg_base_type !14 !kernel_arg_type_qual !6 { |
| 250 |
entry: |
| 251 |
%dst.addr = alloca ptr addrspace(1), align 4 |
| 252 |
%v = alloca float, align 4 |
| 253 |
store ptr addrspace(1) %dst, ptr %dst.addr, align 4 |
| 254 |
store float 0.000000e+00, ptr %v, align 4 |
| 255 |
%value = load float, ptr %v, align 4 |
| 256 |
; CHECK: OpGroupNonUniformRotateKHR %[[TyFloat]] %[[ScopeSubgroup]] %[[#]] %[[ConstInt2]] |
| 257 |
%call = call spir_func float @_Z16sub_group_rotatefi(float noundef %value, i32 noundef 2) #2 |
| 258 |
%data = load ptr addrspace(1), ptr %dst.addr, align 4 |
| 259 |
%arrayidx = getelementptr inbounds float, ptr addrspace(1) %data, i32 0 |
| 260 |
store float %call, ptr addrspace(1) %arrayidx, align 4 |
| 261 |
%value_clustered = load float, ptr %v, align 4 |
| 262 |
; CHECK: OpGroupNonUniformRotateKHR %[[TyFloat]] %[[ScopeSubgroup]] %[[#]] %[[ConstInt2]] %[[ConstInt4]] |
| 263 |
%call1 = call spir_func float @_Z26sub_group_clustered_rotatefij(float noundef %value_clustered, i32 noundef 2, i32 noundef 4) #2 |
| 264 |
%data2 = load ptr addrspace(1), ptr %dst.addr, align 4 |
| 265 |
%arrayidx2 = getelementptr inbounds float, ptr addrspace(1) %data2, i32 1 |
| 266 |
store float %call1, ptr addrspace(1) %arrayidx2, align 4 |
| 267 |
ret void |
| 268 |
} |
| 269 |
|
| 270 |
; Function Attrs: convergent nounwind |
| 271 |
declare spir_func float @_Z16sub_group_rotatefi(float noundef, i32 noundef) #1 |
| 272 |
|
| 273 |
; Function Attrs: convergent nounwind |
| 274 |
declare spir_func float @_Z26sub_group_clustered_rotatefij(float noundef, i32 noundef, i32 noundef) #1 |
| 275 |
|
| 276 |
; Function Attrs: convergent noinline norecurse nounwind optnone |
| 277 |
define dso_local spir_kernel void @testRotateHalf(ptr addrspace(1) noundef align 2 %dst) #0 !kernel_arg_addr_space !3 !kernel_arg_access_qual !4 !kernel_arg_type !15 !kernel_arg_base_type !15 !kernel_arg_type_qual !6 { |
| 278 |
entry: |
| 279 |
%dst.addr = alloca ptr addrspace(1), align 4 |
| 280 |
%v = alloca half, align 2 |
| 281 |
store ptr addrspace(1) %dst, ptr %dst.addr, align 4 |
| 282 |
store half 0xH0000, ptr %v, align 2 |
| 283 |
%value = load half, ptr %v, align 2 |
| 284 |
; CHECK: OpGroupNonUniformRotateKHR %[[TyHalf]] %[[ScopeSubgroup]] %[[#]] %[[ConstInt2]] |
| 285 |
%call = call spir_func half @_Z16sub_group_rotateDhi(half noundef %value, i32 noundef 2) #2 |
| 286 |
%data = load ptr addrspace(1), ptr %dst.addr, align 4 |
| 287 |
%arrayidx = getelementptr inbounds half, ptr addrspace(1) %data, i32 0 |
| 288 |
store half %call, ptr addrspace(1) %arrayidx, align 2 |
| 289 |
%value_clustered = load half, ptr %v, align 2 |
| 290 |
; CHECK: OpGroupNonUniformRotateKHR %[[TyHalf]] %[[ScopeSubgroup]] %[[#]] %[[ConstInt2]] %[[ConstInt4]] |
| 291 |
%call1 = call spir_func half @_Z26sub_group_clustered_rotateDhij(half noundef %value_clustered, i32 noundef 2, i32 noundef 4) #2 |
| 292 |
%data2 = load ptr addrspace(1), ptr %dst.addr, align 4 |
| 293 |
%arrayidx2 = getelementptr inbounds half, ptr addrspace(1) %data2, i32 1 |
| 294 |
store half %call1, ptr addrspace(1) %arrayidx2, align 2 |
| 295 |
ret void |
| 296 |
} |
| 297 |
|
| 298 |
; Function Attrs: convergent nounwind |
| 299 |
declare spir_func half @_Z16sub_group_rotateDhi(half noundef, i32 noundef) #1 |
| 300 |
|
| 301 |
; Function Attrs: convergent nounwind |
| 302 |
declare spir_func half @_Z26sub_group_clustered_rotateDhij(half noundef, i32 noundef, i32 noundef) #1 |
| 303 |
|
| 304 |
; Function Attrs: convergent noinline norecurse nounwind optnone |
| 305 |
define dso_local spir_kernel void @testRotateDouble(ptr addrspace(1) noundef align 8 %dst) #0 !kernel_arg_addr_space !3 !kernel_arg_access_qual !4 !kernel_arg_type !16 !kernel_arg_base_type !16 !kernel_arg_type_qual !6 { |
| 306 |
entry: |
| 307 |
%dst.addr = alloca ptr addrspace(1), align 4 |
| 308 |
%v = alloca double, align 8 |
| 309 |
store ptr addrspace(1) %dst, ptr %dst.addr, align 4 |
| 310 |
store double 0.000000e+00, ptr %v, align 8 |
| 311 |
%value = load double, ptr %v, align 8 |
| 312 |
; CHECK: OpGroupNonUniformRotateKHR %[[TyDouble]] %[[ScopeSubgroup]] %[[#]] %[[ConstInt2]] |
| 313 |
%call = call spir_func double @_Z16sub_group_rotatedi(double noundef %value, i32 noundef 2) #2 |
| 314 |
%data = load ptr addrspace(1), ptr %dst.addr, align 4 |
| 315 |
%arrayidx = getelementptr inbounds double, ptr addrspace(1) %data, i32 0 |
| 316 |
store double %call, ptr addrspace(1) %arrayidx, align 8 |
| 317 |
%value_clustered = load double, ptr %v, align 8 |
| 318 |
; CHECK: OpGroupNonUniformRotateKHR %[[TyDouble]] %[[ScopeSubgroup]] %[[#]] %[[ConstInt2]] %[[ConstInt4]] |
| 319 |
%call1 = call spir_func double @_Z26sub_group_clustered_rotatedij(double noundef %value_clustered, i32 noundef 2, i32 noundef 4) #2 |
| 320 |
%data2 = load ptr addrspace(1), ptr %dst.addr, align 4 |
| 321 |
%arrayidx2 = getelementptr inbounds double, ptr addrspace(1) %data2, i32 1 |
| 322 |
store double %call1, ptr addrspace(1) %arrayidx2, align 8 |
| 323 |
ret void |
| 324 |
} |
| 325 |
|
| 326 |
; Function Attrs: convergent nounwind |
| 327 |
declare spir_func double @_Z16sub_group_rotatedi(double noundef, i32 noundef) #1 |
| 328 |
|
| 329 |
; Function Attrs: convergent nounwind |
| 330 |
declare spir_func double @_Z26sub_group_clustered_rotatedij(double noundef, i32 noundef, i32 noundef) #1 |
| 331 |
|
| 332 |
attributes #0 = { convergent noinline norecurse nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "uniform-work-group-size"="false" } |
| 333 |
attributes #1 = { convergent nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" } |
| 334 |
attributes #2 = { convergent nounwind } |
| 335 |
|
| 336 |
!llvm.module.flags = !{!0} |
| 337 |
!opencl.ocl.version = !{!1} |
| 338 |
!opencl.spir.version = !{!1} |
| 339 |
!llvm.ident = !{!2} |
| 340 |
|
| 341 |
!0 = !{i32 1, !"wchar_size", i32 4} |
| 342 |
!1 = !{i32 2, i32 0} |
| 343 |
!2 = !{!"clang version 19.0.0"} |
| 344 |
!3 = !{i32 1} |
| 345 |
!4 = !{!"none"} |
| 346 |
!5 = !{!"char*"} |
| 347 |
!6 = !{!""} |
| 348 |
!7 = !{!"uchar*"} |
| 349 |
!8 = !{!"short*"} |
| 350 |
!9 = !{!"ushort*"} |
| 351 |
!10 = !{!"int*"} |
| 352 |
!11 = !{!"uint*"} |
| 353 |
!12 = !{!"long*"} |
| 354 |
!13 = !{!"ulong*"} |
| 355 |
!14 = !{!"float*"} |
| 356 |
!15 = !{!"half*"} |
| 357 |
!16 = !{!"double*"} |