121
|
1 ; RUN: llc -mcpu=atmega328p < %s -march=avr | FileCheck %s
|
|
2
|
|
3 ; CHECK-LABEL: loopy
|
|
4 define internal fastcc void @loopy() {
|
|
5
|
|
6 ; In this case, when we expand `Select8`/`Select16`, we should be
|
|
7 ; replacing the existing MBB instead of adding a new one.
|
|
8 ;
|
|
9 ; https://github.com/avr-rust/rust/issues/49
|
|
10
|
|
11 ; CHECK: LBB0_{{[0-9]+}}:
|
|
12 ; CHECK: LBB0_{{[0-9]+}}:
|
|
13 ; CHECK-NOT: LBB0_{{[0-9]+}}:
|
|
14 start:
|
|
15 br label %bb7.preheader
|
|
16
|
|
17 bb7.preheader: ; preds = %bb10, %start
|
|
18 %i = phi i8 [ 0, %start ], [ %j, %bb10 ]
|
|
19 %j = phi i8 [ 1, %start ], [ %next, %bb10 ]
|
|
20 br label %bb10
|
|
21
|
|
22 bb4: ; preds = %bb10
|
|
23 ret void
|
|
24
|
|
25 bb10: ; preds = %bb7.preheader
|
|
26 tail call fastcc void @observe(i8 %i, i8 1)
|
|
27 %0 = icmp ult i8 %j, 20
|
|
28 %1 = zext i1 %0 to i8
|
|
29 %next = add i8 %j, %1
|
|
30 br i1 %0, label %bb7.preheader, label %bb4
|
|
31
|
|
32 }
|
|
33
|
|
34 declare void @observe(i8, i8);
|
|
35
|