1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc < %s -mtriple=riscv64 -o - | FileCheck %s
4 define void @foo(i32 %i) nounwind {
6 ; CHECK: # %bb.0: # %entry
7 ; CHECK-NEXT: addi sp, sp, -16
8 ; CHECK-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
9 ; CHECK-NEXT: sext.w a0, a0
10 ; CHECK-NEXT: li a1, 7
11 ; CHECK-NEXT: beq a0, a1, .LBB0_3
12 ; CHECK-NEXT: # %bb.1: # %entry
13 ; CHECK-NEXT: li a1, 5
14 ; CHECK-NEXT: bne a0, a1, .LBB0_4
15 ; CHECK-NEXT: # %bb.2: # %if.then
16 ; CHECK-NEXT: call bar
17 ; CHECK-NEXT: j .LBB0_4
18 ; CHECK-NEXT: .LBB0_3: # %if.then2
19 ; CHECK-NEXT: call bar
20 ; CHECK-NEXT: .LBB0_4: # %if.end3
21 ; CHECK-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
22 ; CHECK-NEXT: addi sp, sp, 16
23 ; CHECK-NEXT: tail bar
25 switch i32 %i, label %if.end3 [
27 i32 7, label %if.then2
31 tail call void @bar() #0
35 tail call void @bar() #0
39 tail call void @bar() #0
43 define void @foo_tail(i1 %i) nounwind {
44 ; CHECK-LABEL: foo_tail:
45 ; CHECK: # %bb.0: # %entry
46 ; CHECK-NEXT: andi a0, a0, 1
47 ; CHECK-NEXT: beqz a0, .LBB1_2
48 ; CHECK-NEXT: # %bb.1: # %if.then
49 ; CHECK-NEXT: tail bar
50 ; CHECK-NEXT: .LBB1_2: # %if.else
51 ; CHECK-NEXT: tail bar
53 br i1 %i, label %if.then, label %if.else
56 tail call void @bar() #0
60 tail call void @bar() #0
69 attributes #0 = { nomerge }