1 # RUN: llc -mtriple=thumbv8.1m.main %s -run-pass=arm-cp-islands --verify-machineinstrs -o - | FileCheck %s --check-prefix=CHECK-LOB
2 # RUN: llc -mtriple=thumbv8.1m.main -mattr=-lob %s -run-pass=arm-cp-islands --verify-machineinstrs -o - | FileCheck %s --check-prefix=CHECK-NOLOB
4 # CHECK-NOLOB-NOT: t2LE
6 # CHECK-LOB: bb.3.land.rhs:
7 # CHECK-LOB: tCBZ $r0, %bb.8
8 # CHECK-LOB: t2LE %bb.3
9 # CHECK-LOB: bb.6.land.rhs11:
10 # CHECK-LOB: bb.7.while.body19:
11 # CHECK-LOB: tCBZ $r0, %bb.8
12 # CHECK-LOB: t2LE %bb.6
16 target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
17 target triple = "thumbv8.1m.main-unknown-unknown"
19 %struct.head_s = type { %struct.head_s*, %struct.data_s* }
20 %struct.data_s = type { i16, i16 }
22 ; Function Attrs: norecurse nounwind readonly
23 define dso_local arm_aapcscc %struct.head_s* @search(%struct.head_s* readonly %list, %struct.data_s* nocapture readonly %info) local_unnamed_addr #0 {
25 %idx = getelementptr inbounds %struct.data_s, %struct.data_s* %info, i32 0, i32 1
26 %0 = load i16, i16* %idx, align 2
27 %cmp = icmp sgt i16 %0, -1
28 br i1 %cmp, label %while.cond.preheader, label %while.cond9.preheader
30 while.cond9.preheader: ; preds = %entry
31 %1 = icmp eq %struct.head_s* %list, null
32 br i1 %1, label %return, label %land.rhs11.lr.ph
34 land.rhs11.lr.ph: ; preds = %while.cond9.preheader
35 %data16143 = bitcast %struct.data_s* %info to i16*
36 %2 = load i16, i16* %data16143, align 2
37 %conv15 = sext i16 %2 to i32
40 while.cond.preheader: ; preds = %entry
41 %3 = icmp eq %struct.head_s* %list, null
42 br i1 %3, label %return, label %land.rhs.preheader
44 land.rhs.preheader: ; preds = %while.cond.preheader
47 land.rhs: ; preds = %land.rhs.preheader, %while.body
48 %list.addr.033 = phi %struct.head_s* [ %6, %while.body ], [ %list, %land.rhs.preheader ]
49 %info2 = getelementptr inbounds %struct.head_s, %struct.head_s* %list.addr.033, i32 0, i32 1
50 %4 = load %struct.data_s*, %struct.data_s** %info2, align 4
51 %idx3 = getelementptr inbounds %struct.data_s, %struct.data_s* %4, i32 0, i32 1
52 %5 = load i16, i16* %idx3, align 2
53 %cmp7 = icmp eq i16 %5, %0
54 br i1 %cmp7, label %return, label %while.body
56 while.body: ; preds = %land.rhs
57 %next4 = bitcast %struct.head_s* %list.addr.033 to %struct.head_s**
58 %6 = load %struct.head_s*, %struct.head_s** %next4, align 4
59 %tobool = icmp eq %struct.head_s* %6, null
60 br i1 %tobool, label %return, label %land.rhs
62 land.rhs11: ; preds = %while.body19, %land.rhs11.lr.ph
63 %list.addr.136 = phi %struct.head_s* [ %list, %land.rhs11.lr.ph ], [ %10, %while.body19 ]
64 %info12 = getelementptr inbounds %struct.head_s, %struct.head_s* %list.addr.136, i32 0, i32 1
65 %7 = load %struct.data_s*, %struct.data_s** %info12, align 4
66 %data165 = bitcast %struct.data_s* %7 to i16*
67 %8 = load i16, i16* %data165, align 2
69 %and = zext i16 %9 to i32
70 %cmp16 = icmp eq i32 %and, %conv15
71 br i1 %cmp16, label %return, label %while.body19
73 while.body19: ; preds = %land.rhs11
74 %next206 = bitcast %struct.head_s* %list.addr.136 to %struct.head_s**
75 %10 = load %struct.head_s*, %struct.head_s** %next206, align 4
76 %tobool10 = icmp eq %struct.head_s* %10, null
77 br i1 %tobool10, label %return, label %land.rhs11
79 return: ; preds = %while.body19, %land.rhs11, %while.body, %land.rhs, %while.cond.preheader, %while.cond9.preheader
80 %retval.0 = phi %struct.head_s* [ null, %while.cond.preheader ], [ null, %while.cond9.preheader ], [ %list.addr.033, %land.rhs ], [ null, %while.body ], [ %list.addr.136, %land.rhs11 ], [ null, %while.body19 ]
81 ret %struct.head_s* %retval.0
84 attributes #0 = { norecurse nounwind readonly "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+armv8.1-m.main,+hwdiv,+lob,+ras,+soft-float,+strict-align,+thumb-mode,-crypto,-d32,-dotprod,-fp-armv8,-fp-armv8d16,-fp-armv8d16sp,-fp-armv8sp,-fp16,-fp16fml,-fp64,-fpregs,-fullfp16,-neon,-vfp2,-vfp2d16,-vfp2d16sp,-vfp2sp,-vfp3,-vfp3d16,-vfp3d16sp,-vfp3sp,-vfp4,-vfp4d16,-vfp4d16sp,-vfp4sp" "unsafe-fp-math"="false" "use-soft-float"="true" }
90 exposesReturnsTwice: false
92 regBankSelected: false
95 tracksRegLiveness: true
99 - { reg: '$r0', virtual-reg: '' }
100 - { reg: '$r1', virtual-reg: '' }
102 isFrameAddressTaken: false
103 isReturnAddressTaken: false
113 cvBytesOfCalleeSavedRegisters: 0
114 hasOpaqueSPAdjustment: false
116 hasMustTailInVarArgFunc: false
124 machineFunctionInfo: {}
127 successors: %bb.5(0x50000000), %bb.1(0x30000000)
130 renamable $r2 = t2LDRSHi12 renamable $r1, 2, 14, $noreg :: (load 2 from %ir.idx)
131 t2CMPri renamable $r2, -1, 14, $noreg, implicit-def $cpsr
132 t2Bcc %bb.1, 13, killed $cpsr
134 bb.5.while.cond.preheader:
135 successors: %bb.8(0x30000000), %bb.6(0x50000000)
138 tCMPi8 renamable $r0, 0, 14, $noreg, implicit-def $cpsr
139 t2Bcc %bb.8, 0, killed $cpsr
141 bb.6.land.rhs.preheader:
142 successors: %bb.7(0x80000000)
145 renamable $r1 = tUXTH killed renamable $r2, 14, $noreg
148 successors: %bb.8(0x04000000), %bb.7(0x7c000000)
151 renamable $r2 = tLDRi renamable $r0, 1, 14, $noreg :: (load 4 from %ir.info2)
152 renamable $r2 = tLDRHi killed renamable $r2, 1, 14, $noreg :: (load 2 from %ir.idx3)
153 tCMPr killed renamable $r2, renamable $r1, 14, $noreg, implicit-def $cpsr
154 t2IT 0, 8, implicit-def $itstate
155 tBX_RET 0, killed $cpsr, implicit $r0, implicit killed $itstate
156 renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.next4)
157 tCMPi8 renamable $r0, 0, 14, $noreg, implicit-def $cpsr
158 t2Bcc %bb.7, 1, killed $cpsr
159 t2B %bb.8, 14, $noreg
161 bb.1.while.cond9.preheader:
162 successors: %bb.8(0x30000000), %bb.2(0x50000000)
165 tCMPi8 renamable $r0, 0, 14, $noreg, implicit-def $cpsr
166 t2Bcc %bb.8, 0, killed $cpsr
168 bb.2.land.rhs11.lr.ph:
169 successors: %bb.3(0x80000000)
172 renamable $r1 = t2LDRSHi12 killed renamable $r1, 0, 14, $noreg :: (load 2 from %ir.data16143)
175 successors: %bb.9(0x04000000), %bb.4(0x7c000000)
178 renamable $r2 = tLDRi renamable $r0, 1, 14, $noreg :: (load 4 from %ir.info12)
179 renamable $r2 = tLDRBi killed renamable $r2, 0, 14, $noreg :: (load 1 from %ir.data165, align 2)
180 tCMPr killed renamable $r2, renamable $r1, 14, $noreg, implicit-def $cpsr
181 t2Bcc %bb.9, 0, killed $cpsr
184 successors: %bb.8(0x04000000), %bb.3(0x7c000000)
187 renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.next206)
188 tCMPi8 renamable $r0, 0, 14, $noreg, implicit-def $cpsr
189 t2Bcc %bb.3, 1, killed $cpsr
192 successors: %bb.9(0x80000000)
194 renamable $r0, dead $cpsr = tMOVi8 0, 14, $noreg
199 tBX_RET 14, $noreg, implicit killed $r0