File: element_order.ll

package info (click to toggle)
intel-graphics-compiler 1.0.17791.18-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 102,312 kB
  • sloc: cpp: 935,343; lisp: 286,143; ansic: 16,196; python: 3,279; yacc: 2,487; lex: 1,642; pascal: 300; sh: 174; makefile: 27
file content (46 lines) | stat: -rw-r--r-- 1,800 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
;=========================== begin_copyright_notice ============================
;
; Copyright (C) 2022 Intel Corporation
;
; SPDX-License-Identifier: MIT
;
;============================ end_copyright_notice =============================

; RUN: %opt %use_old_pass_manager% -GenXStructSplitter -vc-struct-splitting=1 -march=genx64 -mcpu=Gen9 -S < %s | FileCheck %s

; Order of elements in structure defines order of new instruction to be placed.
; Intermediate structure B_BS should be B_BS = type { Ai, Af, float }
%A = type { i32, float, i32, float }
%B = type { %A, float }

; Intermediate structure D_BS should be D_BS = type { Cf, Ci, int }
%C = type { float, i32, float, i32 }
%D = type { %C, i32 }

; CHECK-DAG:  %[[C_F:[^ ]+]] = type { float, float }
; CHECK-DAG:  %[[D_I:[^ ]+]] = type { %[[C_I:[^ ]+]], i32 }
; CHECK-DAG:  %[[C_I]] = type { i32, i32 }
; CHECK-DAG:  %[[A_I:[^ ]+]] = type { i32, i32 }
; CHECK-DAG:  %[[B_F:[^ ]+]] = type { %[[A_F:[^ ]+]], float }
; CHECK-DAG:  %[[A_F]] = type { float, float }

define dllexport spir_kernel void @order_test() #1 {
  ; CHECK:  %[[df:[^ ]+]] = alloca %[[C_F]]
  ; CHECK:  %[[di:[^ ]+]] = alloca %[[D_I]]
  %d = alloca %D, align 4

  ; CHECK:  %[[p:[^ ]+]] = getelementptr %[[D_I]], %[[D_I]]* %[[di]], i32 0, i32 0, i32 0
  ; CHECK:  %user_of_p = ptrtoint i32*  %[[p]] to i64
  %p = getelementptr inbounds %D, %D* %d, i32 0, i32 0, i32 1
  %user_of_p = ptrtoint i32* %p to i64

  ; CHECK:  %[[bi:[^ ]+]] = alloca %[[A_I]]
  ; CHECK:  %[[bf:[^ ]+]] = alloca %[[B_F]]
  %b = alloca %B, align 4
  ; CHECK:  %[[j:[^ ]+]] = getelementptr %[[A_I]], %[[A_I]]* %[[bi]], i32 0, i32 0
  ; CHECK:  %user_of_j = ptrtoint i32* %[[j]] to i64
  %j = getelementptr inbounds %B, %B* %b, i32 0, i32 0, i32 0
  %user_of_j = ptrtoint i32* %j to i64

  ret void
}