Skip to content

Commit 3073047

Browse files
Guzewicz, Kacperigcbot
authored andcommitted
Conversion of IGC LITs for opaque pointer support, batch 11
This commit converts part of LITs so that igc_opt uses "--opaque-pointers" option that allows automatic conversion between typed and opaque pointers. Typed version of tests are still kept in separate files.
1 parent 9e34a4c commit 3073047

File tree

98 files changed

+5020
-104
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+5020
-104
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
;=========================== begin_copyright_notice ============================
2+
;
3+
; Copyright (C) 2023 Intel Corporation
4+
;
5+
; SPDX-License-Identifier: MIT
6+
;
7+
;============================ end_copyright_notice =============================
8+
; RUN: igc_opt -igc-opencl-printf-resolution -S < %s
9+
; ------------------------------------------------
10+
; OpenCLPrintfResolution
11+
; ------------------------------------------------
12+
;
13+
; Was reduced from ocl test kernel:
14+
; kernel void empty_printf_call(global int* out)
15+
; {
16+
; int ret = printf("");
17+
; *out = ret;
18+
; }
19+
;
20+
; ------------------------------------------------
21+
22+
@.str = internal unnamed_addr addrspace(2) constant [1 x i8] zeroinitializer, align 1, !spirv.Decorations !0
23+
24+
; Function Attrs: nounwind
25+
define spir_kernel void @empty_printf_call(i32 addrspace(1)* %out, <8 x i32> %r0, <8 x i32> %payloadHeader, i8 addrspace(2)* %constBase, i8* %privateBase, i8 addrspace(1)* %printfBuffer) #0 {
26+
entry:
27+
%empty_str = getelementptr inbounds [1 x i8], [1 x i8] addrspace(2)* @.str, i64 0, i64 0
28+
%call = call spir_func i32 (i8 addrspace(2)*, ...) @printf(i8 addrspace(2)* %empty_str) #0
29+
store i32 %call, i32 addrspace(1)* %out, align 4
30+
ret void
31+
}
32+
33+
; Function Attrs: nounwind
34+
declare spir_func i32 @printf(i8 addrspace(2)*, ...) #0
35+
36+
attributes #0 = { nounwind }
37+
38+
!igc.functions = !{!0}
39+
!IGCMetadata = !{!9}
40+
41+
!0 = !{void (i32 addrspace(1)*, <8 x i32>, <8 x i32>, i8 addrspace(2)*, i8*, i8 addrspace(1)*)* @empty_printf_call, !1}
42+
!1 = !{!2, !3}
43+
!2 = !{!"function_type", i32 0}
44+
!3 = !{!"implicit_arg_desc", !4, !5, !6, !7, !8}
45+
!4 = !{i32 0}
46+
!5 = !{i32 1}
47+
!6 = !{i32 10}
48+
!7 = !{i32 12}
49+
!8 = !{i32 13}
50+
!9 = !{!"ModuleMD", !10}
51+
!10 = !{!"FuncMD", !11, !12}
52+
!11 = distinct !{!"FuncMDMap[0]", void (i32 addrspace(1)*, <8 x i32>, <8 x i32>, i8 addrspace(2)*, i8*, i8 addrspace(1)*)* @empty_printf_call}
53+
!12 = !{!"FuncMDValue[0]", !13, !14, !15}
54+
!13 = !{!"localOffsets"}
55+
!14 = !{!"funcArgs"}
56+
!15 = !{!"functionType", !"KernelFunction"}

IGC/Compiler/tests/OpenCLPrintfResolution/empty_printf_call.ll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
;=========================== begin_copyright_notice ============================
22
;
3-
; Copyright (C) 2023 Intel Corporation
3+
; Copyright (C) 2023-2024 Intel Corporation
44
;
55
; SPDX-License-Identifier: MIT
66
;
77
;============================ end_copyright_notice =============================
8-
; RUN: igc_opt -igc-opencl-printf-resolution -S < %s
8+
; REQUIRES: llvm-14-plus
9+
; RUN: igc_opt --opaque-pointers -igc-opencl-printf-resolution -S < %s
910
; ------------------------------------------------
1011
; OpenCLPrintfResolution
1112
; ------------------------------------------------
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
;=========================== begin_copyright_notice ============================
2+
;
3+
; Copyright (C) 2022 Intel Corporation
4+
;
5+
; SPDX-License-Identifier: MIT
6+
;
7+
;============================ end_copyright_notice =============================
8+
; UNSUPPORTED: system-windows
9+
; REQUIRES: debug
10+
;
11+
; RUN: not igc_opt -platformdg2 --igc-PartialEmuI64Ops -S < %s 2>&1 | FileCheck %s
12+
; ------------------------------------------------
13+
; PartialEmuI64Ops : assert check
14+
; ------------------------------------------------
15+
16+
; CHECK: There should not be `sdiv` which is already emulated by library call
17+
18+
define void @test_sdiv(i64 %src1, i64 %src2) {
19+
%1 = sdiv i64 %src1, %src2
20+
call void @use.i64(i64 %1)
21+
ret void
22+
}
23+
24+
declare void @use.i64(i64)
25+
26+
!igc.functions = !{!0}
27+
28+
!0 = !{void (i64, i64)* @test_sdiv, !1}
29+
!1 = !{!2}
30+
!2 = !{!"function_type", i32 0}

IGC/Compiler/tests/PartialEmuI64Ops/assert-sdiv.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
;=========================== begin_copyright_notice ============================
22
;
3-
; Copyright (C) 2022 Intel Corporation
3+
; Copyright (C) 2022-2024 Intel Corporation
44
;
55
; SPDX-License-Identifier: MIT
66
;
77
;============================ end_copyright_notice =============================
88
; UNSUPPORTED: system-windows
9-
; REQUIRES: debug
9+
; REQUIRES: llvm-14-plus, debug
1010
;
1111
; RUN: not igc_opt -platformdg2 --igc-PartialEmuI64Ops -S < %s 2>&1 | FileCheck %s
1212
; ------------------------------------------------
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
;=========================== begin_copyright_notice ============================
2+
;
3+
; Copyright (C) 2022 Intel Corporation
4+
;
5+
; SPDX-License-Identifier: MIT
6+
;
7+
;============================ end_copyright_notice =============================
8+
; UNSUPPORTED: system-windows
9+
; REQUIRES: debug
10+
;
11+
; RUN: not igc_opt -platformdg2 --igc-PartialEmuI64Ops -S < %s 2>&1 | FileCheck %s
12+
; ------------------------------------------------
13+
; PartialEmuI64Ops : assert check
14+
; ------------------------------------------------
15+
16+
; CHECK: There should not be `srem` which is already emulated by library call
17+
define void @test_srem(i64 %src1, i64 %src2) {
18+
%1 = srem i64 %src1, %src2
19+
call void @use.i64(i64 %1)
20+
ret void
21+
}
22+
23+
declare void @use.i64(i64)
24+
25+
!igc.functions = !{!0}
26+
27+
!0 = !{void (i64, i64)* @test_srem, !1}
28+
!1 = !{!2}
29+
!2 = !{!"function_type", i32 0}

IGC/Compiler/tests/PartialEmuI64Ops/assert-srem.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
;=========================== begin_copyright_notice ============================
22
;
3-
; Copyright (C) 2022 Intel Corporation
3+
; Copyright (C) 2022-2024 Intel Corporation
44
;
55
; SPDX-License-Identifier: MIT
66
;
77
;============================ end_copyright_notice =============================
88
; UNSUPPORTED: system-windows
9-
; REQUIRES: debug
9+
; REQUIRES: llvm-14-plus, debug
1010
;
1111
; RUN: not igc_opt -platformdg2 --igc-PartialEmuI64Ops -S < %s 2>&1 | FileCheck %s
1212
; ------------------------------------------------
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
;=========================== begin_copyright_notice ============================
2+
;
3+
; Copyright (C) 2022 Intel Corporation
4+
;
5+
; SPDX-License-Identifier: MIT
6+
;
7+
;============================ end_copyright_notice =============================
8+
; UNSUPPORTED: system-windows
9+
; REQUIRES: debug
10+
;
11+
; RUN: not igc_opt -platformdg2 --igc-PartialEmuI64Ops -S < %s 2>&1 | FileCheck %s
12+
; ------------------------------------------------
13+
; PartialEmuI64Ops : assert check
14+
; ------------------------------------------------
15+
16+
; CHECK: There should not be `udiv` which is already emulated by library call
17+
define void @test_udiv(i64 %src1, i64 %src2) {
18+
%1 = udiv i64 %src1, %src2
19+
call void @use.i64(i64 %1)
20+
ret void
21+
}
22+
23+
declare void @use.i64(i64)
24+
25+
!igc.functions = !{!0}
26+
27+
!0 = !{void (i64, i64)* @test_udiv, !1}
28+
!1 = !{!2}
29+
!2 = !{!"function_type", i32 0}

IGC/Compiler/tests/PartialEmuI64Ops/assert-udiv.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
;=========================== begin_copyright_notice ============================
22
;
3-
; Copyright (C) 2022 Intel Corporation
3+
; Copyright (C) 2022-2024 Intel Corporation
44
;
55
; SPDX-License-Identifier: MIT
66
;
77
;============================ end_copyright_notice =============================
88
; UNSUPPORTED: system-windows
9-
; REQUIRES: debug
9+
; REQUIRES: llvm-14-plus, debug
1010
;
1111
; RUN: not igc_opt -platformdg2 --igc-PartialEmuI64Ops -S < %s 2>&1 | FileCheck %s
1212
; ------------------------------------------------
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
;=========================== begin_copyright_notice ============================
2+
;
3+
; Copyright (C) 2022 Intel Corporation
4+
;
5+
; SPDX-License-Identifier: MIT
6+
;
7+
;============================ end_copyright_notice =============================
8+
; UNSUPPORTED: system-windows
9+
; REQUIRES: debug
10+
;
11+
; RUN: not igc_opt -platformdg2 --igc-PartialEmuI64Ops -S < %s 2>&1 | FileCheck %s
12+
; ------------------------------------------------
13+
; PartialEmuI64Ops : assert check
14+
; ------------------------------------------------
15+
16+
; CHECK: There should not be `urem` which is already emulated by library call
17+
define void @test_urem(i64 %src1, i64 %src2) {
18+
%1 = urem i64 %src1, %src2
19+
call void @use.i64(i64 %1)
20+
ret void
21+
}
22+
23+
declare void @use.i64(i64)
24+
25+
!igc.functions = !{!0}
26+
27+
!0 = !{void (i64, i64)* @test_urem, !1}
28+
!1 = !{!2}
29+
!2 = !{!"function_type", i32 0}

IGC/Compiler/tests/PartialEmuI64Ops/assert-urem.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
;=========================== begin_copyright_notice ============================
22
;
3-
; Copyright (C) 2022 Intel Corporation
3+
; Copyright (C) 2022-2024 Intel Corporation
44
;
55
; SPDX-License-Identifier: MIT
66
;
77
;============================ end_copyright_notice =============================
88
; UNSUPPORTED: system-windows
9-
; REQUIRES: debug
9+
; REQUIRES: llvm-14-plus, debug
1010
;
1111
; RUN: not igc_opt -platformdg2 --igc-PartialEmuI64Ops -S < %s 2>&1 | FileCheck %s
1212
; ------------------------------------------------

0 commit comments

Comments
 (0)