xref: /llvm-project/llvm/test/CodeGen/SPIRV/transcoding/vec_type_hint.ll (revision 8468e67495eda83e2490224be46967ddc29821d2)
1; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV
2
3;; kernel
4;; __attribute__((vec_type_hint(float4)))
5;; void test_float() {}
6
7;; kernel
8;; __attribute__((vec_type_hint(double)))
9;; void test_double() {}
10
11;; kernel
12;; __attribute__((vec_type_hint(uint4)))
13;; void test_uint() {}
14
15;; kernel
16;; __attribute__((vec_type_hint(int8)))
17;; void test_int() {}
18
19; CHECK-SPIRV: OpEntryPoint {{.*}} %[[#]] "test_float"
20; CHECK-SPIRV: OpEntryPoint {{.*}} %[[#]] "test_double"
21; CHECK-SPIRV: OpEntryPoint {{.*}} %[[#]] "test_uint"
22; CHECK-SPIRV: OpEntryPoint {{.*}} %[[#]] "test_int"
23; CHECK-SPIRV: OpExecutionMode %[[#]] VecTypeHint [[#]]
24; CHECK-SPIRV: OpExecutionMode %[[#]] VecTypeHint [[#]]
25; CHECK-SPIRV: OpExecutionMode %[[#]] VecTypeHint [[#]]
26; CHECK-SPIRV: OpExecutionMode %[[#]] VecTypeHint [[#]]
27
28define dso_local spir_kernel void @test_float() !vec_type_hint !4 {
29entry:
30  ret void
31}
32
33define dso_local spir_kernel void @test_double() !vec_type_hint !5 {
34entry:
35  ret void
36}
37
38define dso_local spir_kernel void @test_uint() !vec_type_hint !6 {
39entry:
40  ret void
41}
42
43define dso_local spir_kernel void @test_int() !vec_type_hint !7 {
44entry:
45  ret void
46}
47
48!4 = !{<4 x float> undef, i32 0}
49!5 = !{double undef, i32 0}
50!6 = !{<4 x i32> undef, i32 0}
51!7 = !{<8 x i32> undef, i32 1}
52