1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=m68k --regalloc=fast %s -o - | FileCheck %s
4 define dso_local void @foo1() {
6 ; CHECK: .cfi_startproc
7 ; CHECK-NEXT: ; %bb.0: ; %entry
8 ; CHECK-NEXT: suba.l #2, %sp
9 ; CHECK-NEXT: .cfi_def_cfa_offset -6
10 ; CHECK-NEXT: move.b #0, %d0
11 ; CHECK-NEXT: move.b %d0, (0,%sp) ; 1-byte Folded Spill
12 ; CHECK-NEXT: .LBB0_1: ; %do.body
13 ; CHECK-NEXT: ; =>This Inner Loop Header: Depth=1
14 ; CHECK-NEXT: move.b (0,%sp), %d0 ; 1-byte Folded Reload
15 ; CHECK-NEXT: cmpi.b #0, %d0
16 ; CHECK-NEXT: bne .LBB0_1
17 ; CHECK-NEXT: ; %bb.2: ; %do.end
18 ; CHECK-NEXT: adda.l #2, %sp
23 do.body: ; preds = %land.end, %entry
24 %cmp5 = icmp eq i32 0, 4
27 land.end: ; preds = %do.body
28 br i1 %cmp5, label %do.body, label %do.end
30 do.end: ; preds = %land.end
34 define i32 @foo2(ptr noundef %0) {
36 ; CHECK: .cfi_startproc
37 ; CHECK-NEXT: ; %bb.0: ; %entry
38 ; CHECK-NEXT: suba.l #4, %sp
39 ; CHECK-NEXT: .cfi_def_cfa_offset -8
40 ; CHECK-NEXT: move.l (8,%sp), %a0
41 ; CHECK-NEXT: move.b (%a0), %d0
42 ; CHECK-NEXT: move.b %d0, (0,%sp) ; 1-byte Folded Spill
43 ; CHECK-NEXT: and.b #1, %d0
44 ; CHECK-NEXT: move.b %d0, (2,%sp) ; 1-byte Folded Spill
45 ; CHECK-NEXT: sub.b #1, %d0
46 ; CHECK-NEXT: bgt .LBB1_2
47 ; CHECK-NEXT: ; %bb.1: ; %if
48 ; CHECK-NEXT: move.b (2,%sp), %d0 ; 1-byte Folded Reload
49 ; CHECK-NEXT: move.b (0,%sp), %d1 ; 1-byte Folded Reload
50 ; CHECK-NEXT: add.b %d1, %d0
51 ; CHECK-NEXT: bra .LBB1_3
52 ; CHECK-NEXT: .LBB1_2: ; %else
53 ; CHECK-NEXT: move.b (2,%sp), %d1 ; 1-byte Folded Reload
54 ; CHECK-NEXT: move.b (0,%sp), %d0 ; 1-byte Folded Reload
55 ; CHECK-NEXT: sub.b %d1, %d0
56 ; CHECK-NEXT: move.b %d0, (0,%sp) ; 1-byte Folded Spill
57 ; CHECK-NEXT: .LBB1_3: ; %cont
58 ; CHECK-NEXT: move.b %d0, (2,%sp) ; 1-byte Folded Spill
59 ; CHECK-NEXT: move.b (2,%sp), %d0 ; 1-byte Folded Reload
60 ; CHECK-NEXT: ext.w %d0
61 ; CHECK-NEXT: ext.l %d0
62 ; CHECK-NEXT: adda.l #4, %sp
65 %1 = getelementptr i8, ptr %0, i32 0
68 %4 = icmp sle i8 %3, 1
69 br i1 %4, label %if, label %else
80 %7 = phi i8 [%5, %if], [%6, %else]
81 %8 = sext i8 %7 to i32