1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=ve | FileCheck %s
4 declare void @foo() noreturn
6 ;;; Check a case where a separate branch is needed and where the original
7 ;;; order should be reversed. Copied from SystemZ/branch-08.ll
9 define i32 @f1(i32 %a, ptr %bptr) {
11 ; CHECK: # %bb.0: # %entry
12 ; CHECK-NEXT: st %s9, (, %s11)
13 ; CHECK-NEXT: st %s10, 8(, %s11)
14 ; CHECK-NEXT: or %s9, 0, %s11
15 ; CHECK-NEXT: lea %s11, -240(, %s11)
16 ; CHECK-NEXT: brge.l %s11, %s8, .LBB0_4
17 ; CHECK-NEXT: # %bb.3: # %entry
18 ; CHECK-NEXT: ld %s61, 24(, %s14)
19 ; CHECK-NEXT: or %s62, 0, %s0
20 ; CHECK-NEXT: lea %s63, 315
21 ; CHECK-NEXT: shm.l %s63, (%s61)
22 ; CHECK-NEXT: shm.l %s8, 8(%s61)
23 ; CHECK-NEXT: shm.l %s11, 16(%s61)
25 ; CHECK-NEXT: or %s0, 0, %s62
26 ; CHECK-NEXT: .LBB0_4: # %entry
27 ; CHECK-NEXT: ldl.sx %s1, (, %s1)
28 ; CHECK-NEXT: cmpu.w %s0, %s1, %s0
29 ; CHECK-NEXT: brlt.w 0, %s0, .LBB0_2
30 ; CHECK-NEXT: # %bb.1: # %return
31 ; CHECK-NEXT: or %s0, 1, (0)1
32 ; CHECK-NEXT: or %s11, 0, %s9
33 ; CHECK-NEXT: ld %s10, 8(, %s11)
34 ; CHECK-NEXT: ld %s9, (, %s11)
35 ; CHECK-NEXT: b.l.t (, %s10)
36 ; CHECK-NEXT: .LBB0_2: # %callit
37 ; CHECK-NEXT: lea %s0, foo@lo
38 ; CHECK-NEXT: and %s0, %s0, (32)0
39 ; CHECK-NEXT: lea.sl %s12, foo@hi(, %s0)
40 ; CHECK-NEXT: bsic %s10, (, %s12)
42 %b = load i32, ptr %bptr
43 %cmp = icmp ult i32 %a, %b
44 br i1 %cmp, label %callit, label %return
54 ;;; Same again with a fused compare and branch.
56 define i32 @f2(i32 %a) {
58 ; CHECK: # %bb.0: # %entry
59 ; CHECK-NEXT: st %s9, (, %s11)
60 ; CHECK-NEXT: st %s10, 8(, %s11)
61 ; CHECK-NEXT: or %s9, 0, %s11
62 ; CHECK-NEXT: lea %s11, -240(, %s11)
63 ; CHECK-NEXT: brge.l %s11, %s8, .LBB1_4
64 ; CHECK-NEXT: # %bb.3: # %entry
65 ; CHECK-NEXT: ld %s61, 24(, %s14)
66 ; CHECK-NEXT: or %s62, 0, %s0
67 ; CHECK-NEXT: lea %s63, 315
68 ; CHECK-NEXT: shm.l %s63, (%s61)
69 ; CHECK-NEXT: shm.l %s8, 8(%s61)
70 ; CHECK-NEXT: shm.l %s11, 16(%s61)
72 ; CHECK-NEXT: or %s0, 0, %s62
73 ; CHECK-NEXT: .LBB1_4: # %entry
74 ; CHECK-NEXT: breq.w 0, %s0, .LBB1_2
75 ; CHECK-NEXT: # %bb.1: # %return
76 ; CHECK-NEXT: or %s0, 1, (0)1
77 ; CHECK-NEXT: or %s11, 0, %s9
78 ; CHECK-NEXT: ld %s10, 8(, %s11)
79 ; CHECK-NEXT: ld %s9, (, %s11)
80 ; CHECK-NEXT: b.l.t (, %s10)
81 ; CHECK-NEXT: .LBB1_2: # %callit
82 ; CHECK-NEXT: lea %s0, foo@lo
83 ; CHECK-NEXT: and %s0, %s0, (32)0
84 ; CHECK-NEXT: lea.sl %s12, foo@hi(, %s0)
85 ; CHECK-NEXT: bsic %s10, (, %s12)
87 %cmp = icmp eq i32 %a, 0
88 br i1 %cmp, label %callit, label %return