Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/transcoding/ReqdSubgroupSize.ll

raw
1 ; Check translation of intel_reqd_sub_group_size metadata to SubgroupSize
2 ; execution mode and back. The IR is producded from the following OpenCL C code:
3 ; kernel __attribute__((intel_reqd_sub_group_size(8)))
4 ; void foo() {}
5
6 ; RUN: llvm-as %s -o - | llvm-spirv -o %t.spv
7 ; RUN: spirv-val %t.spv
8 ; RUN: llvm-spirv %t.spv -to-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV
9 ; RUN: llvm-spirv %t.spv -r -emit-opaque-pointers -o - | llvm-dis -o - | FileCheck %s --check-prefix=CHECK-LLVM
10
11 ; CHECK-SPIRV: Capability SubgroupDispatch
12 ; CHECK-SPIRV: EntryPoint 6 [[kernel:[0-9]+]] "foo"
13 ; CHECK-SPIRV: ExecutionMode [[kernel]] 35 8
14
15 ; CHECK-LLVM: spir_kernel void @foo() {{.*}} !intel_reqd_sub_group_size ![[MD:[0-9]+]]
16 ; CHECK-LLVM: ![[MD]] = !{i32 8}
17
18 ; ModuleID = 'ReqdSubgroupSize.ll'
19 source_filename = "ReqdSubgroupSize.ll"
20 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"
21 target triple = "spir"
22
23 ; Function Attrs: norecurse nounwind readnone
24 define spir_kernel void @foo() local_unnamed_addr #0 !kernel_arg_addr_space !3 !kernel_arg_access_qual !3 !kernel_arg_type !3 !kernel_arg_base_type !3 !kernel_arg_type_qual !3 !intel_reqd_sub_group_size !5 {
25 entry:
26 ret void
27 }
28
29 attributes #0 = { norecurse nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
30
31 !llvm.module.flags = !{!0}
32 !opencl.enable.FP_CONTRACT = !{}
33 !opencl.ocl.version = !{!1}
34 !opencl.spir.version = !{!2}
35 !opencl.used.extensions = !{!3}
36 !opencl.used.optional.core.features = !{!3}
37 !opencl.compiler.options = !{!3}
38 !llvm.ident = !{!4}
39
40 !0 = !{i32 1, !"wchar_size", i32 4}
41 !1 = !{i32 1, i32 0}
42 !2 = !{i32 1, i32 2}
43 !3 = !{}
44 !4 = !{!"clang version 6.0.0 (cfe/trunk)"}
45 !5 = !{i32 8}