reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
   92
   93
   94
   95
   96
   97
   98
   99
  100
  101
  102
  103
  104
  105
  106
  107
  108
  109
  110
  111
  112
  113
  114
  115
  116
  117
  118
  119
; RUN: llc < %s -march=bpf | FileCheck %s

; Function Attrs: nounwind readnone uwtable
define signext i8 @foo_cmp1(i8 signext %a, i8 signext %b) #0 {
  %1 = icmp sgt i8 %a, %b
  br i1 %1, label %2, label %4

; <label>:2                                       ; preds = %0
  %3 = mul i8 %b, %a
  br label %6

; <label>:4                                       ; preds = %0
  %5 = shl i8 %b, 3
  br label %6

; <label>:6                                       ; preds = %4, %2
  %.0 = phi i8 [ %3, %2 ], [ %5, %4 ]
  ret i8 %.0
; CHECK-LABEL:foo_cmp1:
; CHECK: if r0 s>= r1
}

; Function Attrs: nounwind readnone uwtable
define signext i8 @foo_cmp2(i8 signext %a, i8 signext %b) #0 {
  %1 = icmp slt i8 %a, %b
  br i1 %1, label %4, label %2

; <label>:2                                       ; preds = %0
  %3 = mul i8 %b, %a
  br label %6

; <label>:4                                       ; preds = %0
  %5 = shl i8 %b, 3
  br label %6

; <label>:6                                       ; preds = %4, %2
  %.0 = phi i8 [ %3, %2 ], [ %5, %4 ]
  ret i8 %.0
; CHECK-LABEL:foo_cmp2:
; CHECK: if r0 s> r1
}

; Function Attrs: nounwind readnone uwtable
define signext i8 @foo_cmp3(i8 signext %a, i8 signext %b) #0 {
  %1 = icmp slt i8 %a, %b
  br i1 %1, label %2, label %4

; <label>:2                                       ; preds = %0
  %3 = mul i8 %b, %a
  br label %6

; <label>:4                                       ; preds = %0
  %5 = shl i8 %b, 3
  br label %6

; <label>:6                                       ; preds = %4, %2
  %.0 = phi i8 [ %3, %2 ], [ %5, %4 ]
  ret i8 %.0
; CHECK-LABEL:foo_cmp3:
; CHECK: if r1 s>= r0
}

; Function Attrs: nounwind readnone uwtable
define signext i8 @foo_cmp4(i8 signext %a, i8 signext %b) #0 {
  %1 = icmp sgt i8 %a, %b
  br i1 %1, label %4, label %2

; <label>:2                                       ; preds = %0
  %3 = mul i8 %b, %a
  br label %6

; <label>:4                                       ; preds = %0
  %5 = shl i8 %b, 3
  br label %6

; <label>:6                                       ; preds = %4, %2
  %.0 = phi i8 [ %3, %2 ], [ %5, %4 ]
  ret i8 %.0
; CHECK-LABEL:foo_cmp4:
; CHECK: if r1 s> r0
}

; Function Attrs: nounwind readnone uwtable
define signext i8 @min(i8 signext %a, i8 signext %b) #0 {
  %1 = icmp slt i8 %a, %b
  %a.b = select i1 %1, i8 %a, i8 %b
  ret i8 %a.b
; CHECK-LABEL:min:
; CHECK: r0 = r1
; CHECK: if r2 s> r0
; CHECK: r0 = r2
}

; Function Attrs: nounwind readnone uwtable
define zeroext i8 @minu(i8 zeroext %a, i8 zeroext %b) #0 {
  %1 = icmp ult i8 %a, 100
  %a.b = select i1 %1, i8 %a, i8 %b
  ret i8 %a.b
; CHECK-LABEL:minu:
; CHECK: if r{{[0-9]+}} {{<|>}} r{{[0-9]+}}
}

; Function Attrs: nounwind readnone uwtable
define signext i8 @max(i8 signext %a, i8 signext %b) #0 {
  %1 = icmp sgt i8 %a, %b
  %a.b = select i1 %1, i8 %a, i8 %b
  ret i8 %a.b
; CHECK-LABEL:max:
; CHECK: if r0 s> r2
}

; Function Attrs: nounwind readnone uwtable
define signext i8 @meq(i8 signext %a, i8 signext %b, i8 signext %c) #0 {
  %1 = icmp eq i8 %a, %b
  %c.a = select i1 %1, i8 %c, i8 %a
  ret i8 %c.a
; CHECK-LABEL:meq:
; CHECK: if r1 == r2
}