xref: /aosp_15_r20/external/llvm/test/CodeGen/SystemZ/branch-10.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; Test all condition-code masks that are relevant for CLGRJ.
2*9880d681SAndroid Build Coastguard Worker;
3*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Workerdeclare i64 @foo()
6*9880d681SAndroid Build Coastguard Worker@g1 = global i16 0
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Workerdefine void @f1(i64 %target) {
9*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f1:
10*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_def_cfa_offset
11*9880d681SAndroid Build Coastguard Worker; CHECK: .L[[LABEL:.*]]:
12*9880d681SAndroid Build Coastguard Worker; CHECK: clgrjle %r2, {{%r[0-9]+}}, .L[[LABEL]]
13*9880d681SAndroid Build Coastguard Worker  br label %loop
14*9880d681SAndroid Build Coastguard Workerloop:
15*9880d681SAndroid Build Coastguard Worker  %val = call i64 @foo()
16*9880d681SAndroid Build Coastguard Worker  %cond = icmp ule i64 %val, %target
17*9880d681SAndroid Build Coastguard Worker  br i1 %cond, label %loop, label %exit
18*9880d681SAndroid Build Coastguard Workerexit:
19*9880d681SAndroid Build Coastguard Worker  ret void
20*9880d681SAndroid Build Coastguard Worker}
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Workerdefine void @f2(i64 %target) {
23*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f2:
24*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_def_cfa_offset
25*9880d681SAndroid Build Coastguard Worker; CHECK: .L[[LABEL:.*]]:
26*9880d681SAndroid Build Coastguard Worker; CHECK: clgrjl %r2, {{%r[0-9]+}}, .L[[LABEL]]
27*9880d681SAndroid Build Coastguard Worker  br label %loop
28*9880d681SAndroid Build Coastguard Workerloop:
29*9880d681SAndroid Build Coastguard Worker  %val = call i64 @foo()
30*9880d681SAndroid Build Coastguard Worker  %cond = icmp ult i64 %val, %target
31*9880d681SAndroid Build Coastguard Worker  br i1 %cond, label %loop, label %exit
32*9880d681SAndroid Build Coastguard Workerexit:
33*9880d681SAndroid Build Coastguard Worker  ret void
34*9880d681SAndroid Build Coastguard Worker}
35*9880d681SAndroid Build Coastguard Worker
36*9880d681SAndroid Build Coastguard Workerdefine void @f3(i64 %target) {
37*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f3:
38*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_def_cfa_offset
39*9880d681SAndroid Build Coastguard Worker; CHECK: .L[[LABEL:.*]]:
40*9880d681SAndroid Build Coastguard Worker; CHECK: clgrjh %r2, {{%r[0-9]+}}, .L[[LABEL]]
41*9880d681SAndroid Build Coastguard Worker  br label %loop
42*9880d681SAndroid Build Coastguard Workerloop:
43*9880d681SAndroid Build Coastguard Worker  %val = call i64 @foo()
44*9880d681SAndroid Build Coastguard Worker  %cond = icmp ugt i64 %val, %target
45*9880d681SAndroid Build Coastguard Worker  br i1 %cond, label %loop, label %exit
46*9880d681SAndroid Build Coastguard Workerexit:
47*9880d681SAndroid Build Coastguard Worker  ret void
48*9880d681SAndroid Build Coastguard Worker}
49*9880d681SAndroid Build Coastguard Worker
50*9880d681SAndroid Build Coastguard Workerdefine void @f4(i64 %target) {
51*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f4:
52*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_def_cfa_offset
53*9880d681SAndroid Build Coastguard Worker; CHECK: .L[[LABEL:.*]]:
54*9880d681SAndroid Build Coastguard Worker; CHECK: clgrjhe %r2, {{%r[0-9]+}}, .L[[LABEL]]
55*9880d681SAndroid Build Coastguard Worker  br label %loop
56*9880d681SAndroid Build Coastguard Workerloop:
57*9880d681SAndroid Build Coastguard Worker  %val = call i64 @foo()
58*9880d681SAndroid Build Coastguard Worker  %cond = icmp uge i64 %val, %target
59*9880d681SAndroid Build Coastguard Worker  br i1 %cond, label %loop, label %exit
60*9880d681SAndroid Build Coastguard Workerexit:
61*9880d681SAndroid Build Coastguard Worker  ret void
62*9880d681SAndroid Build Coastguard Worker}
63