Skip to content

Commit e87b59a

Browse files
NikitaRudenkoIntelAlexeySotkin
authored andcommitted
Add tests for implementations of SPV_INTEL_vector_compute,
SPV_INTEL_float_controls2 and SPV_KHR_float_controls extensions Extensions are published at intel/llvm#1612 intel/llvm#1611
1 parent 010bb89 commit e87b59a

8 files changed

+550
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
; RUN: llvm-as %s -o %t.bc
2+
; RUN: llvm-spirv %t.bc -o %t.spv --spirv-ext=+SPV_INTEL_vector_compute --spirv-allow-unknown-intrinsics
3+
; RUN: llvm-spirv %t.spv -o %t.spt --to-text
4+
; RUN: llvm-spirv -r %t.spv -o %t.bc
5+
; RUN: llvm-dis %t.bc -o %t.ll
6+
; RUN: FileCheck %s --input-file %t.spt -check-prefix=SPV
7+
; RUN: FileCheck %s --input-file %t.ll -check-prefix=LLVM
8+
9+
; ModuleID = 'slm.bc'
10+
source_filename = "slm.cpp"
11+
target datalayout = "e-p:64:64-i64:64-n8:16:32"
12+
target triple = "spir"
13+
14+
; LLVM-DAG: @in = internal global{{[^#]*}}#[[K_RTE:[0-9]+]]
15+
; LLVM-DAG: attributes #[[K_RTE]]{{.*"VCByteOffset"="1" }}
16+
; SPV-DAG: Name [[IN:[0-9]+]] "in"
17+
; SPV-DAG: Decorate [[IN]] GlobalVariableOffsetINTEL 1
18+
19+
@in = internal global <256 x i8> undef, align 256 #0
20+
declare <256 x i8> @llvm.genx.vload(<256 x i8>* nonnull %aaa)
21+
22+
; Function Attrs: noinline norecurse nounwind readnone
23+
define dso_local dllexport spir_kernel void @k_rte(i32 %ibuf, i32 %obuf) local_unnamed_addr #1 {
24+
entry:
25+
%gload53 = tail call <256 x i8> @llvm.genx.vload(<256 x i8>* nonnull @in)
26+
ret void
27+
}
28+
29+
attributes #0 = { "VCByteOffset"="1" "VCVolatile" "VCGlobalVariable" }
30+
attributes #1 = { noinline norecurse nounwind readnone "VCMain" "VCFunction" "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "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" }
31+
32+
!llvm.module.flags = !{!0}
33+
!llvm.ident = !{!1}
34+
35+
!0 = !{i32 1, !"wchar_size", i32 4}
36+
!1 = !{!"clang version 8.0.1"}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
; RUN: llvm-as %s -o %t.bc
2+
; RUN: llvm-spirv %t.bc -o %t.spv --spirv-ext=+SPV_INTEL_vector_compute --spirv-allow-unknown-intrinsics
3+
; RUN: llvm-spirv %t.spv -o %t.spt --to-text
4+
; RUN: llvm-spirv -r %t.spv -o %t.bc
5+
; RUN: llvm-dis %t.bc -o %t.ll
6+
; RUN: FileCheck %s --input-file %t.spt -check-prefix=SPV
7+
; RUN: FileCheck %s --input-file %t.ll -check-prefix=LLVM
8+
9+
; ModuleID = 'slm.bc'
10+
source_filename = "slm.cpp"
11+
target datalayout = "e-p:64:64-i64:64-n8:16:32"
12+
target triple = "spir"
13+
14+
; LLVM-DAG: @in = internal global{{[^#]*}}#[[K_RTE:[0-9]+]]
15+
; LLVM-DAG: attributes #[[K_RTE]]{{.*"VCVolatile" }}
16+
; SPV-DAG: Name [[IN:[0-9]+]] "in"
17+
; SPV-DAG: Decorate [[IN]] Volatile
18+
19+
@in = internal global <256 x i8> undef, align 256 #0
20+
declare <256 x i8> @llvm.genx.vload(<256 x i8>* nonnull %aaa)
21+
22+
; Function Attrs: noinline norecurse nounwind readnone
23+
define dso_local dllexport spir_kernel void @k_rte(i32 %ibuf, i32 %obuf) local_unnamed_addr #1 {
24+
entry:
25+
%gload53 = tail call <256 x i8> @llvm.genx.vload(<256 x i8>* nonnull @in)
26+
ret void
27+
}
28+
29+
attributes #0 = { "VCByteOffset"="0" "VCVolatile" "VCGlobalVariable" }
30+
attributes #1 = { noinline norecurse nounwind readnone "VCFunction" "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "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" }
31+
32+
!llvm.module.flags = !{!0}
33+
!llvm.ident = !{!1}
34+
35+
!0 = !{i32 1, !"wchar_size", i32 4}
36+
!1 = !{!"clang version 8.0.1"}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
; RUN: llvm-as %s -o %t.bc
2+
; RUN: llvm-spirv %t.bc -o %t.spv --spirv-ext=+SPV_INTEL_vector_compute
3+
; RUN: llvm-spirv %t.spv -o %t.spt --to-text
4+
; RUN: llvm-spirv -r %t.spv -o %t.bc
5+
; RUN: llvm-dis %t.bc -o %t.ll
6+
; RUN: FileCheck %s --input-file %t.spt -check-prefix=SPV
7+
; RUN: FileCheck %s --input-file %t.ll -check-prefix=LLVM
8+
9+
; ModuleID = 'slm.bc'
10+
source_filename = "slm.cpp"
11+
target datalayout = "e-p:64:64-i64:64-n8:16:32"
12+
target triple = "spir"
13+
14+
; LLVM: @k_rte(i32 "VCArgumentIOKind"="0" %ibuf, i32 "VCArgumentIOKind"="1" %obuf)
15+
; SPV: Name [[IBUF:[0-9]+]] "ibuf"
16+
; SPV: Name [[OBUF:[0-9]+]] "obuf"
17+
; SPV: Decorate [[IBUF]] FuncParamIOKind 0
18+
; SPV: Decorate [[OBUF]] FuncParamIOKind 1
19+
; Function Attrs: noinline norecurse nounwind readnone
20+
define dso_local dllexport spir_kernel void @k_rte(i32 "VCArgumentIOKind"="0" %ibuf, i32 "VCArgumentIOKind"="1" %obuf) local_unnamed_addr #1 {
21+
entry:
22+
ret void
23+
}
24+
25+
attributes #1 = { noinline norecurse nounwind readnone "VCFunction" "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "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" }
26+
27+
!llvm.module.flags = !{!0}
28+
!llvm.ident = !{!1}
29+
30+
; Note
31+
!0 = !{i32 1, !"wchar_size", i32 4}
32+
!1 = !{!"clang version 8.0.1"}

0 commit comments

Comments
 (0)