File: store-undef.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (92 lines) | stat: -rw-r--r-- 3,018 bytes parent folder | download | duplicates (3)
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
; RUN: llc < %s -march=nvptx64 | FileCheck %s
; RUN: %if ptxas %{ llc < %s -march=nvptx64 | %ptxas-verify %}

target triple = "nvptx64-nvidia-cuda"

%struct.T = type { i64, <2 x i32>, <4 x i32> }

declare void @test_call(%struct.T)

define void @test_store_param_undef() {
; CHECK-LABEL: test_store_param_undef(
; CHECK:       {
; CHECK-EMPTY:
; CHECK-EMPTY:
; CHECK-NEXT:  // %bb.0:
; CHECK-NEXT:    { // callseq 0, 0
; CHECK-NEXT:    .param .align 16 .b8 param0[32];
; CHECK-NEXT:    call.uni
; CHECK-NEXT:    test_call,
; CHECK-NEXT:    (
; CHECK-NEXT:    param0
; CHECK-NEXT:    );
; CHECK-NEXT:    } // callseq 0
; CHECK-NEXT:    ret;
  call void @test_call(%struct.T undef)
  ret void
}

define void @test_store_param_def(i64 %param0, i32 %param1) {
; CHECK-LABEL: test_store_param_def(
; CHECK:       {
; CHECK-NEXT:    .reg .b32 %r<6>;
; CHECK-NEXT:    .reg .b64 %rd<2>;
; CHECK-EMPTY:
; CHECK-NEXT:  // %bb.0:
; CHECK-NEXT:    ld.param.u64 %rd1, [test_store_param_def_param_0];
; CHECK-NEXT:    ld.param.u32 %r1, [test_store_param_def_param_1];
; CHECK-NEXT:    { // callseq 1, 0
; CHECK-NEXT:    .param .align 16 .b8 param0[32];
; CHECK-NEXT:    st.param.b64 [param0+0], %rd1;
; CHECK-NEXT:    st.param.v2.b32 [param0+8], {%r2, %r1};
; CHECK-NEXT:    st.param.v4.b32 [param0+16], {%r3, %r1, %r4, %r5};
; CHECK-NEXT:    call.uni
; CHECK-NEXT:    test_call,
; CHECK-NEXT:    (
; CHECK-NEXT:    param0
; CHECK-NEXT:    );
; CHECK-NEXT:    } // callseq 1
; CHECK-NEXT:    ret;
  %V2 = insertelement <2 x i32> undef, i32 %param1, i32 1
  %V4 = insertelement <4 x i32> undef, i32 %param1, i32 1
  %S0 = insertvalue %struct.T undef, i64 %param0, 0
  %S1 = insertvalue %struct.T %S0, <2 x i32> %V2, 1
  %S2 = insertvalue %struct.T %S1, <4 x i32> %V4, 2
  call void @test_call(%struct.T %S2)
  ret void
}

define void @test_store_undef(ptr %out) {
; CHECK-LABEL: test_store_undef(
; CHECK:       {
; CHECK-EMPTY:
; CHECK-EMPTY:
; CHECK-NEXT:  // %bb.0:
; CHECK-NEXT:    ret;
  store %struct.T undef, ptr %out
  ret void
}

define void @test_store_def(i64 %param0, i32 %param1, ptr %out) {
; CHECK-LABEL: test_store_def(
; CHECK:       {
; CHECK-NEXT:    .reg .b32 %r<6>;
; CHECK-NEXT:    .reg .b64 %rd<3>;
; CHECK-EMPTY:
; CHECK-NEXT:  // %bb.0:
; CHECK-NEXT:    ld.param.u64 %rd1, [test_store_def_param_0];
; CHECK-NEXT:    ld.param.u32 %r1, [test_store_def_param_1];
; CHECK-NEXT:    ld.param.u64 %rd2, [test_store_def_param_2];
; CHECK-NEXT:    st.v4.u32 [%rd2+16], {%r2, %r1, %r3, %r4};
; CHECK-NEXT:    st.v2.u32 [%rd2+8], {%r5, %r1};
; CHECK-NEXT:    st.u64 [%rd2], %rd1;
; CHECK-NEXT:    ret;
  %V2 = insertelement <2 x i32> undef, i32 %param1, i32 1
  %V4 = insertelement <4 x i32> undef, i32 %param1, i32 1
  %S0 = insertvalue %struct.T undef, i64 %param0, 0
  %S1 = insertvalue %struct.T %S0, <2 x i32> %V2, 1
  %S2 = insertvalue %struct.T %S1, <4 x i32> %V4, 2
  store %struct.T %S2, ptr %out
  ret void
}