1 # RUN: llc -verify-machineinstrs -mcpu=pwr9 -mtriple powerpc64le-unknown-linux-gnu \
2 # RUN: -run-pass=block-placement -o - %s | FileCheck %s
4 ; ModuleID = 'block-placement.ll'
5 source_filename = "block-placement.ll"
6 target datalayout = "e-m:e-i64:64-n32:64"
7 target triple = "powerpc64le-unknown-linux-gnu"
9 %"class.xercesc_2_7::HashXMLCh" = type { %"class.xercesc_2_7::HashBase" }
10 %"class.xercesc_2_7::HashBase" = type { i32 (...)** }
12 define dso_local zeroext i1 @_ZN11xercesc_2_79HashXMLCh6equalsEPKvS2_(%"class.xercesc_2_7::HashXMLCh"* nocapture readnone %this, i8* readonly %key1, i8* readonly %key2) unnamed_addr #0 {
14 %cmp.i = icmp eq i8* %key1, null
15 %cmp1.i = icmp eq i8* %key2, null
16 %or.cond.i = or i1 %cmp.i, %cmp1.i
17 br i1 %or.cond.i, label %if.then.i, label %while.cond.preheader.i
19 while.cond.preheader.i: ; preds = %entry
20 %0 = bitcast i8* %key2 to i16*
21 %1 = bitcast i8* %key1 to i16*
22 %2 = load i16, i16* %1, align 2
23 %3 = load i16, i16* %0, align 2
24 %cmp926.i = icmp eq i16 %2, %3
25 br i1 %cmp926.i, label %while.body.i.preheader, label %_ZN11xercesc_2_79XMLString6equalsEPKtS2_.exit
27 while.body.i.preheader: ; preds = %while.cond.preheader.i
28 %scevgep = getelementptr i8, i8* %key2, i64 2
29 %scevgep4 = getelementptr i8, i8* %key1, i64 2
30 br label %while.body.i
32 if.then.i: ; preds = %entry
33 br i1 %cmp.i, label %lor.lhs.false3.i, label %land.lhs.true.i
35 land.lhs.true.i: ; preds = %if.then.i
36 %4 = bitcast i8* %key1 to i16*
37 %5 = load i16, i16* %4, align 2
38 %tobool.i = icmp eq i16 %5, 0
39 br i1 %tobool.i, label %lor.lhs.false3.i, label %_ZN11xercesc_2_79XMLString6equalsEPKtS2_.exit
41 lor.lhs.false3.i: ; preds = %land.lhs.true.i, %if.then.i
42 br i1 %cmp1.i, label %if.else.i, label %land.lhs.true5.i
44 land.lhs.true5.i: ; preds = %lor.lhs.false3.i
45 %6 = bitcast i8* %key2 to i16*
46 %7 = load i16, i16* %6, align 2
47 %tobool6.i = icmp eq i16 %7, 0
48 br i1 %tobool6.i, label %if.else.i, label %_ZN11xercesc_2_79XMLString6equalsEPKtS2_.exit
50 if.else.i: ; preds = %land.lhs.true5.i, %lor.lhs.false3.i
51 br label %_ZN11xercesc_2_79XMLString6equalsEPKtS2_.exit
53 while.body.i: ; preds = %while.body.i.preheader, %if.end12.i
54 %lsr.iv5 = phi i8* [ %scevgep4, %while.body.i.preheader ], [ %scevgep6, %if.end12.i ]
55 %lsr.iv = phi i8* [ %scevgep, %while.body.i.preheader ], [ %scevgep2, %if.end12.i ]
56 %8 = phi i16 [ %15, %if.end12.i ], [ %2, %while.body.i.preheader ]
57 %9 = phi i8* [ %key1, %while.body.i.preheader ], [ %13, %if.end12.i ]
58 %10 = phi i8* [ %key2, %while.body.i.preheader ], [ %11, %if.end12.i ]
59 %11 = getelementptr i8, i8* %10, i64 2
60 %12 = bitcast i8* %11 to i16*
61 %13 = getelementptr i8, i8* %9, i64 2
62 %14 = bitcast i8* %13 to i16*
63 %tobool10.i = icmp eq i16 %8, 0
64 br i1 %tobool10.i, label %_ZN11xercesc_2_79XMLString6equalsEPKtS2_.exit, label %if.end12.i
66 if.end12.i: ; preds = %while.body.i
67 %15 = load i16, i16* %14, align 2
68 %16 = load i16, i16* %12, align 2
69 %cmp9.i = icmp eq i16 %15, %16
70 %scevgep2 = getelementptr i8, i8* %lsr.iv, i64 2
71 %scevgep6 = getelementptr i8, i8* %lsr.iv5, i64 2
72 br i1 %cmp9.i, label %while.body.i, label %_ZN11xercesc_2_79XMLString6equalsEPKtS2_.exit
74 _ZN11xercesc_2_79XMLString6equalsEPKtS2_.exit: ; preds = %if.end12.i, %while.body.i, %if.else.i, %land.lhs.true5.i, %land.lhs.true.i, %while.cond.preheader.i
75 %retval.0.i1 = phi i64 [ 1, %if.else.i ], [ 0, %land.lhs.true.i ], [ 0, %land.lhs.true5.i ], [ 0, %while.cond.preheader.i ], [ 0, %if.end12.i ], [ 1, %while.body.i ]
76 %backToBool = trunc i64 %retval.0.i1 to i1
80 attributes #0 = { "target-cpu"="pwr9" }
84 name: _ZN11xercesc_2_79HashXMLCh6equalsEPKvS2_
86 exposesReturnsTwice: false
88 regBankSelected: false
91 tracksRegLiveness: true
95 - { reg: '$x4', virtual-reg: '' }
96 - { reg: '$x5', virtual-reg: '' }
98 isFrameAddressTaken: false
99 isReturnAddressTaken: false
109 cvBytesOfCalleeSavedRegisters: 0
110 hasOpaqueSPAdjustment: false
112 hasMustTailInVarArgFunc: false
120 machineFunctionInfo: {}
123 successors: %bb.5(0x40000000), %bb.1(0x40000000)
126 renamable $cr1 = CMPDI renamable $x4, 0
127 renamable $cr0 = CMPDI renamable $x5, 0
128 renamable $cr5lt = CROR renamable $cr1eq, renamable $cr0eq
129 BC killed renamable $cr5lt, %bb.5
131 bb.1.while.cond.preheader.i:
132 successors: %bb.2(0x40000000), %bb.11(0x40000000)
135 renamable $r8 = LHZ 0, renamable $x4 :: (load 2 from %ir.1)
136 renamable $r6 = LHZ 0, renamable $x5 :: (load 2 from %ir.0)
137 renamable $x3 = LI8 0
138 renamable $cr0 = CMPLW renamable $r8, killed renamable $r6
139 BCC 68, killed renamable $cr0, %bb.11
141 bb.2.while.body.i.preheader:
142 successors: %bb.3(0x80000000)
143 liveins: $r8, $x3, $x4, $x5
145 renamable $x6 = ADDI8 renamable $x5, 2
146 renamable $x7 = ADDI8 renamable $x4, 2
149 successors: %bb.4(0x04000000), %bb.10(0x7c000000)
150 liveins: $r8, $x3, $x4, $x5, $x6, $x7
152 dead renamable $r8 = ANDIo killed renamable $r8, 65535, implicit-def $cr0
153 BCC 68, killed renamable $cr0, %bb.10
156 renamable $x3 = LI8 1
157 BLR8 implicit $lr8, implicit $rm, implicit killed $x3
160 successors: %bb.7(0x30000000), %bb.6(0x50000000)
161 liveins: $cr0, $cr1, $x4, $x5
163 BC killed renamable $cr1eq, %bb.7
165 bb.6.land.lhs.true.i:
166 successors: %bb.7(0x30000000), %bb.11(0x50000000)
167 liveins: $cr0, $x4, $x5
169 renamable $r4 = LHZ 0, killed renamable $x4 :: (load 2 from %ir.4)
170 renamable $x3 = LI8 0
171 renamable $cr1 = CMPLWI killed renamable $r4, 0
172 BCC 68, killed renamable $cr1, %bb.11
174 bb.7.lor.lhs.false3.i:
175 successors: %bb.9(0x30000000), %bb.8(0x50000000)
178 BC killed renamable $cr0eq, %bb.9
180 bb.8.land.lhs.true5.i:
181 successors: %bb.9(0x80000000)
184 renamable $r4 = LHZ 0, killed renamable $x5 :: (load 2 from %ir.6)
185 renamable $x3 = LI8 0
186 renamable $cr0 = CMPLWI killed renamable $r4, 0
187 BCCLR 68, killed renamable $cr0, implicit $lr, implicit $rm, implicit killed $x3
190 renamable $x3 = LI8 1
191 BLR8 implicit $lr8, implicit $rm, implicit killed $x3
194 successors: %bb.3(0x7c000000), %bb.11(0x04000000)
195 liveins: $x3, $x4, $x5, $x6, $x7
197 renamable $x5 = ADDI8 killed renamable $x5, 2
198 renamable $x4 = ADDI8 killed renamable $x4, 2
199 renamable $r8 = LHZ 0, renamable $x4 :: (load 2 from %ir.14)
200 renamable $r9 = LHZ 0, renamable $x5 :: (load 2 from %ir.12)
201 renamable $x6 = ADDI8 killed renamable $x6, 2
202 renamable $x7 = ADDI8 killed renamable $x7, 2
203 renamable $cr0 = CMPLW renamable $r8, killed renamable $r9
204 BCC 76, killed renamable $cr0, %bb.3
206 bb.11._ZN11xercesc_2_79XMLString6equalsEPKtS2_.exit:
209 BLR8 implicit $lr8, implicit $rm, implicit killed $x3
211 ; CHECK: bb.5.if.else.i:
212 ; CHECK: successors: %bb.11(0x80000000)
215 ; CHECK: bb.8.while.body.i (align 16):
216 ; CHECK: successors: %bb.11(0x04000000), %bb.9(0x7c000000)
217 ; CHECK: BCC 76, killed renamable $cr0, %bb.11
220 ; CHECK: renamable $x3 = LI8 1
221 ; CHECK-NEXT: BLR8 implicit $lr8, implicit $rm, implicit killed $x3