1 # RUN: llc -mtriple powerpc64le-unknown-linux-gnu %s -o - 2>&1 \
2 # RUN: -run-pass=livevars,phi-node-elimination -verify-machineinstrs | \
6 define float @testfloatslt(float %c1, float %c2, float %c3, float %c4, float %a1, float %a2) {
8 %cmp1 = fcmp oeq float %c3, %c4
9 %cmp3tmp = fcmp oeq float %c1, %c2
10 %cmp3 = icmp slt i1 %cmp3tmp, %cmp1
11 %cond = select i1 %cmp3, float %a1, float %a2
15 define signext i32 @select-i1-vs-i1(ptr nocapture dereferenceable(8) %p) #0 {
17 %.pre = load ptr, ptr %p, align 8
20 loop: ; preds = %loop, %if.then3, %entry
21 %0 = phi ptr [ %.pre, %entry ], [ %incdec.ptr4, %if.then3 ], [ %incdec.ptr, %loop ]
22 %1 = load i8, ptr %0, align 1
23 %tobool = icmp eq i8 %1, 0
24 %incdec.ptr = getelementptr inbounds i8, ptr %0, i64 1
25 store ptr %incdec.ptr, ptr %p, align 8
26 %2 = load i8, ptr %incdec.ptr, align 1
27 %tobool2 = icmp ne i8 %2, 0
28 %or.cond = and i1 %tobool, %tobool2
29 br i1 %or.cond, label %if.then3, label %loop
31 if.then3: ; preds = %loop
32 %incdec.ptr4 = getelementptr inbounds i8, ptr %0, i64 2
33 store ptr %incdec.ptr4, ptr %p, align 8
40 tracksRegLiveness: true
42 - { id: 0, class: f4rc, preferred-register: '' }
43 - { id: 1, class: f4rc, preferred-register: '' }
44 - { id: 2, class: f4rc, preferred-register: '' }
45 - { id: 3, class: f4rc, preferred-register: '' }
46 - { id: 4, class: f4rc, preferred-register: '' }
47 - { id: 5, class: f4rc, preferred-register: '' }
48 - { id: 6, class: crrc, preferred-register: '' }
49 - { id: 7, class: crbitrc, preferred-register: '' }
50 - { id: 8, class: crrc, preferred-register: '' }
51 - { id: 9, class: crbitrc, preferred-register: '' }
52 - { id: 10, class: crbitrc, preferred-register: '' }
53 - { id: 11, class: f4rc, preferred-register: '' }
55 - { reg: '$f1', virtual-reg: '%0' }
56 - { reg: '$f2', virtual-reg: '%1' }
57 - { reg: '$f3', virtual-reg: '%2' }
58 - { reg: '$f4', virtual-reg: '%3' }
59 - { reg: '$f5', virtual-reg: '%4' }
60 - { reg: '$f6', virtual-reg: '%5' }
63 successors: %bb.2(0x20000000), %bb.1(0x60000000)
64 liveins: $f1, $f2, $f3, $f4, $f5, $f6
66 %5:f4rc = COPY killed $f6
67 %4:f4rc = COPY killed $f5
68 %3:f4rc = COPY killed $f4
69 %2:f4rc = COPY killed $f3
70 %1:f4rc = COPY killed $f2
71 %0:f4rc = COPY killed $f1
72 %6:crrc = FCMPUS killed %2, killed %3
73 %7:crbitrc = COPY killed %6.sub_eq
78 successors: %bb.2(0x2aaaaaab), %bb.3(0x55555555)
80 %8:crrc = FCMPUS killed %0, killed %1
81 %9:crbitrc = COPY killed %8.sub_eq
85 successors: %bb.3(0x80000000)
89 %11:f4rc = PHI %5, %bb.2, %4, %bb.1
91 BLR8 implicit $lr8, implicit $rm, implicit killed $f1
97 exposesReturnsTwice: false
99 regBankSelected: false
102 tracksRegLiveness: true
105 - { id: 0, class: g8rc, preferred-register: '' }
106 - { id: 1, class: g8rc_and_g8rc_nox0, preferred-register: '' }
107 - { id: 2, class: g8rc, preferred-register: '' }
108 - { id: 3, class: g8rc, preferred-register: '' }
109 - { id: 4, class: g8rc_and_g8rc_nox0, preferred-register: '' }
110 - { id: 5, class: gprc, preferred-register: '' }
111 - { id: 6, class: crrc, preferred-register: '' }
112 - { id: 7, class: crbitrc, preferred-register: '' }
113 - { id: 8, class: gprc, preferred-register: '' }
114 - { id: 9, class: crrc, preferred-register: '' }
115 - { id: 10, class: crbitrc, preferred-register: '' }
116 - { id: 11, class: crbitrc, preferred-register: '' }
118 - { reg: '$x3', virtual-reg: '%4' }
120 isFrameAddressTaken: false
121 isReturnAddressTaken: false
130 maxCallFrameSize: 4294967295
131 cvBytesOfCalleeSavedRegisters: 0
132 hasOpaqueSPAdjustment: false
134 hasMustTailInVarArgFunc: false
142 machineFunctionInfo: {}
145 successors: %bb.1(0x80000000)
148 %4:g8rc_and_g8rc_nox0 = COPY killed $x3
149 %0:g8rc = LD 0, %4 :: (dereferenceable load (s64) from %ir.p)
152 successors: %bb.1(0x20000000), %bb.2(0x60000000)
154 %1:g8rc_and_g8rc_nox0 = PHI %0, %bb.0, %2, %bb.1, %3, %bb.3, %2, %bb.2
155 %5:gprc = LBZ 0, %1 :: (load (s8) from %ir.0)
156 %6:crrc = CMPWI killed %5, 0
157 %7:crbitrc = COPY killed %6.sub_eq
158 %2:g8rc = nuw ADDI8 %1, 1
159 STD %2, 0, %4 :: (store (s64) into %ir.p)
160 %8:gprc = LBZ 1, %1 :: (load (s8) from %ir.incdec.ptr)
165 successors: %bb.3(0x55555555), %bb.1(0x2aaaaaab)
167 %9:crrc = CMPWI killed %8, 0
168 %10:crbitrc = COPY killed %9.sub_eq
173 successors: %bb.1(0x80000000)
175 %3:g8rc = nuw ADDI8 killed %1, 2
176 STD %3, 0, %4 :: (store (s64) into %ir.p)
179 ; CHECK-LABEL: name: testfloatslt
181 ; CHECK: successors: %bb.1(0x80000000)
182 ; CHECK: liveins: $x3
184 ; CHECK: %4:g8rc_and_g8rc_nox0 = COPY killed $x3
185 ; CHECK: %0:g8rc = LD 0, %4 :: (dereferenceable load (s64) from %ir.p)
186 ; CHECK: %12:g8rc_and_g8rc_nox0 = COPY killed %0
189 ; CHECK: successors: %bb.1(0x20000000), %bb.2(0x60000000)
191 ; CHECK: %1:g8rc_and_g8rc_nox0 = COPY killed %12
192 ; CHECK: %5:gprc = LBZ 0, %1 :: (load (s8) from %ir.0)
193 ; CHECK: %6:crrc = CMPWI killed %5, 0
194 ; CHECK: %7:crbitrc = COPY killed %6.sub_eq
195 ; CHECK: %2:g8rc = nuw ADDI8 %1, 1
196 ; CHECK: STD %2, 0, %4 :: (store (s64) into %ir.p)
197 ; CHECK: %8:gprc = LBZ 1, %1 :: (load (s8) from %ir.incdec.ptr)
198 ; CHECK: %12:g8rc_and_g8rc_nox0 = COPY %2
199 ; CHECK: BCn killed %7, %bb.1
203 ; CHECK: successors: %bb.3(0x55555555), %bb.1(0x2aaaaaab)
205 ; CHECK: %9:crrc = CMPWI killed %8, 0
206 ; CHECK: %10:crbitrc = COPY killed %9.sub_eq
207 ; CHECK: %12:g8rc_and_g8rc_nox0 = COPY killed %2
208 ; CHECK: BC killed %10, %bb.1
211 ; CHECK: bb.3.if.then3:
212 ; CHECK: successors: %bb.1(0x80000000)
214 ; CHECK: %3:g8rc = nuw ADDI8 killed %1, 2
215 ; CHECK: STD %3, 0, %4 :: (store (s64) into %ir.p)
216 ; CHECK: %12:g8rc_and_g8rc_nox0 = COPY killed %3