File: basic.ll

package info (click to toggle)
intel-graphics-compiler2 2.16.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 106,644 kB
  • sloc: cpp: 805,640; lisp: 287,672; ansic: 16,414; python: 3,952; yacc: 2,588; lex: 1,666; pascal: 313; sh: 186; makefile: 35
file content (57 lines) | stat: -rw-r--r-- 2,288 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
;=========================== begin_copyright_notice ============================
;
; Copyright (C) 2022 Intel Corporation
;
; SPDX-License-Identifier: MIT
;
;============================ end_copyright_notice =============================
;
; RUN: igc_opt --typed-pointers -enable-debugify  -igc-resolve-inline-locals -S < %s 2>&1 | FileCheck %s
; ------------------------------------------------
; InlineLocalsResolution
; ------------------------------------------------
; Reduced from OCL kernel, with changed global variable @a addrspace:
;
; static __global int* a;
; static __global int* b;
; __kernel void test_inline(global int * table)
; {
;  int wg = work_group_any(table[0]);
;  a[0] = wg;
;  b[0] = wg;
; }
;
; ------------------------------------------------

; Debug-info related check
; CHECK-NOT: WARNING
; CHECK: CheckModuleDebugify: PASS

; CHECK: @a = {{.*}}, section "localSLM",
@a = external dso_local addrspace(3) global i32 addrspace(3)*, align 8

define spir_kernel void @test_inline() {
entry:
; CHECK-LABEL: @test_inline(
; CHECK:    [[WG:%.*]] = alloca i32, align 4
; CHECK:    [[MEMPOOLCAST:%.*]] = bitcast [4 x i8] addrspace(3)* @GenSLM.LocalMemPoolOnGetMemPoolPtr to i8 addrspace(3)*
; CHECK:    [[TMP3:%.*]] = bitcast i8 addrspace(3)* [[MEMPOOLCAST]] to i32 addrspace(3)*
; CHECK:    store i32 0, i32 addrspace(3)* [[TMP3]], align 4
; CHECK:    [[TMP5:%.*]] = load i32, i32* [[WG]], align 4
; CHECK:    [[TMP6:%.*]] = load i32 addrspace(3)*, i32 addrspace(3)* addrspace(3)* @a, align 8
; CHECK:    [[ARRAYIDX1:%.*]] = getelementptr inbounds i32, i32 addrspace(3)* [[TMP6]], i64 0
; CHECK:    store i32 [[TMP5]], i32 addrspace(3)* [[ARRAYIDX1]], align 4
; CHECK:    ret void
  %wg = alloca i32, align 4
  %call.i = call spir_func i8 addrspace(3)* @__builtin_IB_AllocLocalMemPool(i1 false, i32 1, i32 4)
  %0 = bitcast i8 addrspace(3)* %call.i to i32 addrspace(3)*
  store i32 0, i32 addrspace(3)* %0, align 4
  %1 = load i32, i32* %wg, align 4
  %2 = load i32 addrspace(3)*, i32 addrspace(3)* addrspace(3)* @a, align 8
  %arrayidx1 = getelementptr inbounds i32, i32 addrspace(3)* %2, i64 0
  store i32 %1, i32 addrspace(3)* %arrayidx1, align 4
  ret void
}

declare spir_func i8 addrspace(3)* @__builtin_IB_AllocLocalMemPool(i1, i32, i32) local_unnamed_addr