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
  120
  121
  122
  123
  124
  125
  126
  127
  128
  129
  130
  131
  132
  133
  134
  135
  136
  137
  138
  139
  140
  141
  142
  143
  144
  145
  146
  147
  148
  149
  150
  151
  152
  153
  154
  155
  156
  157
  158
  159
  160
  161
  162
  163
  164
  165
  166
  167
  168
  169
  170
  171
  172
  173
  174
  175
  176
  177
  178
  179
  180
  181
  182
  183
  184
  185
  186
  187
  188
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
;RUN: llc < %s -mtriple=i686-- -mattr=-slow-incdec | FileCheck %s -check-prefixes=CHECK,SLOW
;RUN: llc < %s -mtriple=i686-- -mattr=+slow-incdec | FileCheck %s -check-prefixes=CHECK,FAST

define void @foo(i32 inreg %dns) minsize {
; CHECK-LABEL: foo:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    xorl %ecx, %ecx
; CHECK-NEXT:    decl %ecx
; CHECK-NEXT:  .LBB0_1: # %for.body
; CHECK-NEXT:    # =>This Inner Loop Header: Depth=1
; CHECK-NEXT:    movzwl %cx, %edx
; CHECK-NEXT:    decl %ecx
; CHECK-NEXT:    cmpl %eax, %edx
; CHECK-NEXT:    jl .LBB0_1
; CHECK-NEXT:  # %bb.2: # %for.end
; CHECK-NEXT:    retl
entry:
  br label %for.body

for.body:
  %i.05 = phi i16 [ %dec, %for.body ], [ 0, %entry ]
  %dec = add i16 %i.05, -1
  %conv = zext i16 %dec to i32
  %cmp = icmp slt i32 %conv, %dns
  br i1 %cmp, label %for.body, label %for.end

for.end:
  ret void
}

define void @bar(i32 inreg %dns) minsize {
; CHECK-LABEL: bar:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    xorl %ecx, %ecx
; CHECK-NEXT:    incl %ecx
; CHECK-NEXT:  .LBB1_1: # %for.body
; CHECK-NEXT:    # =>This Inner Loop Header: Depth=1
; CHECK-NEXT:    movzwl %cx, %edx
; CHECK-NEXT:    incl %ecx
; CHECK-NEXT:    cmpl %eax, %edx
; CHECK-NEXT:    jl .LBB1_1
; CHECK-NEXT:  # %bb.2: # %for.end
; CHECK-NEXT:    retl
entry:
  br label %for.body

for.body:
  %i.05 = phi i16 [ %inc, %for.body ], [ 0, %entry ]
  %inc = add i16 %i.05, 1
  %conv = zext i16 %inc to i32
  %cmp = icmp slt i32 %conv, %dns
  br i1 %cmp, label %for.body, label %for.end
for.end:
  ret void
}

define void @foo_optsize(i32 inreg %dns) optsize {
; CHECK-LABEL: foo_optsize:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    xorl %ecx, %ecx
; CHECK-NEXT:    decl %ecx
; CHECK-NEXT:  .LBB2_1: # %for.body
; CHECK-NEXT:    # =>This Inner Loop Header: Depth=1
; CHECK-NEXT:    movzwl %cx, %edx
; CHECK-NEXT:    decl %ecx
; CHECK-NEXT:    cmpl %eax, %edx
; CHECK-NEXT:    jl .LBB2_1
; CHECK-NEXT:  # %bb.2: # %for.end
; CHECK-NEXT:    retl
entry:
  br label %for.body

for.body:
  %i.05 = phi i16 [ %dec, %for.body ], [ 0, %entry ]
  %dec = add i16 %i.05, -1
  %conv = zext i16 %dec to i32
  %cmp = icmp slt i32 %conv, %dns
  br i1 %cmp, label %for.body, label %for.end

for.end:
  ret void
}

define void @bar_optsize(i32 inreg %dns) optsize {
; CHECK-LABEL: bar_optsize:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    xorl %ecx, %ecx
; CHECK-NEXT:    incl %ecx
; CHECK-NEXT:  .LBB3_1: # %for.body
; CHECK-NEXT:    # =>This Inner Loop Header: Depth=1
; CHECK-NEXT:    movzwl %cx, %edx
; CHECK-NEXT:    incl %ecx
; CHECK-NEXT:    cmpl %eax, %edx
; CHECK-NEXT:    jl .LBB3_1
; CHECK-NEXT:  # %bb.2: # %for.end
; CHECK-NEXT:    retl
entry:
  br label %for.body

for.body:
  %i.05 = phi i16 [ %inc, %for.body ], [ 0, %entry ]
  %inc = add i16 %i.05, 1
  %conv = zext i16 %inc to i32
  %cmp = icmp slt i32 %conv, %dns
  br i1 %cmp, label %for.body, label %for.end
for.end:
  ret void
}

define void @foo_nosize(i32 inreg %dns) {
; SLOW-LABEL: foo_nosize:
; SLOW:       # %bb.0: # %entry
; SLOW-NEXT:    movw $-1, %cx
; SLOW-NEXT:    .p2align 4, 0x90
; SLOW-NEXT:  .LBB4_1: # %for.body
; SLOW-NEXT:    # =>This Inner Loop Header: Depth=1
; SLOW-NEXT:    movzwl %cx, %edx
; SLOW-NEXT:    decl %ecx
; SLOW-NEXT:    cmpl %eax, %edx
; SLOW-NEXT:    jl .LBB4_1
; SLOW-NEXT:  # %bb.2: # %for.end
; SLOW-NEXT:    retl
;
; FAST-LABEL: foo_nosize:
; FAST:       # %bb.0: # %entry
; FAST-NEXT:    movw $-1, %cx
; FAST-NEXT:    .p2align 4, 0x90
; FAST-NEXT:  .LBB4_1: # %for.body
; FAST-NEXT:    # =>This Inner Loop Header: Depth=1
; FAST-NEXT:    movzwl %cx, %edx
; FAST-NEXT:    addl $-1, %ecx
; FAST-NEXT:    cmpl %eax, %edx
; FAST-NEXT:    jl .LBB4_1
; FAST-NEXT:  # %bb.2: # %for.end
; FAST-NEXT:    retl
entry:
  br label %for.body

for.body:
  %i.05 = phi i16 [ %dec, %for.body ], [ 0, %entry ]
  %dec = add i16 %i.05, -1
  %conv = zext i16 %dec to i32
  %cmp = icmp slt i32 %conv, %dns
  br i1 %cmp, label %for.body, label %for.end

for.end:
  ret void
}

define void @bar_nosize(i32 inreg %dns) {
; SLOW-LABEL: bar_nosize:
; SLOW:       # %bb.0: # %entry
; SLOW-NEXT:    movw $1, %cx
; SLOW-NEXT:    .p2align 4, 0x90
; SLOW-NEXT:  .LBB5_1: # %for.body
; SLOW-NEXT:    # =>This Inner Loop Header: Depth=1
; SLOW-NEXT:    movzwl %cx, %edx
; SLOW-NEXT:    incl %ecx
; SLOW-NEXT:    cmpl %eax, %edx
; SLOW-NEXT:    jl .LBB5_1
; SLOW-NEXT:  # %bb.2: # %for.end
; SLOW-NEXT:    retl
;
; FAST-LABEL: bar_nosize:
; FAST:       # %bb.0: # %entry
; FAST-NEXT:    movw $1, %cx
; FAST-NEXT:    .p2align 4, 0x90
; FAST-NEXT:  .LBB5_1: # %for.body
; FAST-NEXT:    # =>This Inner Loop Header: Depth=1
; FAST-NEXT:    movzwl %cx, %edx
; FAST-NEXT:    addl $1, %ecx
; FAST-NEXT:    cmpl %eax, %edx
; FAST-NEXT:    jl .LBB5_1
; FAST-NEXT:  # %bb.2: # %for.end
; FAST-NEXT:    retl
entry:
  br label %for.body

for.body:
  %i.05 = phi i16 [ %inc, %for.body ], [ 0, %entry ]
  %inc = add i16 %i.05, 1
  %conv = zext i16 %inc to i32
  %cmp = icmp slt i32 %conv, %dns
  br i1 %cmp, label %for.body, label %for.end
for.end:
  ret void
}