Debian Codegraph @

vc-intrinsics/GenXIntrinsics/test/Adaptors/opaque_ptrs/sev_struct.ll

raw
1 ;=========================== begin_copyright_notice ============================
2 ;
3 ; Copyright (C) 2024 Intel Corporation
4 ;
5 ; SPDX-License-Identifier: MIT
6 ;
7 ;============================ end_copyright_notice =============================
8
9 ; REQUIRES: opaque-pointers
10 ; RUN: opt -passes=GenXSPIRVWriterAdaptor -S < %s | FileCheck %s
11
12 target datalayout = "e-p:64:64-i64:64-n8:16:32"
13 target triple = "spir64"
14
15 ; CHECK: [[STRUCT1:[^ ]+]] = type { i32, <2 x i32>, [[STRUCT2:[^ ]+]] }
16 %struct.sev_test = type { <1 x i32>, <2 x i32>, %struct.sev_test_nested }
17 ; CHECK: [[STRUCT2]] = type { ptr, ptr, ptr }
18 %struct.sev_test_nested = type { ptr, ptr, ptr }
19
20 ; CHECK: define void @test(i32 "VCSingleElementVector"="0" %sev, ptr %ptr)
21 define void @test(<1 x i32> %sev, ptr %ptr) {
22 ; CHECK: %1 = alloca [[STRUCT1]], align 8
23 %1 = alloca %struct.sev_test, align 8
24 ; CHECK: %2 = getelementptr inbounds [[STRUCT1]], ptr %1, i32 0, i32 0
25 %2 = getelementptr inbounds %struct.sev_test, ptr %1, i32 0, i32 0
26 ; CHECK: store i32 %sev, ptr %2, align 4
27 store <1 x i32> %sev, ptr %2, align 4
28 ; CHECK: %3 = getelementptr inbounds [[STRUCT1]], ptr %1, i32 0, i32 2
29 %3 = getelementptr inbounds %struct.sev_test, ptr %1, i32 0, i32 2
30 ; CHECK: %4 = getelementptr inbounds [[STRUCT2]], ptr %3, i32 0, i32 0
31 %4 = getelementptr inbounds %struct.sev_test_nested, ptr %3, i32 0, i32 0
32 ; CHECK: store ptr %ptr, ptr %4, align 8
33 store ptr %ptr, ptr %4, align 8
34 ; CHECK: %5 = getelementptr inbounds [[STRUCT2]], ptr %3, i32 0, i32 2
35 %5 = getelementptr inbounds %struct.sev_test_nested, ptr %3, i32 0, i32 2
36 ; CHECK: store ptr %1, ptr %5, align 8
37 store ptr %1, ptr %5, align 8
38 ret void
39 }