1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc %s -o - -mtriple=powerpc-unknown-unknown -run-pass=machine-cse -verify-machineinstrs | FileCheck %s
4 define void @can_pre() {
9 br i1 undef, label %if.then, label %if.else
21 define void @cannot_pre() {
26 br i1 undef, label %if.then, label %if.else
41 - { id: 0, class: f8rc, preferred-register: '' }
42 - { id: 1, class: f8rc, preferred-register: '' }
43 - { id: 2, class: gprc, preferred-register: '' }
44 - { id: 3, class: gprc, preferred-register: '' }
45 - { id: 4, class: f8rc, preferred-register: '' }
46 - { id: 5, class: f8rc, preferred-register: '' }
48 - { reg: '$r1', virtual-reg: '%2' }
49 - { reg: '$r2', virtual-reg: '%3' }
50 - { reg: '$f1', virtual-reg: '%4' }
51 - { reg: '$f2', virtual-reg: '%5' }
53 ; CHECK-LABEL: name: can_pre
54 ; CHECK: bb.0.for.body:
55 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
56 ; CHECK-NEXT: liveins: $r1, $r2, $f1, $f2
58 ; CHECK-NEXT: [[COPY:%[0-9]+]]:f8rc = COPY $f2
59 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:f8rc = COPY $f1
60 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gprc = COPY $r2
61 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gprc = COPY $r1
62 ; CHECK-NEXT: $cr0 = CMPLWI [[COPY3]], 0
63 ; CHECK-NEXT: %6:f8rc = nofpexcept FDIV [[COPY1]], [[COPY]], implicit $rm
64 ; CHECK-NEXT: BCC 44, $cr0, %bb.1
67 ; CHECK-NEXT: bb.1.if.then:
68 ; CHECK-NEXT: successors: %bb.3(0x80000000)
72 ; CHECK-NEXT: bb.2.if.else:
73 ; CHECK-NEXT: successors: %bb.3(0x80000000)
75 ; CHECK-NEXT: bb.3.if.end:
76 ; CHECK-NEXT: BLR implicit $lr, implicit $rm
78 successors: %bb.1(0x40000000), %bb.2(0x40000000)
79 liveins: $r1, $r2, $f1, $f2
90 successors: %bb.3(0x80000000)
92 %0:f8rc = nofpexcept FDIV %4, %5, implicit $rm
96 successors: %bb.3(0x80000000)
98 %1:f8rc = nofpexcept FDIV %4, %5, implicit $rm
101 BLR implicit $lr, implicit $rm
106 - { id: 0, class: f8rc, preferred-register: '' }
107 - { id: 1, class: f8rc, preferred-register: '' }
108 - { id: 2, class: gprc, preferred-register: '' }
109 - { id: 3, class: gprc, preferred-register: '' }
110 - { id: 4, class: f8rc, preferred-register: '' }
111 - { id: 5, class: f8rc, preferred-register: '' }
112 - { id: 6, class: f8rc, preferred-register: '' }
114 - { reg: '$r1', virtual-reg: '%2' }
115 - { reg: '$r2', virtual-reg: '%3' }
116 - { reg: '$f1', virtual-reg: '%4' }
117 - { reg: '$f2', virtual-reg: '%5' }
119 ; CHECK-LABEL: name: cannot_pre
120 ; CHECK: bb.0.for.body:
121 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
122 ; CHECK-NEXT: liveins: $r1, $r2, $f1, $f2
124 ; CHECK-NEXT: [[COPY:%[0-9]+]]:f8rc = COPY $f2
125 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:f8rc = COPY $f1
126 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gprc = COPY $r2
127 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gprc = COPY $r1
128 ; CHECK-NEXT: $cr0 = CMPLWI [[COPY3]], 0
129 ; CHECK-NEXT: BCC 44, $cr0, %bb.1
130 ; CHECK-NEXT: B %bb.2
132 ; CHECK-NEXT: bb.1.if.then:
133 ; CHECK-NEXT: successors: %bb.3(0x80000000)
135 ; CHECK-NEXT: [[SETRND:%[0-9]+]]:f8rc = SETRND [[COPY2]], implicit-def $rm, implicit $rm
136 ; CHECK-NEXT: %0:f8rc = nofpexcept FDIV [[COPY1]], [[COPY]], implicit $rm
137 ; CHECK-NEXT: B %bb.3
139 ; CHECK-NEXT: bb.2.if.else:
140 ; CHECK-NEXT: successors: %bb.3(0x80000000)
142 ; CHECK-NEXT: %1:f8rc = nofpexcept FDIV [[COPY1]], [[COPY]], implicit $rm
144 ; CHECK-NEXT: bb.3.if.end:
145 ; CHECK-NEXT: BLR implicit $lr, implicit $rm
147 successors: %bb.1(0x40000000), %bb.2(0x40000000)
148 liveins: $r1, $r2, $f1, $f2
159 successors: %bb.3(0x80000000)
161 %6:f8rc = SETRND %3, implicit-def $rm, implicit $rm
162 %0:f8rc = nofpexcept FDIV %4, %5, implicit $rm
166 successors: %bb.3(0x80000000)
168 %1:f8rc = nofpexcept FDIV %4, %5, implicit $rm
171 BLR implicit $lr, implicit $rm