File: struct-ret-byval.ll

package info (click to toggle)
intel-graphics-compiler2 2.24.13-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 113,504 kB
  • sloc: cpp: 812,849; lisp: 288,219; ansic: 102,423; python: 4,010; yacc: 2,588; lex: 1,666; pascal: 318; sh: 162; makefile: 38
file content (33 lines) | stat: -rw-r--r-- 1,539 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
;=========================== begin_copyright_notice ============================
;
; Copyright (C) 2025 Intel Corporation
;
; SPDX-License-Identifier: MIT
;
;============================ end_copyright_notice =============================
;
; RUN: igc_opt --opaque-pointers --igc-legalize-function-signatures -S < %s 2>&1 | FileCheck %s
; ------------------------------------------------
; LegalizeFunctionSignatures
; ------------------------------------------------

%struct = type {float, float}


; CHECK: define spir_func %struct @func()
define spir_func %struct @func() {
  ; CHECK: [[TMP1:%.*]] = alloca %struct, align 8, addrspace(4)
  ; CHECK: store %struct { float {{[0-9].[0-9]+e\+[0-9]+}}, float {{[0-9].[0-9]+e\+[0-9]+}} }, ptr addrspace(4) [[TMP1]]
  ; CHECK: [[TMP2:%.*]] = load %struct, ptr addrspace(4) [[TMP1]], align 8
  ; CHECK: [[TMP3:%.*]] = getelementptr inbounds %struct, ptr addrspace(4) [[TMP1]], i32 0, i32 0
  ; CHECK: [[TMP4:%.*]] = load float, ptr addrspace(4) [[TMP3]], align 4
  ; CHECK: [[TMP5:%.*]] = insertvalue %struct undef, float [[TMP4]], 0
  ; CHECK: [[TMP6:%.*]] = getelementptr inbounds %struct, ptr addrspace(4) [[TMP1]], i32 0, i32 1
  ; CHECK: [[TMP7:%.*]] = load float, ptr addrspace(4) [[TMP6]], align 4
  ; CHECK: [[TMP8:%.*]] = insertvalue %struct [[TMP5]], float [[TMP7]], 1
  ; CHECK: ret %struct [[TMP8]]
  %1 = alloca %struct, align 8, addrspace(4)
  store %struct {float 1.0, float 2.0}, ptr addrspace(4) %1, align 8
  %2 = load %struct, ptr addrspace(4) %1, align 8
  ret %struct %2
}