File: simplification.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 (70 lines) | stat: -rw-r--r-- 4,204 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
;=========================== begin_copyright_notice ============================
;
; Copyright (C) 2021-2024 Intel Corporation
;
; SPDX-License-Identifier: MIT
;
;============================ end_copyright_notice =============================

; RUN: %opt_typed_ptrs %use_old_pass_manager% -GenXStructSplitter -vc-struct-splitting=1 -march=genx64 -mcpu=Gen9 -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK-TYPED-PTRS
; RUN: %opt_opaque_ptrs %use_old_pass_manager% -GenXStructSplitter -vc-struct-splitting=1 -march=genx64 -mcpu=Gen9 -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK-OPAQUE-PTRS

; CHECK-DAG: %[[A_F:[^ ]+]] = type { float, float }
; CHECK-DAG: %[[C_I:[^ ]+]] = type { i32, i32 }
%struct.C = type { %struct.A, i32 }
%struct.A = type { i32, float, float }

; Function Attrs: noinline norecurse nounwind optnone uwtable
define dllexport spir_kernel void @main() #1 {
entry:
  ; CHECK-DAG: %[[C_F_AL:[^ ]+]] = alloca %[[A_F]], align 4
  ; CHECK-DAG: %[[C_I_AL:[^ ]+]] = alloca %[[C_I]], align 4
  ; CHECK-DAG: %[[A_F_AL:[^ ]+]] = alloca %[[A_F]], align 4
  ; CHECK-DAG: %[[A_I_AL:[^ ]+]] = alloca i32, align 4
  %C = alloca %struct.C, align 4
  %A = alloca %struct.A, align 4

  ; CHECK-TYPED-PTRS: %[[I2:[^ ]+]] = getelementptr %[[C_I]], %[[C_I]]* %[[C_I_AL]], i32 0, i32 0
  ; CHECK-TYPED-PTRS: %[[I3:[^ ]+]] = getelementptr %[[C_I]], %[[C_I]]* %[[C_I_AL]], i32 0, i32 1
  ; CHECK-TYPED-PTRS: %[[U_I1:[^ ]+]] = ptrtoint i32* %[[A_I_AL]] to i64
  ; CHECK-TYPED-PTRS: %[[U_I2:[^ ]+]] = ptrtoint i32* %[[I2]] to i64
  ; CHECK-TYPED-PTRS: %[[U_I3:[^ ]+]] = ptrtoint i32* %[[I3]] to i64
  ; CHECK-OPAQUE-PTRS: %[[I2:[^ ]+]] = getelementptr %[[C_I]], ptr %[[C_I_AL]], i32 0, i32 0
  ; CHECK-OPAQUE-PTRS: %[[I3:[^ ]+]] = getelementptr %[[C_I]], ptr %[[C_I_AL]], i32 0, i32 1
  ; CHECK-OPAQUE-PTRS: %[[U_I1:[^ ]+]] = ptrtoint ptr %[[A_I_AL]] to i64
  ; CHECK-OPAQUE-PTRS: %[[U_I2:[^ ]+]] = ptrtoint ptr %[[I2]] to i64
  ; CHECK-OPAQUE-PTRS: %[[U_I3:[^ ]+]] = ptrtoint ptr %[[I3]] to i64
  %i1 = getelementptr inbounds %struct.A, %struct.A* %A, i32 0, i32 0
  %i2 = getelementptr inbounds %struct.C, %struct.C* %C, i32 0, i32 0, i32 0
  %i3 = getelementptr inbounds %struct.C, %struct.C* %C, i32 0, i32 1
  %user_of_i1 = ptrtoint i32* %i1 to i64
  %user_of_i2 = ptrtoint i32* %i2 to i64
  %user_of_i3 = ptrtoint i32* %i3 to i64

  ; CHECK-TYPED-PTRS: %[[A_I:[^ ]+]] = getelementptr %[[C_I]], %[[C_I]]* %[[C_I_AL]], i32 0, i32 0
  ; CHECK-TYPED-PTRS: %[[U_A_F:[^ ]+]] = getelementptr %[[A_F]], %[[A_F]]* %[[C_F_AL]], i32 0, i32 1
  ; CHECK-TYPED-PTRS: %[[U_A_I:[^ ]+]] = ptrtoint i32* %[[A_I]] to i64
  ; CHECK-OPAQUE-PTRS: %[[A_I:[^ ]+]] = getelementptr %[[C_I]], ptr %[[C_I_AL]], i32 0, i32 0
  ; CHECK-OPAQUE-PTRS: %[[U_A_F:[^ ]+]] = getelementptr %[[A_F]], ptr %[[C_F_AL]], i32 0, i32 1
  ; CHECK-OPAQUE-PTRS: %[[U_A_I:[^ ]+]] = ptrtoint ptr %[[A_I]] to i64
  %a = getelementptr inbounds %struct.C, %struct.C* %C, i32 0, i32 0
  %user_of_af = getelementptr inbounds %struct.A, %struct.A* %a, i32 0, i32 2
  %ai = getelementptr inbounds %struct.A, %struct.A* %a, i32 0, i32 0
  %user_of_ai = ptrtoint i32* %ai to i64

  ; CHECK-TYPED-PTRS: %[[F1:[^ ]+]] = getelementptr %[[A_F]], %[[A_F]]* %[[A_F_AL]], i32 0, i32 0
  ; CHECK-TYPED-PTRS: %[[F2:[^ ]+]] = getelementptr %[[A_F]], %[[A_F]]* %[[A_F_AL]], i32 0, i32 1
  ; CHECK-OPAQUE-PTRS: %[[F1:[^ ]+]] = getelementptr %[[A_F]], ptr %[[A_F_AL]], i32 0, i32 0
  ; CHECK-OPAQUE-PTRS: %[[F2:[^ ]+]] = getelementptr %[[A_F]], ptr %[[A_F_AL]], i32 0, i32 1
  %f1 = getelementptr inbounds %struct.A, %struct.A* %A, i32 0, i32 1
  %f2 = getelementptr inbounds %struct.A, %struct.A* %A, i32 0, i32 2

  ; CHECK-TYPED-PTRS: %[[F3:[^ ]+]] = getelementptr %[[A_F]], %[[A_F]]* %[[C_F_AL]], i32 0, i32 0
  ; CHECK-TYPED-PTRS: %[[F4:[^ ]+]] = getelementptr %[[A_F]], %[[A_F]]* %[[C_F_AL]], i32 0, i32 1
  ; CHECK-OPAQUE-PTRS: %[[F3:[^ ]+]] = getelementptr %[[A_F]], ptr %[[C_F_AL]], i32 0, i32 0
  ; CHECK-OPAQUE-PTRS: %[[F4:[^ ]+]] = getelementptr %[[A_F]], ptr %[[C_F_AL]], i32 0, i32 1
  %f3 = getelementptr inbounds %struct.C, %struct.C* %C, i32 0, i32 0, i32 1
  %f4 = getelementptr inbounds %struct.C, %struct.C* %C, i32 0, i32 0, i32 2

  ret void
}