annotate test/CodeGen/SystemZ/trap-03.ll @ 128:c347d3398279 default tip

fix
author mir3636
date Wed, 06 Dec 2017 14:37:17 +0900
parents 803732b1fca8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 ; Test load-and-trap instructions (LAT/LGAT)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2 ;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=zEC12 | FileCheck %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 declare void @llvm.trap()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 ; Check LAT with no displacement.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8 define i32 @f1(i32 *%ptr) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 ; CHECK-LABEL: f1:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10 ; CHECK: lat %r2, 0(%r2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12 entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 %val = load i32, i32 *%ptr
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 %cmp = icmp eq i32 %val, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 br i1 %cmp, label %if.then, label %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 if.then: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 tail call void @llvm.trap()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19 unreachable
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 if.end: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22 ret i32 %val
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 ; Check the high end of the LAT range.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26 define i32 @f2(i32 *%src) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 ; CHECK-LABEL: f2:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 ; CHECK: lat %r2, 524284(%r2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30 %ptr = getelementptr i32, i32 *%src, i64 131071
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31 %val = load i32, i32 *%ptr
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 %cmp = icmp eq i32 %val, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33 br i1 %cmp, label %if.then, label %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35 if.then: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 tail call void @llvm.trap()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 unreachable
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39 if.end: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 ret i32 %val
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 ; Check the next word up, which needs separate address logic.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44 ; Other sequences besides this one would be OK.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45 define i32 @f3(i32 *%src) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46 ; CHECK-LABEL: f3:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 ; CHECK: agfi %r2, 524288
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48 ; CHECK: lat %r2, 0(%r2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50 %ptr = getelementptr i32, i32 *%src, i64 131072
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51 %val = load i32, i32 *%ptr
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 %cmp = icmp eq i32 %val, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53 br i1 %cmp, label %if.then, label %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
55 if.then: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
56 tail call void @llvm.trap()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
57 unreachable
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
58
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
59 if.end: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
60 ret i32 %val
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
61 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
62
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
63 ; Check that LAT allows an index.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
64 define i32 @f4(i64 %src, i64 %index) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
65 ; CHECK-LABEL: f4:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
66 ; CHECK: lat %r2, 524287(%r3,%r2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
67 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
68 %add1 = add i64 %src, %index
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
69 %add2 = add i64 %add1, 524287
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
70 %ptr = inttoptr i64 %add2 to i32 *
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
71 %val = load i32, i32 *%ptr
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
72 %cmp = icmp eq i32 %val, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
73 br i1 %cmp, label %if.then, label %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
74
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
75 if.then: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
76 tail call void @llvm.trap()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
77 unreachable
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
78
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
79 if.end: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
80 ret i32 %val
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
81 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
82
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
83 ; Check LGAT with no displacement.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
84 define i64 @f5(i64 *%ptr) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
85 ; CHECK-LABEL: f5:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
86 ; CHECK: lgat %r2, 0(%r2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
87 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
88 entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
89 %val = load i64, i64 *%ptr
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
90 %cmp = icmp eq i64 %val, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
91 br i1 %cmp, label %if.then, label %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
92
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
93 if.then: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
94 tail call void @llvm.trap()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
95 unreachable
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
96
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
97 if.end: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
98 ret i64 %val
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
99 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
100
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
101 ; Check the high end of the LGAT range.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
102 define i64 @f6(i64 *%src) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
103 ; CHECK-LABEL: f6:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
104 ; CHECK: lgat %r2, 524280(%r2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
105 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
106 %ptr = getelementptr i64, i64 *%src, i64 65535
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
107 %val = load i64, i64 *%ptr
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
108 %cmp = icmp eq i64 %val, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
109 br i1 %cmp, label %if.then, label %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
110
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
111 if.then: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
112 tail call void @llvm.trap()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
113 unreachable
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
114
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
115 if.end: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
116 ret i64 %val
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
117 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
118
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
119 ; Check the next word up, which needs separate address logic.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
120 ; Other sequences besides this one would be OK.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
121 define i64 @f7(i64 *%src) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
122 ; CHECK-LABEL: f7:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
123 ; CHECK: agfi %r2, 524288
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
124 ; CHECK: lgat %r2, 0(%r2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
125 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
126 %ptr = getelementptr i64, i64 *%src, i64 65536
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
127 %val = load i64, i64 *%ptr
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
128 %cmp = icmp eq i64 %val, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
129 br i1 %cmp, label %if.then, label %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
130
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
131 if.then: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
132 tail call void @llvm.trap()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
133 unreachable
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
134
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
135 if.end: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
136 ret i64 %val
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
137 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
138
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
139 ; Check that LGAT allows an index.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
140 define i64 @f8(i64 %src, i64 %index) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
141 ; CHECK-LABEL: f8:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
142 ; CHECK: lgat %r2, 524287(%r3,%r2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
143 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
144 %add1 = add i64 %src, %index
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
145 %add2 = add i64 %add1, 524287
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
146 %ptr = inttoptr i64 %add2 to i64 *
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
147 %val = load i64, i64 *%ptr
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
148 %cmp = icmp eq i64 %val, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
149 br i1 %cmp, label %if.then, label %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
150
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
151 if.then: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
152 tail call void @llvm.trap()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
153 unreachable
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
154
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
155 if.end: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
156 ret i64 %val
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
157 }