-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
9e34a4c
commit 3073047
Showing
98 changed files
with
5,020 additions
and
104 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
IGC/Compiler/tests/OpenCLPrintfResolution/empty_printf_call-typed-pointers.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
;=========================== begin_copyright_notice ============================ | ||
; | ||
; Copyright (C) 2023 Intel Corporation | ||
; | ||
; SPDX-License-Identifier: MIT | ||
; | ||
;============================ end_copyright_notice ============================= | ||
; RUN: igc_opt -igc-opencl-printf-resolution -S < %s | ||
; ------------------------------------------------ | ||
; OpenCLPrintfResolution | ||
; ------------------------------------------------ | ||
; | ||
; Was reduced from ocl test kernel: | ||
; kernel void empty_printf_call(global int* out) | ||
; { | ||
; int ret = printf(""); | ||
; *out = ret; | ||
; } | ||
; | ||
; ------------------------------------------------ | ||
|
||
@.str = internal unnamed_addr addrspace(2) constant [1 x i8] zeroinitializer, align 1, !spirv.Decorations !0 | ||
|
||
; Function Attrs: nounwind | ||
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 { | ||
entry: | ||
%empty_str = getelementptr inbounds [1 x i8], [1 x i8] addrspace(2)* @.str, i64 0, i64 0 | ||
%call = call spir_func i32 (i8 addrspace(2)*, ...) @printf(i8 addrspace(2)* %empty_str) #0 | ||
store i32 %call, i32 addrspace(1)* %out, align 4 | ||
ret void | ||
} | ||
|
||
; Function Attrs: nounwind | ||
declare spir_func i32 @printf(i8 addrspace(2)*, ...) #0 | ||
|
||
attributes #0 = { nounwind } | ||
|
||
!igc.functions = !{!0} | ||
!IGCMetadata = !{!9} | ||
|
||
!0 = !{void (i32 addrspace(1)*, <8 x i32>, <8 x i32>, i8 addrspace(2)*, i8*, i8 addrspace(1)*)* @empty_printf_call, !1} | ||
!1 = !{!2, !3} | ||
!2 = !{!"function_type", i32 0} | ||
!3 = !{!"implicit_arg_desc", !4, !5, !6, !7, !8} | ||
!4 = !{i32 0} | ||
!5 = !{i32 1} | ||
!6 = !{i32 10} | ||
!7 = !{i32 12} | ||
!8 = !{i32 13} | ||
!9 = !{!"ModuleMD", !10} | ||
!10 = !{!"FuncMD", !11, !12} | ||
!11 = distinct !{!"FuncMDMap[0]", void (i32 addrspace(1)*, <8 x i32>, <8 x i32>, i8 addrspace(2)*, i8*, i8 addrspace(1)*)* @empty_printf_call} | ||
!12 = !{!"FuncMDValue[0]", !13, !14, !15} | ||
!13 = !{!"localOffsets"} | ||
!14 = !{!"funcArgs"} | ||
!15 = !{!"functionType", !"KernelFunction"} |
5 changes: 3 additions & 2 deletions
5
IGC/Compiler/tests/OpenCLPrintfResolution/empty_printf_call.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
IGC/Compiler/tests/PartialEmuI64Ops/assert-sdiv-typed-pointers.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
;=========================== begin_copyright_notice ============================ | ||
; | ||
; Copyright (C) 2022 Intel Corporation | ||
; | ||
; SPDX-License-Identifier: MIT | ||
; | ||
;============================ end_copyright_notice ============================= | ||
; UNSUPPORTED: system-windows | ||
; REQUIRES: debug | ||
; | ||
; RUN: not igc_opt -platformdg2 --igc-PartialEmuI64Ops -S < %s 2>&1 | FileCheck %s | ||
; ------------------------------------------------ | ||
; PartialEmuI64Ops : assert check | ||
; ------------------------------------------------ | ||
|
||
; CHECK: There should not be `sdiv` which is already emulated by library call | ||
|
||
define void @test_sdiv(i64 %src1, i64 %src2) { | ||
%1 = sdiv i64 %src1, %src2 | ||
call void @use.i64(i64 %1) | ||
ret void | ||
} | ||
|
||
declare void @use.i64(i64) | ||
|
||
!igc.functions = !{!0} | ||
|
||
!0 = !{void (i64, i64)* @test_sdiv, !1} | ||
!1 = !{!2} | ||
!2 = !{!"function_type", i32 0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
IGC/Compiler/tests/PartialEmuI64Ops/assert-srem-typed-pointers.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
;=========================== begin_copyright_notice ============================ | ||
; | ||
; Copyright (C) 2022 Intel Corporation | ||
; | ||
; SPDX-License-Identifier: MIT | ||
; | ||
;============================ end_copyright_notice ============================= | ||
; UNSUPPORTED: system-windows | ||
; REQUIRES: debug | ||
; | ||
; RUN: not igc_opt -platformdg2 --igc-PartialEmuI64Ops -S < %s 2>&1 | FileCheck %s | ||
; ------------------------------------------------ | ||
; PartialEmuI64Ops : assert check | ||
; ------------------------------------------------ | ||
|
||
; CHECK: There should not be `srem` which is already emulated by library call | ||
define void @test_srem(i64 %src1, i64 %src2) { | ||
%1 = srem i64 %src1, %src2 | ||
call void @use.i64(i64 %1) | ||
ret void | ||
} | ||
|
||
declare void @use.i64(i64) | ||
|
||
!igc.functions = !{!0} | ||
|
||
!0 = !{void (i64, i64)* @test_srem, !1} | ||
!1 = !{!2} | ||
!2 = !{!"function_type", i32 0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
IGC/Compiler/tests/PartialEmuI64Ops/assert-udiv-typed-pointers.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
;=========================== begin_copyright_notice ============================ | ||
; | ||
; Copyright (C) 2022 Intel Corporation | ||
; | ||
; SPDX-License-Identifier: MIT | ||
; | ||
;============================ end_copyright_notice ============================= | ||
; UNSUPPORTED: system-windows | ||
; REQUIRES: debug | ||
; | ||
; RUN: not igc_opt -platformdg2 --igc-PartialEmuI64Ops -S < %s 2>&1 | FileCheck %s | ||
; ------------------------------------------------ | ||
; PartialEmuI64Ops : assert check | ||
; ------------------------------------------------ | ||
|
||
; CHECK: There should not be `udiv` which is already emulated by library call | ||
define void @test_udiv(i64 %src1, i64 %src2) { | ||
%1 = udiv i64 %src1, %src2 | ||
call void @use.i64(i64 %1) | ||
ret void | ||
} | ||
|
||
declare void @use.i64(i64) | ||
|
||
!igc.functions = !{!0} | ||
|
||
!0 = !{void (i64, i64)* @test_udiv, !1} | ||
!1 = !{!2} | ||
!2 = !{!"function_type", i32 0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
IGC/Compiler/tests/PartialEmuI64Ops/assert-urem-typed-pointers.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
;=========================== begin_copyright_notice ============================ | ||
; | ||
; Copyright (C) 2022 Intel Corporation | ||
; | ||
; SPDX-License-Identifier: MIT | ||
; | ||
;============================ end_copyright_notice ============================= | ||
; UNSUPPORTED: system-windows | ||
; REQUIRES: debug | ||
; | ||
; RUN: not igc_opt -platformdg2 --igc-PartialEmuI64Ops -S < %s 2>&1 | FileCheck %s | ||
; ------------------------------------------------ | ||
; PartialEmuI64Ops : assert check | ||
; ------------------------------------------------ | ||
|
||
; CHECK: There should not be `urem` which is already emulated by library call | ||
define void @test_urem(i64 %src1, i64 %src2) { | ||
%1 = urem i64 %src1, %src2 | ||
call void @use.i64(i64 %1) | ||
ret void | ||
} | ||
|
||
declare void @use.i64(i64) | ||
|
||
!igc.functions = !{!0} | ||
|
||
!0 = !{void (i64, i64)* @test_urem, !1} | ||
!1 = !{!2} | ||
!2 = !{!"function_type", i32 0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.