File: stack_test.ll

package info (click to toggle)
intel-graphics-compiler2 2.20.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 107,552 kB
  • sloc: cpp: 807,012; lisp: 287,936; ansic: 16,397; python: 4,010; yacc: 2,588; lex: 1,666; pascal: 313; sh: 186; makefile: 37
file content (91 lines) | stat: -rw-r--r-- 2,476 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
;=========================== begin_copyright_notice ============================
;
; Copyright (C) 2021-2025 Intel Corporation
;
; SPDX-License-Identifier: MIT
;
;============================ end_copyright_notice =============================

; RUN: %opt_typed_ptrs %use_old_pass_manager% -dbgonly-enforce-privmem-stateless=128 -GenXStackUsage -march=genx64 \
; RUN: -stack-analysis -mcpu=Gen9 -S %s -disable-output 2>&1 | FileCheck %s
; RUN: %opt_opaque_ptrs %use_old_pass_manager% -dbgonly-enforce-privmem-stateless=128 -GenXStackUsage -march=genx64 \
; RUN: -stack-analysis -mcpu=Gen9 -S %s -disable-output 2>&1 | FileCheck %s
; CHECK: 1152
; CHECK: 1152
; CHECK: 720
; CHECK: 432
; CHECK: 408

source_filename = "main.c"
target datalayout = "e-p:64:64-i64:64-n8:16:32:64"
target triple = "x86_64-pc-linux-gnu"

%struct._b128 = type { i32, [3 x i32] }
%struct._b1024 = type { [4 x %struct._b128], [16 x float] }
%struct._b2048 = type { %struct._b1024, [16 x float], [2 x %struct._b128], [8 x i32] }

define internal spir_func void @f128() {
  %1 = alloca %struct._b128, align 4
  ret void
}

define internal spir_func void @f512() {
  %1 = alloca [4 x %struct._b128], align 16
  ret void
}

define internal spir_func void @f1024() {
  %1 = alloca %struct._b1024, align 4
  ret void
}

define internal spir_func void @f1536() {
  %1 = alloca %struct._b1024, align 4
  %2 = alloca [4 x %struct._b128], align 16
  ret void
}

define internal spir_func void @f3200() {
  %1 = alloca %struct._b128, align 4
  %2 = alloca %struct._b1024, align 4
  %3 = alloca %struct._b2048, align 4
  ret void
}

define internal spir_func void @sum() {
  %1 = alloca %struct._b128, align 4
  call spir_func void @f3200()
  call spir_func void @f128()
  ret void
}

; Function Attrs: noinline nounwind optnone uwtable
define internal spir_func void @mul() {
  %1 = alloca %struct._b2048, align 32
  call spir_func void @f1024()
  call spir_func void @sum()
  call spir_func void @f1536()
  call spir_func void @f512()
  ret void
}

define internal spir_func void @kernel() {
  %1 = alloca %struct._b128, align 4
  %2 = alloca %struct._b1024, align 16
  %3 = alloca %struct._b2048, align 4
  %4 = alloca <2 x i64>
  call spir_func void @sum()
  call spir_func void @mul()
  call spir_func void @sum()
  ret void
}

define dllexport spir_kernel void @main() #0 {
  call spir_func void @kernel()
  ret void
}

attributes #0 = { "CMGenxMain" }

!genx.kernel.internal = !{!0}
!0 = !{void ()* @main}