1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -O3 -mtriple=aarch64-linux-gnu < %s | FileCheck %s
4 define i32 @test(i32 %input, i32 %n, i32 %a) {
6 ; CHECK: // %bb.0: // %entry
7 ; CHECK-NEXT: cbz w1, .LBB0_2
8 ; CHECK-NEXT: // %bb.1:
9 ; CHECK-NEXT: mov w0, wzr
11 ; CHECK-NEXT: .LBB0_2: // %bb.0
12 ; CHECK-NEXT: add w8, w0, w1
13 ; CHECK-NEXT: mov w0, #100 // =0x64
14 ; CHECK-NEXT: cmp w8, #1
15 ; CHECK-NEXT: b.le .LBB0_7
16 ; CHECK-NEXT: // %bb.3: // %bb.0
17 ; CHECK-NEXT: cmp w8, #2
18 ; CHECK-NEXT: b.eq .LBB0_10
19 ; CHECK-NEXT: // %bb.4: // %bb.0
20 ; CHECK-NEXT: cmp w8, #4
21 ; CHECK-NEXT: b.eq .LBB0_11
22 ; CHECK-NEXT: // %bb.5: // %bb.0
23 ; CHECK-NEXT: cmp w8, #200
24 ; CHECK-NEXT: b.ne .LBB0_12
25 ; CHECK-NEXT: // %bb.6: // %sw.bb7
26 ; CHECK-NEXT: add w0, w2, #7
28 ; CHECK-NEXT: .LBB0_7: // %bb.0
29 ; CHECK-NEXT: cbz w8, .LBB0_13
30 ; CHECK-NEXT: // %bb.8: // %bb.0
31 ; CHECK-NEXT: cmp w8, #1
32 ; CHECK-NEXT: b.ne .LBB0_12
33 ; CHECK-NEXT: // %bb.9: // %sw.bb1
34 ; CHECK-NEXT: add w0, w2, #3
36 ; CHECK-NEXT: .LBB0_10: // %sw.bb3
37 ; CHECK-NEXT: add w0, w2, #4
39 ; CHECK-NEXT: .LBB0_11: // %sw.bb5
40 ; CHECK-NEXT: add w0, w2, #5
41 ; CHECK-NEXT: .LBB0_12: // %return
43 ; CHECK-NEXT: .LBB0_13: // %sw.bb
44 ; CHECK-NEXT: add w0, w2, #1
47 %b = add nsw i32 %input, %n
48 %cmp = icmp eq i32 %n, 0
49 br i1 %cmp, label %bb.0, label %return
52 switch i32 %b, label %return [
57 i32 200, label %sw.bb7
61 %add = add nsw i32 %a, 1
65 %add2 = add nsw i32 %a, 3
69 %add4 = add nsw i32 %a, 4
73 %add6 = add nsw i32 %a, 5
77 %add8 = add nsw i32 %a, 7
81 %retval.0 = phi i32 [ %add8, %sw.bb7 ], [ %add6, %sw.bb5 ], [ %add4, %sw.bb3 ], [ %add2, %sw.bb1 ], [ %add, %sw.bb ], [ 100, %bb.0 ], [ 0, %entry ]