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
  189
  190
  191
  192
  193
  194
  195
  196
  197
  198
  199
  200
  201
  202
  203
  204
  205
  206
  207
  208
  209
  210
  211
  212
  213
  214
  215
  216
  217
  218
  219
  220
  221
  222
  223
  224
  225
  226
  227
  228
  229
  230
  231
  232
  233
  234
  235
  236
  237
  238
  239
  240
  241
  242
  243
  244
  245
  246
  247
  248
  249
  250
  251
  252
  253
  254
  255
  256
  257
  258
  259
  260
  261
  262
  263
  264
  265
  266
; RUN: llc -march=amdgcn < %s | FileCheck -check-prefixes=GCN,SI %s
; RUN: llc -march=amdgcn -mcpu=tonga < %s | FileCheck -check-prefixes=GCN,VI %s
; RUN: llc -march=amdgcn -mcpu=gfx900 < %s | FileCheck -check-prefixes=GCN,GFX9 %s

; GCN-LABEL: {{^}}v_test_imax3_sgt_i32:
; GCN: v_max3_i32
define amdgpu_kernel void @v_test_imax3_sgt_i32(i32 addrspace(1)* %out, i32 addrspace(1)* %aptr, i32 addrspace(1)* %bptr, i32 addrspace(1)* %cptr) #0 {
  %tid = call i32 @llvm.amdgcn.workitem.id.x()
  %gep0 = getelementptr i32, i32 addrspace(1)* %aptr, i32 %tid
  %gep1 = getelementptr i32, i32 addrspace(1)* %bptr, i32 %tid
  %gep2 = getelementptr i32, i32 addrspace(1)* %cptr, i32 %tid
  %outgep = getelementptr i32, i32 addrspace(1)* %out, i32 %tid
  %a = load i32, i32 addrspace(1)* %gep0
  %b = load i32, i32 addrspace(1)* %gep1
  %c = load i32, i32 addrspace(1)* %gep2
  %icmp0 = icmp sgt i32 %a, %b
  %i0 = select i1 %icmp0, i32 %a, i32 %b
  %icmp1 = icmp sgt i32 %i0, %c
  %i1 = select i1 %icmp1, i32 %i0, i32 %c
  store i32 %i1, i32 addrspace(1)* %out
  ret void
}

; GCN-LABEL: {{^}}v_test_umax3_ugt_i32:
; GCN: v_max3_u32
define amdgpu_kernel void @v_test_umax3_ugt_i32(i32 addrspace(1)* %out, i32 addrspace(1)* %aptr, i32 addrspace(1)* %bptr, i32 addrspace(1)* %cptr) #0 {
  %tid = call i32 @llvm.amdgcn.workitem.id.x()
  %gep0 = getelementptr i32, i32 addrspace(1)* %aptr, i32 %tid
  %gep1 = getelementptr i32, i32 addrspace(1)* %bptr, i32 %tid
  %gep2 = getelementptr i32, i32 addrspace(1)* %cptr, i32 %tid
  %outgep = getelementptr i32, i32 addrspace(1)* %out, i32 %tid
  %a = load i32, i32 addrspace(1)* %gep0
  %b = load i32, i32 addrspace(1)* %gep1
  %c = load i32, i32 addrspace(1)* %gep2
  %icmp0 = icmp ugt i32 %a, %b
  %i0 = select i1 %icmp0, i32 %a, i32 %b
  %icmp1 = icmp ugt i32 %i0, %c
  %i1 = select i1 %icmp1, i32 %i0, i32 %c
  store i32 %i1, i32 addrspace(1)* %out
  ret void
}

; GCN-LABEL: {{^}}v_test_imax3_sgt_i16:
; SI: v_max3_i32

; VI: v_max_i16
; VI: v_max_i16

; GFX9: v_max3_i16
define amdgpu_kernel void @v_test_imax3_sgt_i16(i16 addrspace(1)* %out, i16 addrspace(1)* %aptr, i16 addrspace(1)* %bptr, i16 addrspace(1)* %cptr) #0 {
  %tid = call i32 @llvm.amdgcn.workitem.id.x()
  %gep0 = getelementptr i16, i16 addrspace(1)* %aptr, i32 %tid
  %gep1 = getelementptr i16, i16 addrspace(1)* %bptr, i32 %tid
  %gep2 = getelementptr i16, i16 addrspace(1)* %cptr, i32 %tid
  %outgep = getelementptr i16, i16 addrspace(1)* %out, i32 %tid
  %a = load i16, i16 addrspace(1)* %gep0
  %b = load i16, i16 addrspace(1)* %gep1
  %c = load i16, i16 addrspace(1)* %gep2
  %icmp0 = icmp sgt i16 %a, %b
  %i0 = select i1 %icmp0, i16 %a, i16 %b
  %icmp1 = icmp sgt i16 %i0, %c
  %i1 = select i1 %icmp1, i16 %i0, i16 %c
  store i16 %i1, i16 addrspace(1)* %out
  ret void
}

; GCN-LABEL: {{^}}v_test_umax3_ugt_i16:
; SI: v_max3_u32

; VI: v_max_u16
; VI: v_max_u16

; GFX9: v_max3_u16
define amdgpu_kernel void @v_test_umax3_ugt_i16(i16 addrspace(1)* %out, i16 addrspace(1)* %aptr, i16 addrspace(1)* %bptr, i16 addrspace(1)* %cptr) #0 {
  %tid = call i32 @llvm.amdgcn.workitem.id.x()
  %gep0 = getelementptr i16, i16 addrspace(1)* %aptr, i32 %tid
  %gep1 = getelementptr i16, i16 addrspace(1)* %bptr, i32 %tid
  %gep2 = getelementptr i16, i16 addrspace(1)* %cptr, i32 %tid
  %outgep = getelementptr i16, i16 addrspace(1)* %out, i32 %tid
  %a = load i16, i16 addrspace(1)* %gep0
  %b = load i16, i16 addrspace(1)* %gep1
  %c = load i16, i16 addrspace(1)* %gep2
  %icmp0 = icmp ugt i16 %a, %b
  %i0 = select i1 %icmp0, i16 %a, i16 %b
  %icmp1 = icmp ugt i16 %i0, %c
  %i1 = select i1 %icmp1, i16 %i0, i16 %c
  store i16 %i1, i16 addrspace(1)* %out
  ret void
}

; GCN-LABEL: {{^}}v_test_imax3_sgt_i8:
; SI: v_max3_i32

; VI: v_max_i16
; VI: v_max_i16

; GFX9: v_max3_i16
define amdgpu_kernel void @v_test_imax3_sgt_i8(i8 addrspace(1)* %out, i8 addrspace(1)* %aptr, i8 addrspace(1)* %bptr, i8 addrspace(1)* %cptr) #0 {
  %tid = call i32 @llvm.amdgcn.workitem.id.x()
  %gep0 = getelementptr i8, i8 addrspace(1)* %aptr, i32 %tid
  %gep1 = getelementptr i8, i8 addrspace(1)* %bptr, i32 %tid
  %gep2 = getelementptr i8, i8 addrspace(1)* %cptr, i32 %tid
  %outgep = getelementptr i8, i8 addrspace(1)* %out, i32 %tid
  %a = load i8, i8 addrspace(1)* %gep0
  %b = load i8, i8 addrspace(1)* %gep1
  %c = load i8, i8 addrspace(1)* %gep2
  %icmp0 = icmp sgt i8 %a, %b
  %i0 = select i1 %icmp0, i8 %a, i8 %b
  %icmp1 = icmp sgt i8 %i0, %c
  %i1 = select i1 %icmp1, i8 %i0, i8 %c
  store i8 %i1, i8 addrspace(1)* %out
  ret void
}

; GCN-LABEL: {{^}}v_test_umax3_ugt_i8:
; SI: v_max3_u32

; VI: v_max_u16
; VI: v_max_u16

; GFX9: v_max3_u16
define amdgpu_kernel void @v_test_umax3_ugt_i8(i8 addrspace(1)* %out, i8 addrspace(1)* %aptr, i8 addrspace(1)* %bptr, i8 addrspace(1)* %cptr) #0 {
  %tid = call i32 @llvm.amdgcn.workitem.id.x()
  %gep0 = getelementptr i8, i8 addrspace(1)* %aptr, i32 %tid
  %gep1 = getelementptr i8, i8 addrspace(1)* %bptr, i32 %tid
  %gep2 = getelementptr i8, i8 addrspace(1)* %cptr, i32 %tid
  %outgep = getelementptr i8, i8 addrspace(1)* %out, i32 %tid
  %a = load i8, i8 addrspace(1)* %gep0
  %b = load i8, i8 addrspace(1)* %gep1
  %c = load i8, i8 addrspace(1)* %gep2
  %icmp0 = icmp ugt i8 %a, %b
  %i0 = select i1 %icmp0, i8 %a, i8 %b
  %icmp1 = icmp ugt i8 %i0, %c
  %i1 = select i1 %icmp1, i8 %i0, i8 %c
  store i8 %i1, i8 addrspace(1)* %out
  ret void
}

; GCN-LABEL: {{^}}v_test_imax3_sgt_i7:
; SI: v_max3_i32

; VI: v_max_i16
; VI: v_max_i16

; GFX9: v_max3_i16
define amdgpu_kernel void @v_test_imax3_sgt_i7(i7 addrspace(1)* %out, i7 addrspace(1)* %aptr, i7 addrspace(1)* %bptr, i7 addrspace(1)* %cptr) #0 {
  %tid = call i32 @llvm.amdgcn.workitem.id.x()
  %gep0 = getelementptr i7, i7 addrspace(1)* %aptr, i32 %tid
  %gep1 = getelementptr i7, i7 addrspace(1)* %bptr, i32 %tid
  %gep2 = getelementptr i7, i7 addrspace(1)* %cptr, i32 %tid
  %outgep = getelementptr i7, i7 addrspace(1)* %out, i32 %tid
  %a = load i7, i7 addrspace(1)* %gep0
  %b = load i7, i7 addrspace(1)* %gep1
  %c = load i7, i7 addrspace(1)* %gep2
  %icmp0 = icmp sgt i7 %a, %b
  %i0 = select i1 %icmp0, i7 %a, i7 %b
  %icmp1 = icmp sgt i7 %i0, %c
  %i1 = select i1 %icmp1, i7 %i0, i7 %c
  store i7 %i1, i7 addrspace(1)* %out
  ret void
}

; GCN-LABEL: {{^}}v_test_umax3_ugt_i7:
; SI: v_max3_u32

; VI: v_max_u16
; VI: v_max_u16

; GFX9: v_max3_u16
define amdgpu_kernel void @v_test_umax3_ugt_i7(i7 addrspace(1)* %out, i7 addrspace(1)* %aptr, i7 addrspace(1)* %bptr, i7 addrspace(1)* %cptr) #0 {
  %tid = call i32 @llvm.amdgcn.workitem.id.x()
  %gep0 = getelementptr i7, i7 addrspace(1)* %aptr, i32 %tid
  %gep1 = getelementptr i7, i7 addrspace(1)* %bptr, i32 %tid
  %gep2 = getelementptr i7, i7 addrspace(1)* %cptr, i32 %tid
  %outgep = getelementptr i7, i7 addrspace(1)* %out, i32 %tid
  %a = load i7, i7 addrspace(1)* %gep0
  %b = load i7, i7 addrspace(1)* %gep1
  %c = load i7, i7 addrspace(1)* %gep2
  %icmp0 = icmp ugt i7 %a, %b
  %i0 = select i1 %icmp0, i7 %a, i7 %b
  %icmp1 = icmp ugt i7 %i0, %c
  %i1 = select i1 %icmp1, i7 %i0, i7 %c
  store i7 %i1, i7 addrspace(1)* %out
  ret void
}

; GCN-LABEL: {{^}}v_test_imax3_sgt_i33:
; GCN-NOT: v_max3
define amdgpu_kernel void @v_test_imax3_sgt_i33(i33 addrspace(1)* %out, i33 addrspace(1)* %aptr, i33 addrspace(1)* %bptr, i33 addrspace(1)* %cptr) #0 {
  %tid = call i32 @llvm.amdgcn.workitem.id.x()
  %gep0 = getelementptr i33, i33 addrspace(1)* %aptr, i32 %tid
  %gep1 = getelementptr i33, i33 addrspace(1)* %bptr, i32 %tid
  %gep2 = getelementptr i33, i33 addrspace(1)* %cptr, i32 %tid
  %outgep = getelementptr i33, i33 addrspace(1)* %out, i32 %tid
  %a = load i33, i33 addrspace(1)* %gep0
  %b = load i33, i33 addrspace(1)* %gep1
  %c = load i33, i33 addrspace(1)* %gep2
  %icmp0 = icmp sgt i33 %a, %b
  %i0 = select i1 %icmp0, i33 %a, i33 %b
  %icmp1 = icmp sgt i33 %i0, %c
  %i1 = select i1 %icmp1, i33 %i0, i33 %c
  store i33 %i1, i33 addrspace(1)* %out
  ret void
}

; GCN-LABEL: {{^}}v_test_umax3_ugt_i33:
; GCN-NOT: v_max3
define amdgpu_kernel void @v_test_umax3_ugt_i33(i33 addrspace(1)* %out, i33 addrspace(1)* %aptr, i33 addrspace(1)* %bptr, i33 addrspace(1)* %cptr) #0 {
  %tid = call i32 @llvm.amdgcn.workitem.id.x()
  %gep0 = getelementptr i33, i33 addrspace(1)* %aptr, i32 %tid
  %gep1 = getelementptr i33, i33 addrspace(1)* %bptr, i32 %tid
  %gep2 = getelementptr i33, i33 addrspace(1)* %cptr, i32 %tid
  %outgep = getelementptr i33, i33 addrspace(1)* %out, i32 %tid
  %a = load i33, i33 addrspace(1)* %gep0
  %b = load i33, i33 addrspace(1)* %gep1
  %c = load i33, i33 addrspace(1)* %gep2
  %icmp0 = icmp ugt i33 %a, %b
  %i0 = select i1 %icmp0, i33 %a, i33 %b
  %icmp1 = icmp ugt i33 %i0, %c
  %i1 = select i1 %icmp1, i33 %i0, i33 %c
  store i33 %i1, i33 addrspace(1)* %out
  ret void
}

; GCN-LABEL: {{^}}v_test_imax3_sgt_i64:
; GCN-NOT: v_max3
define amdgpu_kernel void @v_test_imax3_sgt_i64(i64 addrspace(1)* %out, i64 addrspace(1)* %aptr, i64 addrspace(1)* %bptr, i64 addrspace(1)* %cptr) #0 {
  %tid = call i32 @llvm.amdgcn.workitem.id.x()
  %gep0 = getelementptr i64, i64 addrspace(1)* %aptr, i32 %tid
  %gep1 = getelementptr i64, i64 addrspace(1)* %bptr, i32 %tid
  %gep2 = getelementptr i64, i64 addrspace(1)* %cptr, i32 %tid
  %outgep = getelementptr i64, i64 addrspace(1)* %out, i32 %tid
  %a = load i64, i64 addrspace(1)* %gep0
  %b = load i64, i64 addrspace(1)* %gep1
  %c = load i64, i64 addrspace(1)* %gep2
  %icmp0 = icmp sgt i64 %a, %b
  %i0 = select i1 %icmp0, i64 %a, i64 %b
  %icmp1 = icmp sgt i64 %i0, %c
  %i1 = select i1 %icmp1, i64 %i0, i64 %c
  store i64 %i1, i64 addrspace(1)* %out
  ret void
}

; GCN-LABEL: {{^}}v_test_umax3_ugt_i64:
; GCN-NOT: v_max3
define amdgpu_kernel void @v_test_umax3_ugt_i64(i64 addrspace(1)* %out, i64 addrspace(1)* %aptr, i64 addrspace(1)* %bptr, i64 addrspace(1)* %cptr) #0 {
  %tid = call i32 @llvm.amdgcn.workitem.id.x()
  %gep0 = getelementptr i64, i64 addrspace(1)* %aptr, i32 %tid
  %gep1 = getelementptr i64, i64 addrspace(1)* %bptr, i32 %tid
  %gep2 = getelementptr i64, i64 addrspace(1)* %cptr, i32 %tid
  %outgep = getelementptr i64, i64 addrspace(1)* %out, i32 %tid
  %a = load i64, i64 addrspace(1)* %gep0
  %b = load i64, i64 addrspace(1)* %gep1
  %c = load i64, i64 addrspace(1)* %gep2
  %icmp0 = icmp ugt i64 %a, %b
  %i0 = select i1 %icmp0, i64 %a, i64 %b
  %icmp1 = icmp ugt i64 %i0, %c
  %i1 = select i1 %icmp1, i64 %i0, i64 %c
  store i64 %i1, i64 addrspace(1)* %out
  ret void
}

declare i32 @llvm.amdgcn.workitem.id.x() #1

attributes #0 = { nounwind }
attributes #1 = { nounwind readnone speculatable }