1 ; RUN: llc < %s -march=bpf | FileCheck %s
3 ; Function Attrs: nounwind readnone uwtable
4 define signext i8 @foo_cmp1(i8 signext %a, i8 signext %b) #0 {
5 %1 = icmp sgt i8 %a, %b
6 br i1 %1, label %2, label %4
8 ; <label>:2 ; preds = %0
12 ; <label>:4 ; preds = %0
16 ; <label>:6 ; preds = %4, %2
17 %.0 = phi i8 [ %3, %2 ], [ %5, %4 ]
19 ; CHECK-LABEL:foo_cmp1:
23 ; Function Attrs: nounwind readnone uwtable
24 define signext i8 @foo_cmp2(i8 signext %a, i8 signext %b) #0 {
25 %1 = icmp slt i8 %a, %b
26 br i1 %1, label %4, label %2
28 ; <label>:2 ; preds = %0
32 ; <label>:4 ; preds = %0
36 ; <label>:6 ; preds = %4, %2
37 %.0 = phi i8 [ %3, %2 ], [ %5, %4 ]
39 ; CHECK-LABEL:foo_cmp2:
43 ; Function Attrs: nounwind readnone uwtable
44 define signext i8 @foo_cmp3(i8 signext %a, i8 signext %b) #0 {
45 %1 = icmp slt i8 %a, %b
46 br i1 %1, label %2, label %4
48 ; <label>:2 ; preds = %0
52 ; <label>:4 ; preds = %0
56 ; <label>:6 ; preds = %4, %2
57 %.0 = phi i8 [ %3, %2 ], [ %5, %4 ]
59 ; CHECK-LABEL:foo_cmp3:
63 ; Function Attrs: nounwind readnone uwtable
64 define signext i8 @foo_cmp4(i8 signext %a, i8 signext %b) #0 {
65 %1 = icmp sgt i8 %a, %b
66 br i1 %1, label %4, label %2
68 ; <label>:2 ; preds = %0
72 ; <label>:4 ; preds = %0
76 ; <label>:6 ; preds = %4, %2
77 %.0 = phi i8 [ %3, %2 ], [ %5, %4 ]
79 ; CHECK-LABEL:foo_cmp4:
83 ; Function Attrs: nounwind readnone uwtable
84 define signext i8 @min(i8 signext %a, i8 signext %b) #0 {
85 %1 = icmp slt i8 %a, %b
86 %a.b = select i1 %1, i8 %a, i8 %b
94 ; Function Attrs: nounwind readnone uwtable
95 define zeroext i8 @minu(i8 zeroext %a, i8 zeroext %b) #0 {
96 %1 = icmp ult i8 %a, 100
97 %a.b = select i1 %1, i8 %a, i8 %b
100 ; CHECK: if r{{[0-9]+}} {{<|>}} r{{[0-9]+}}
103 ; Function Attrs: nounwind readnone uwtable
104 define signext i8 @max(i8 signext %a, i8 signext %b) #0 {
105 %1 = icmp sgt i8 %a, %b
106 %a.b = select i1 %1, i8 %a, i8 %b
112 ; Function Attrs: nounwind readnone uwtable
113 define signext i8 @meq(i8 signext %a, i8 signext %b, i8 signext %c) #0 {
114 %1 = icmp eq i8 %a, %b
115 %c.a = select i1 %1, i8 %c, i8 %a