livevars-crash2.mir
6.75 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# RUN: llc -mtriple powerpc64le-unknown-linux-gnu %s -o - 2>&1 \
# RUN: -run-pass=livevars,phi-node-elimination -verify-machineinstrs | \
# RUN: FileCheck %s
--- |
define float @testfloatslt(float %c1, float %c2, float %c3, float %c4, float %a1, float %a2) {
entry:
%cmp1 = fcmp oeq float %c3, %c4
%cmp3tmp = fcmp oeq float %c1, %c2
%cmp3 = icmp slt i1 %cmp3tmp, %cmp1
%cond = select i1 %cmp3, float %a1, float %a2
ret float %cond
}
define signext i32 @select-i1-vs-i1(i8** nocapture dereferenceable(8) %p) #0 {
entry:
%.pre = load i8*, i8** %p, align 8
br label %loop
loop: ; preds = %loop, %if.then3, %entry
%0 = phi i8* [ %.pre, %entry ], [ %incdec.ptr4, %if.then3 ], [ %incdec.ptr, %loop ]
%1 = load i8, i8* %0, align 1
%tobool = icmp eq i8 %1, 0
%incdec.ptr = getelementptr inbounds i8, i8* %0, i64 1
store i8* %incdec.ptr, i8** %p, align 8
%2 = load i8, i8* %incdec.ptr, align 1
%tobool2 = icmp ne i8 %2, 0
%or.cond = and i1 %tobool, %tobool2
br i1 %or.cond, label %if.then3, label %loop
if.then3: ; preds = %loop
%incdec.ptr4 = getelementptr inbounds i8, i8* %0, i64 2
store i8* %incdec.ptr4, i8** %p, align 8
br label %loop
}
...
---
name: testfloatslt
tracksRegLiveness: true
registers:
- { id: 0, class: f4rc, preferred-register: '' }
- { id: 1, class: f4rc, preferred-register: '' }
- { id: 2, class: f4rc, preferred-register: '' }
- { id: 3, class: f4rc, preferred-register: '' }
- { id: 4, class: f4rc, preferred-register: '' }
- { id: 5, class: f4rc, preferred-register: '' }
- { id: 6, class: crrc, preferred-register: '' }
- { id: 7, class: crbitrc, preferred-register: '' }
- { id: 8, class: crrc, preferred-register: '' }
- { id: 9, class: crbitrc, preferred-register: '' }
- { id: 10, class: crbitrc, preferred-register: '' }
- { id: 11, class: f4rc, preferred-register: '' }
liveins:
- { reg: '$f1', virtual-reg: '%0' }
- { reg: '$f2', virtual-reg: '%1' }
- { reg: '$f3', virtual-reg: '%2' }
- { reg: '$f4', virtual-reg: '%3' }
- { reg: '$f5', virtual-reg: '%4' }
- { reg: '$f6', virtual-reg: '%5' }
body: |
bb.0.entry:
successors: %bb.2(0x20000000), %bb.1(0x60000000)
liveins: $f1, $f2, $f3, $f4, $f5, $f6
%5:f4rc = COPY killed $f6
%4:f4rc = COPY killed $f5
%3:f4rc = COPY killed $f4
%2:f4rc = COPY killed $f3
%1:f4rc = COPY killed $f2
%0:f4rc = COPY killed $f1
%6:crrc = FCMPUS killed %2, killed %3
%7:crbitrc = COPY killed %6.sub_eq
BC killed %7, %bb.2
B %bb.1
bb.1.entry:
successors: %bb.2(0x2aaaaaab), %bb.3(0x55555555)
%8:crrc = FCMPUS killed %0, killed %1
%9:crbitrc = COPY killed %8.sub_eq
BC killed %9, %bb.3
bb.2.entry:
successors: %bb.3(0x80000000)
bb.3.entry:
%11:f4rc = PHI %5, %bb.2, %4, %bb.1
$f1 = COPY killed %11
BLR8 implicit $lr8, implicit $rm, implicit killed $f1
...
---
name: select-i1-vs-i1
alignment: 16
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
failedISel: false
tracksRegLiveness: true
hasWinCFI: false
registers:
- { id: 0, class: g8rc, preferred-register: '' }
- { id: 1, class: g8rc_and_g8rc_nox0, preferred-register: '' }
- { id: 2, class: g8rc, preferred-register: '' }
- { id: 3, class: g8rc, preferred-register: '' }
- { id: 4, class: g8rc_and_g8rc_nox0, preferred-register: '' }
- { id: 5, class: gprc, preferred-register: '' }
- { id: 6, class: crrc, preferred-register: '' }
- { id: 7, class: crbitrc, preferred-register: '' }
- { id: 8, class: gprc, preferred-register: '' }
- { id: 9, class: crrc, preferred-register: '' }
- { id: 10, class: crbitrc, preferred-register: '' }
- { id: 11, class: crbitrc, preferred-register: '' }
liveins:
- { reg: '$x3', virtual-reg: '%4' }
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 0
offsetAdjustment: 0
maxAlignment: 1
adjustsStack: false
hasCalls: false
stackProtector: ''
maxCallFrameSize: 4294967295
cvBytesOfCalleeSavedRegisters: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
localFrameSize: 0
savePoint: ''
restorePoint: ''
fixedStack: []
stack: []
callSites: []
constants: []
machineFunctionInfo: {}
body: |
bb.0.entry:
successors: %bb.1(0x80000000)
liveins: $x3
%4:g8rc_and_g8rc_nox0 = COPY killed $x3
%0:g8rc = LD 0, %4 :: (dereferenceable load 8 from %ir.p)
bb.1.loop:
successors: %bb.1(0x20000000), %bb.2(0x60000000)
%1:g8rc_and_g8rc_nox0 = PHI %0, %bb.0, %2, %bb.1, %3, %bb.3, %2, %bb.2
%5:gprc = LBZ 0, %1 :: (load 1 from %ir.0)
%6:crrc = CMPWI killed %5, 0
%7:crbitrc = COPY killed %6.sub_eq
%2:g8rc = nuw ADDI8 %1, 1
STD %2, 0, %4 :: (store 8 into %ir.p)
%8:gprc = LBZ 1, %1 :: (load 1 from %ir.incdec.ptr)
BCn killed %7, %bb.1
B %bb.2
bb.2.loop:
successors: %bb.3(0x55555555), %bb.1(0x2aaaaaab)
%9:crrc = CMPWI killed %8, 0
%10:crbitrc = COPY killed %9.sub_eq
BC killed %10, %bb.1
B %bb.3
bb.3.if.then3:
successors: %bb.1(0x80000000)
%3:g8rc = nuw ADDI8 killed %1, 2
STD %3, 0, %4 :: (store 8 into %ir.p)
B %bb.1
; CHECK-LABEL: name: testfloatslt
; CHECK: bb.0.entry:
; CHECK: successors: %bb.1(0x80000000)
; CHECK: liveins: $x3
; CHECK: %4:g8rc_and_g8rc_nox0 = COPY killed $x3
; CHECK: %0:g8rc = LD 0, %4 :: (dereferenceable load 8 from %ir.p)
; CHECK: %12:g8rc_and_g8rc_nox0 = COPY killed %0
; CHECK: bb.1.loop:
; CHECK: successors: %bb.1(0x20000000), %bb.2(0x60000000)
; CHECK: %1:g8rc_and_g8rc_nox0 = COPY killed %12
; CHECK: %5:gprc = LBZ 0, %1 :: (load 1 from %ir.0)
; CHECK: %6:crrc = CMPWI killed %5, 0
; CEHCK: %7:crbitrc = COPY killed %6.sub_eq
; CHECK: %2:g8rc = nuw ADDI8 %1, 1
; CHECK: STD %2, 0, %4 :: (store 8 into %ir.p)
; CHECK: %8:gprc = LBZ 1, %1 :: (load 1 from %ir.incdec.ptr)
; CHECK: %12:g8rc_and_g8rc_nox0 = COPY %2
; CHECK: BCn killed %7, %bb.1
; CHECK: B %bb.2
; CHECK: bb.2.loop:
; CHECK: successors: %bb.3(0x55555555), %bb.1(0x2aaaaaab)
; CHECK: %9:crrc = CMPWI killed %8, 0
; CHECK: %10:crbitrc = COPY killed %9.sub_eq
; CHECK: %12:g8rc_and_g8rc_nox0 = COPY killed %2
; CHECK: BC killed %10, %bb.1
; CHECK: B %bb.3
; CHECK: bb.3.if.then3:
; CHECK: successors: %bb.1(0x80000000)
; CHECK: %3:g8rc = nuw ADDI8 killed %1, 2
; CHECK: STD %3, 0, %4 :: (store 8 into %ir.p)
; CHECK: %12:g8rc_and_g8rc_nox0 = COPY killed %3
; CHECK: B %bb.1
...