1 # RUN: llc -mtriple powerpc64le-unknown-linux-gnu %s -o - 2>&1 \
2 # RUN: -run-pass=livevars,phi-node-elimination -verify-machineinstrs | \
4 # RUN: llc -mtriple powerpc64le-unknown-linux-gnu %s -o - 2>&1 \
5 # RUN: --passes='require<live-vars>,phi-node-elimination' -verify-each | \
9 define float @testfloatslt(float %c1, float %c2, float %c3, float %c4, float %a1, float %a2) {
11 %cmp1 = fcmp oeq float %c3, %c4
12 %cmp3tmp = fcmp oeq float %c1, %c2
13 %cmp3 = icmp slt i1 %cmp3tmp, %cmp1
14 %cond = select i1 %cmp3, float %a1, float %a2
18 define signext i32 @select-i1-vs-i1(ptr nocapture dereferenceable(8) %p) #0 {
20 %.pre = load ptr, ptr %p, align 8
23 loop: ; preds = %loop, %if.then3, %entry
24 %0 = phi ptr [ %.pre, %entry ], [ %incdec.ptr4, %if.then3 ], [ %incdec.ptr, %loop ]
25 %1 = load i8, ptr %0, align 1
26 %tobool = icmp eq i8 %1, 0
27 %incdec.ptr = getelementptr inbounds i8, ptr %0, i64 1
28 store ptr %incdec.ptr, ptr %p, align 8
29 %2 = load i8, ptr %incdec.ptr, align 1
30 %tobool2 = icmp ne i8 %2, 0
31 %or.cond = and i1 %tobool, %tobool2
32 br i1 %or.cond, label %if.then3, label %loop
34 if.then3: ; preds = %loop
35 %incdec.ptr4 = getelementptr inbounds i8, ptr %0, i64 2
36 store ptr %incdec.ptr4, ptr %p, align 8
43 tracksRegLiveness: true
45 - { id: 0, class: f4rc, preferred-register: '' }
46 - { id: 1, class: f4rc, preferred-register: '' }
47 - { id: 2, class: f4rc, preferred-register: '' }
48 - { id: 3, class: f4rc, preferred-register: '' }
49 - { id: 4, class: f4rc, preferred-register: '' }
50 - { id: 5, class: f4rc, preferred-register: '' }
51 - { id: 6, class: crrc, preferred-register: '' }
52 - { id: 7, class: crbitrc, preferred-register: '' }
53 - { id: 8, class: crrc, preferred-register: '' }
54 - { id: 9, class: crbitrc, preferred-register: '' }
55 - { id: 10, class: crbitrc, preferred-register: '' }
56 - { id: 11, class: f4rc, preferred-register: '' }
58 - { reg: '$f1', virtual-reg: '%0' }
59 - { reg: '$f2', virtual-reg: '%1' }
60 - { reg: '$f3', virtual-reg: '%2' }
61 - { reg: '$f4', virtual-reg: '%3' }
62 - { reg: '$f5', virtual-reg: '%4' }
63 - { reg: '$f6', virtual-reg: '%5' }
66 successors: %bb.2(0x20000000), %bb.1(0x60000000)
67 liveins: $f1, $f2, $f3, $f4, $f5, $f6
69 %5:f4rc = COPY killed $f6
70 %4:f4rc = COPY killed $f5
71 %3:f4rc = COPY killed $f4
72 %2:f4rc = COPY killed $f3
73 %1:f4rc = COPY killed $f2
74 %0:f4rc = COPY killed $f1
75 %6:crrc = FCMPUS killed %2, killed %3
76 %7:crbitrc = COPY killed %6.sub_eq
81 successors: %bb.2(0x2aaaaaab), %bb.3(0x55555555)
83 %8:crrc = FCMPUS killed %0, killed %1
84 %9:crbitrc = COPY killed %8.sub_eq
88 successors: %bb.3(0x80000000)
92 %11:f4rc = PHI %5, %bb.2, %4, %bb.1
94 BLR8 implicit $lr8, implicit $rm, implicit killed $f1
100 exposesReturnsTwice: false
102 regBankSelected: false
105 tracksRegLiveness: true
108 - { id: 0, class: g8rc, preferred-register: '' }
109 - { id: 1, class: g8rc_and_g8rc_nox0, preferred-register: '' }
110 - { id: 2, class: g8rc, preferred-register: '' }
111 - { id: 3, class: g8rc, preferred-register: '' }
112 - { id: 4, class: g8rc_and_g8rc_nox0, preferred-register: '' }
113 - { id: 5, class: gprc, preferred-register: '' }
114 - { id: 6, class: crrc, preferred-register: '' }
115 - { id: 7, class: crbitrc, preferred-register: '' }
116 - { id: 8, class: gprc, preferred-register: '' }
117 - { id: 9, class: crrc, preferred-register: '' }
118 - { id: 10, class: crbitrc, preferred-register: '' }
119 - { id: 11, class: crbitrc, preferred-register: '' }
121 - { reg: '$x3', virtual-reg: '%4' }
123 isFrameAddressTaken: false
124 isReturnAddressTaken: false
133 maxCallFrameSize: 4294967295
134 cvBytesOfCalleeSavedRegisters: 0
135 hasOpaqueSPAdjustment: false
137 hasMustTailInVarArgFunc: false
145 machineFunctionInfo: {}
148 successors: %bb.1(0x80000000)
151 %4:g8rc_and_g8rc_nox0 = COPY killed $x3
152 %0:g8rc = LD 0, %4 :: (dereferenceable load (s64) from %ir.p)
155 successors: %bb.1(0x20000000), %bb.2(0x60000000)
157 %1:g8rc_and_g8rc_nox0 = PHI %0, %bb.0, %2, %bb.1, %3, %bb.3, %2, %bb.2
158 %5:gprc = LBZ 0, %1 :: (load (s8) from %ir.0)
159 %6:crrc = CMPWI killed %5, 0
160 %7:crbitrc = COPY killed %6.sub_eq
161 %2:g8rc = nuw ADDI8 %1, 1
162 STD %2, 0, %4 :: (store (s64) into %ir.p)
163 %8:gprc = LBZ 1, %1 :: (load (s8) from %ir.incdec.ptr)
168 successors: %bb.3(0x55555555), %bb.1(0x2aaaaaab)
170 %9:crrc = CMPWI killed %8, 0
171 %10:crbitrc = COPY killed %9.sub_eq
176 successors: %bb.1(0x80000000)
178 %3:g8rc = nuw ADDI8 killed %1, 2
179 STD %3, 0, %4 :: (store (s64) into %ir.p)
182 ; CHECK-LABEL: name: testfloatslt
184 ; CHECK: successors: %bb.1(0x80000000)
185 ; CHECK: liveins: $x3
187 ; CHECK: %4:g8rc_and_g8rc_nox0 = COPY killed $x3
188 ; CHECK: %0:g8rc = LD 0, %4 :: (dereferenceable load (s64) from %ir.p)
189 ; CHECK: %12:g8rc_and_g8rc_nox0 = COPY killed %0
192 ; CHECK: successors: %bb.1(0x20000000), %bb.2(0x60000000)
194 ; CHECK: %1:g8rc_and_g8rc_nox0 = COPY killed %12
195 ; CHECK: %5:gprc = LBZ 0, %1 :: (load (s8) from %ir.0)
196 ; CHECK: %6:crrc = CMPWI killed %5, 0
197 ; CHECK: %7:crbitrc = COPY killed %6.sub_eq
198 ; CHECK: %2:g8rc = nuw ADDI8 %1, 1
199 ; CHECK: STD %2, 0, %4 :: (store (s64) into %ir.p)
200 ; CHECK: %8:gprc = LBZ 1, %1 :: (load (s8) from %ir.incdec.ptr)
201 ; CHECK: %12:g8rc_and_g8rc_nox0 = COPY %2
202 ; CHECK: BCn killed %7, %bb.1
206 ; CHECK: successors: %bb.3(0x55555555), %bb.1(0x2aaaaaab)
208 ; CHECK: %9:crrc = CMPWI killed %8, 0
209 ; CHECK: %10:crbitrc = COPY killed %9.sub_eq
210 ; CHECK: %12:g8rc_and_g8rc_nox0 = COPY killed %2
211 ; CHECK: BC killed %10, %bb.1
214 ; CHECK: bb.3.if.then3:
215 ; CHECK: successors: %bb.1(0x80000000)
217 ; CHECK: %3:g8rc = nuw ADDI8 killed %1, 2
218 ; CHECK: STD %3, 0, %4 :: (store (s64) into %ir.p)
219 ; CHECK: %12:g8rc_and_g8rc_nox0 = COPY killed %3