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
14 ; CHECK-NEXT: cmp w8, #4
15 ; CHECK-NEXT: b.hi .LBB0_5
16 ; CHECK-NEXT: // %bb.3: // %bb.0
17 ; CHECK-NEXT: adrp x9, .LJTI0_0
18 ; CHECK-NEXT: add x9, x9, :lo12:.LJTI0_0
19 ; CHECK-NEXT: adr x10, .LBB0_4
20 ; CHECK-NEXT: ldrb w11, [x9, x8]
21 ; CHECK-NEXT: add x10, x10, x11, lsl #2
23 ; CHECK-NEXT: .LBB0_4: // %sw.bb
24 ; CHECK-NEXT: add w0, w2, #1
26 ; CHECK-NEXT: .LBB0_5: // %bb.0
27 ; CHECK-NEXT: cmp w8, #200
28 ; CHECK-NEXT: b.ne .LBB0_10
29 ; CHECK-NEXT: // %bb.6: // %sw.bb7
30 ; CHECK-NEXT: add w0, w2, #7
32 ; CHECK-NEXT: .LBB0_7: // %sw.bb1
33 ; CHECK-NEXT: add w0, w2, #3
35 ; CHECK-NEXT: .LBB0_8: // %sw.bb3
36 ; CHECK-NEXT: add w0, w2, #4
38 ; CHECK-NEXT: .LBB0_9: // %sw.bb5
39 ; CHECK-NEXT: add w0, w2, #5
40 ; CHECK-NEXT: .LBB0_10: // %return
43 %b = add nsw i32 %input, %n
44 %cmp = icmp eq i32 %n, 0
45 br i1 %cmp, label %bb.0, label %return
48 switch i32 %b, label %return [
53 i32 200, label %sw.bb7
57 %add = add nsw i32 %a, 1
61 %add2 = add nsw i32 %a, 3
65 %add4 = add nsw i32 %a, 4
69 %add6 = add nsw i32 %a, 5
73 %add8 = add nsw i32 %a, 7
77 %retval.0 = phi i32 [ %add8, %sw.bb7 ], [ %add6, %sw.bb5 ], [ %add4, %sw.bb3 ], [ %add2, %sw.bb1 ], [ %add, %sw.bb ], [ 100, %bb.0 ], [ 0, %entry ]