File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed
test/extensions/INTEL/SPV_INTEL_subgroup_requirements Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -168,9 +168,9 @@ void PreprocessMetadataBase::visit(Module *M) {
168
168
// !{void (i32 addrspace(1)*)* @kernel, i32 35, i32 size}
169
169
if (MDNode *ReqdSubgroupSize = Kernel.getMetadata (kSPIR2MD ::SubgroupSize)) {
170
170
// A primary named subgroup size is encoded as
171
- // the metadata intel_reqd_sub_group_size with value 0 .
171
+ // the metadata intel_reqd_sub_group_size with value -1 .
172
172
auto Val = getMDOperandAsInt (ReqdSubgroupSize, 0 );
173
- if (Val == 0 )
173
+ if (Val == - 1U )
174
174
EM.addOp ()
175
175
.add (&Kernel)
176
176
.add (spv::internal::ExecutionModeNamedSubgroupSizeINTEL)
Original file line number Diff line number Diff line change @@ -4184,8 +4184,8 @@ bool SPIRVToLLVM::transMetadata() {
4184
4184
->getLiterals ()[0 ] == 0 &&
4185
4185
" Invalid named sub group size" );
4186
4186
// On the LLVM IR side, this is represented as the metadata
4187
- // intel_reqd_sub_group_size with value 0 .
4188
- auto *SizeMD = ConstantAsMetadata::get (getUInt32 (M, 0 ));
4187
+ // intel_reqd_sub_group_size with value -1 .
4188
+ auto *SizeMD = ConstantAsMetadata::get (getInt32 (M, - 1 ));
4189
4189
F->setMetadata (kSPIR2MD ::SubgroupSize, MDNode::get (*Context, SizeMD));
4190
4190
}
4191
4191
// Generate metadata for max_work_group_size
Original file line number Diff line number Diff line change 19
19
; CHECK-SPIRV: ExecutionMode [[kernel]] 6446 0
20
20
21
21
; CHECK-LLVM: spir_kernel void @_ZTSZ4mainE7Kernel1() {{.*}} !intel_reqd_sub_group_size ![[MD:[0-9]+]]
22
- ; CHECK-LLVM: ![[MD]] = !{i32 0 }
22
+ ; CHECK-LLVM: ![[MD]] = !{i32 -1 }
23
23
24
+ ; Check that with no SPV_INTEL_subgroup_requirements,
25
+ ; (1) No SubgroupRequirementsINTEL Capability nor SPV_INTEL_subgroup_requirements extension is attached
26
+ ; (2) the SubgroupSize (=35) ExecutionMode is attached with the value original value from the LLVM IR
24
27
; CHECK-SPIRV-2-NOT: Capability SubgroupRequirementsINTEL
25
28
; CHECK-SPIRV-2-NOT: Extension "SPV_INTEL_subgroup_requirements"
26
29
; CHECK-SPIRV-2: EntryPoint 6 [[kernel:[0-9]+]] "_ZTSZ4mainE7Kernel1"
27
- ; CHECK-SPIRV-2: ExecutionMode [[kernel]] 35 0
30
+ ; CHECK-SPIRV-2: ExecutionMode [[kernel]] 35 4294967295
28
31
29
32
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
30
33
target triple = "spir64-unknown-unknown"
@@ -51,4 +54,4 @@ attributes #0 = { mustprogress norecurse nounwind "frame-pointer"="all" "no-trap
51
54
!4 = !{!"clang version 18.0.0git (/ws/llvm/clang 8fd29b3c2aa9f9ce163be557b51de39c95aaf230)" }
52
55
!5 = !{i32 358 }
53
56
!6 = !{}
54
- !7 = !{i32 0 }
57
+ !7 = !{i32 - 1 }
You can’t perform that action at this time.
0 commit comments