Debian Codegraph @

llvm/test/CodeGen/PowerPC/ctrloop-do-not-duplicate-mi.mir

raw
1 # RUN: llc -ppc-asm-full-reg-names -mtriple=powerpc64le-unknown-linux-gnu \
2 # RUN: -run-pass=early-tailduplication,ppc-ctrloops %s -o - -verify-machineinstrs 2>&1 | FileCheck %s
3
4 --- |
5 target datalayout = "e-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512"
6 target triple = "powerpc64le-unknown-linux-gnu"
7
8 define dso_local void @test() local_unnamed_addr {
9 test_entry:
10 %_val_domain_ = load i32, ptr undef, align 4
11 %_conv765 = sext i32 %_val_domain_ to i64
12 br i1 undef, label %_label_42, label %_loop_40_loopHeader_
13
14 _loop_40_loopHeader_: ; preds = %test_entry
15 %_val_flags_1020 = load i32, ptr undef, align 4
16 %0 = and i32 %_val_flags_1020, 1
17 %_cond_conv_1022.not = icmp eq i32 %0, 0
18 %1 = sub i64 1, %_conv765
19 %smax = call i64 @llvm.smax.i64(i64 %1, i64 1)
20 br label %_label_43
21
22 _label_43.loopexit: ; preds = %_loop_44_loopHeader_
23 %lsr.iv.next = add i64 %lsr.iv, -1
24 br label %_label_43
25
26 _label_43: ; preds = %_label_43.loopexit, %_loop_40_loopHeader_
27 %lsr.iv = phi i64 [ %lsr.iv.next, %_label_43.loopexit ], [ undef, %_loop_40_loopHeader_ ]
28 call void @llvm.set.loop.iterations.i64(i64 %smax)
29 br label %_loop_44_do_
30
31 _loop_44_loopHeader_: ; preds = %_loop_44_do_
32 %2 = call i1 @llvm.loop.decrement.i64(i64 1)
33 br i1 %2, label %_loop_44_do_, label %_label_43.loopexit
34
35 _loop_44_do_: ; preds = %_loop_44_loopHeader_, %_label_43
36 br i1 %_cond_conv_1022.not, label %_label_42.loopexit, label %_loop_44_loopHeader_
37
38 _label_42.loopexit: ; preds = %_loop_44_do_
39 %3 = trunc i64 %lsr.iv to i32
40 store i32 %3, ptr undef, align 4
41 unreachable
42
43 _label_42: ; preds = %test_entry
44 unreachable
45 }
46
47 ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn
48 declare i64 @llvm.smax.i64(i64, i64) #1
49
50 ; Function Attrs: nocallback noduplicate nofree nosync nounwind willreturn
51 declare void @llvm.set.loop.iterations.i64(i64) #2
52
53 ; Function Attrs: nocallback noduplicate nofree nosync nounwind willreturn
54 declare i1 @llvm.loop.decrement.i64(i64) #2
55
56 attributes #1 = { nocallback nofree nosync nounwind readnone speculatable willreturn }
57 attributes #2 = { nocallback noduplicate nofree nosync nounwind willreturn }
58
59 !llvm.ident = !{!0}
60
61 !0 = !{!""}
62
63 ...
64 ---
65 name: test
66 # CHECK: test
67 alignment: 16
68 exposesReturnsTwice: false
69 legalized: false
70 regBankSelected: false
71 selected: false
72 failedISel: false
73 tracksRegLiveness: true
74 hasWinCFI: false
75 callsEHReturn: false
76 callsUnwindInit: false
77 hasEHContTarget: false
78 hasEHScopes: false
79 hasEHFunclets: false
80 failsVerification: false
81 tracksDebugUserValues: false
82 registers:
83 - { id: 0, class: g8rc, preferred-register: '' }
84 - { id: 1, class: crbitrc, preferred-register: '' }
85 - { id: 2, class: g8rc, preferred-register: '' }
86 - { id: 3, class: g8rc, preferred-register: '' }
87 - { id: 4, class: g8rc_and_g8rc_nox0, preferred-register: '' }
88 - { id: 5, class: g8rc_and_g8rc_nox0, preferred-register: '' }
89 - { id: 6, class: crbitrc, preferred-register: '' }
90 - { id: 7, class: g8rc, preferred-register: '' }
91 - { id: 8, class: gprc, preferred-register: '' }
92 - { id: 9, class: g8rc_and_g8rc_nox0, preferred-register: '' }
93 - { id: 10, class: g8rc_and_g8rc_nox0, preferred-register: '' }
94 - { id: 11, class: crrc, preferred-register: '' }
95 - { id: 12, class: g8rc_and_g8rc_nox0, preferred-register: '' }
96 - { id: 13, class: crbitrc, preferred-register: '' }
97 - { id: 14, class: g8rc_and_g8rc_nox0, preferred-register: '' }
98 - { id: 15, class: gprc, preferred-register: '' }
99 liveins: []
100 frameInfo:
101 isFrameAddressTaken: false
102 isReturnAddressTaken: false
103 hasStackMap: false
104 hasPatchPoint: false
105 stackSize: 0
106 offsetAdjustment: 0
107 maxAlignment: 1
108 adjustsStack: false
109 hasCalls: false
110 stackProtector: ''
111 functionContext: ''
112 maxCallFrameSize: 4294967295
113 cvBytesOfCalleeSavedRegisters: 0
114 hasOpaqueSPAdjustment: false
115 hasVAStart: false
116 hasMustTailInVarArgFunc: false
117 hasTailCall: false
118 localFrameSize: 0
119 savePoint: []
120 restorePoint: []
121 fixedStack: []
122 stack: []
123 callSites: []
124 debugValueSubstitutions: []
125 constants: []
126 machineFunctionInfo: {}
127 body: |
128 bb.0.test_entry:
129 successors: %bb.7(0x40000000), %bb.1(0x40000000)
130
131 %5:g8rc_and_g8rc_nox0 = IMPLICIT_DEF
132 %0:g8rc = LWA 0, killed %5 :: (load (s32) from `ptr undef`)
133 %6:crbitrc = IMPLICIT_DEF
134 BC killed %6, %bb.7
135 B %bb.1
136
137 bb.1._loop_40_loopHeader_:
138 successors: %bb.3(0x80000000)
139
140 %9:g8rc_and_g8rc_nox0 = IMPLICIT_DEF
141 %8:gprc = LWZ 0, %9 :: (load (s32) from `ptr undef`)
142 %15:gprc = ANDI_rec %8, 1, implicit-def $cr0
143 %1:crbitrc = COPY $cr0eq
144 %10:g8rc_and_g8rc_nox0 = SUBFIC8 %0, 1, implicit-def dead $carry
145 %11:crrc = CMPDI %10, 1
146 %12:g8rc_and_g8rc_nox0 = LI8 1
147 %2:g8rc = ISEL8 %10, %12, %11.sub_gt
148 %7:g8rc = IMPLICIT_DEF
149 B %bb.3
150
151 bb.2._label_43.loopexit:
152 successors: %bb.3(0x80000000)
153
154 %3:g8rc = ADDI8 %4, -1
155
156 bb.3._label_43:
157 successors: %bb.5(0x80000000)
158
159 %4:g8rc_and_g8rc_nox0 = PHI %7, %bb.1, %3, %bb.2
160 MTCTR8loop %2, implicit-def dead $ctr8
161 B %bb.5
162
163 bb.4._loop_44_loopHeader_:
164 successors: %bb.5(0x7c000000), %bb.2(0x04000000)
165
166 %13:crbitrc = DecreaseCTR8loop 1, implicit-def dead $ctr8, implicit $ctr8
167 BCn killed %13, %bb.2
168 B %bb.5
169
170 bb.5._loop_44_do_:
171 successors: %bb.6(0x00000000), %bb.4(0x80000000)
172
173 BCn %1, %bb.4
174 B %bb.6
175
176 bb.6._label_42.loopexit:
177 successors:
178
179 %14:g8rc_and_g8rc_nox0 = IMPLICIT_DEF
180 STW8 %4, 0, killed %14 :: (store (s32) into `ptr undef`)
181
182 bb.7._label_42:
183
184 ...