1+ ;=========================== begin_copyright_notice ============================
2+ ;
3+ ; Copyright (C) 2025 Intel Corporation
4+ ;
5+ ; SPDX-License-Identifier: MIT
6+ ;
7+ ;============================ end_copyright_notice =============================
8+
9+ ; REQUIRES: regkeys,pvc-supported,llvm-14-plus
10+
11+ ; Check that functions called once from kernel are inlined in it even if they are called multiple times from other kernels.
12+
13+ ; RUN: llvm-as %s -o %t.bc
14+ ; RUN: ocloc compile -llvm_input -file %t.bc -options "-igc_opts 'DisableRecompilation=1, SubroutineThreshold=50, SubroutineInlinerThreshold=10, KernelTotalSizeThreshold=50, PrintToConsole=1, PrintBefore=EmitPass'" -device pvc 2>&1 | FileCheck %s
15+ ; CHECK-LABEL: @_ZTS28Kernel_A_Supposed_2B_Inlined(
16+ ; CHECK-NOT: call spir_func void @testInlineFn
17+ ; CHECK: ret void
18+
19+ ; CHECK-LABEL: @_ZTS28Kernel_B_Supposed_2B_Inlined(
20+ ; CHECK: call spir_func void @testInlineFn
21+ ; CHECK: call spir_func void @testInlineFn
22+ ; CHECK: ret void
23+
24+
25+ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024"
26+ target triple = "spir64-unknown-unknown"
27+
28+ define spir_kernel void @_ZTS28Kernel_A_Supposed_2B_Inlined () {
29+ call spir_func void @testInlineFn ()
30+ ret void
31+ }
32+
33+ define linkonce_odr spir_func void @testInlineFn () {
34+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
35+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
36+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
37+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
38+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
39+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
40+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
41+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
42+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
43+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
44+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
45+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
46+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
47+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
48+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
49+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
50+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
51+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
52+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
53+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
54+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
55+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
56+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
57+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
58+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
59+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
60+ call spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
61+ ret void
62+ }
63+
64+ declare spir_func void @_Z8mulAccumRP4DataRK5ColorS4_ ()
65+
66+ define spir_kernel void @_ZTS28Kernel_B_Supposed_2B_Inlined () {
67+ call spir_func void @testInlineFn ()
68+ call spir_func void @testInlineFn ()
69+ ret void
70+ }
71+
72+ ; uselistorder directives
73+ uselistorder void ()* @_Z8mulAccumRP4DataRK5ColorS4_ , { 26 , 25 , 24 , 23 , 22 , 21 , 20 , 19 , 18 , 17 , 16 , 15 , 14 , 13 , 12 , 11 , 10 , 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 , 0 }
0 commit comments