| 1 |
; RUN: llvm-as %s -o %t.bc |
| 2 |
; RUN: llvm-spirv %t.bc -o %t.spv |
| 3 |
; RUN: llvm-spirv %t.spv -to-text -o %t.spt |
| 4 |
; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV |
| 5 |
; RUN: spirv-val %t.spv |
| 6 |
|
| 7 |
; RUN: llvm-spirv -r %t.spv -o %t.rev.bc |
| 8 |
; RUN: llvm-dis %t.rev.bc |
| 9 |
; RUN: FileCheck < %t.rev.ll %s --check-prefix=CHECK-LLVM |
| 10 |
|
| 11 |
; SPIR-V 1.5 |
| 12 |
; CHECK-SPIRV: 66816 |
| 13 |
|
| 14 |
; CHECK-SPIRV-NOT: LessOrGreater |
| 15 |
; CHECK-SPIRV: FOrdNotEqual |
| 16 |
|
| 17 |
target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" |
| 18 |
target triple = "spir64-unknown-unknown" |
| 19 |
|
| 20 |
; Function Attrs: nounwind |
| 21 |
define spir_kernel void @test(float %a) local_unnamed_addr #0 { |
| 22 |
entry: |
| 23 |
; CHECK-LLVM: fcmp one float %a, %a |
| 24 |
%call = tail call spir_func i1 @_Z21__spirv_LessOrGreater(float %a, float %a) |
| 25 |
ret void |
| 26 |
} |
| 27 |
|
| 28 |
; This is needed to check that 1.5 is enabled |
| 29 |
define dso_local spir_kernel void @test2(i16 noundef signext %a, i32 noundef %id) local_unnamed_addr #0 { |
| 30 |
entry: |
| 31 |
%call = tail call spir_func signext i16 @_Z31sub_group_non_uniform_broadcastsj(i16 noundef signext %a, i32 noundef %id) |
| 32 |
ret void |
| 33 |
} |
| 34 |
|
| 35 |
declare spir_func noundef i1 @_Z21__spirv_LessOrGreater(float, float) |
| 36 |
declare spir_func signext i16 @_Z31sub_group_non_uniform_broadcastsj(i16 noundef signext, i32 noundef) |
| 37 |
|
| 38 |
attributes #0 = { convergent nounwind writeonly } |
| 39 |
|
| 40 |
!llvm.module.flags = !{!0} |
| 41 |
!opencl.ocl.version = !{!1} |
| 42 |
!opencl.spir.version = !{!1} |
| 43 |
|
| 44 |
!0 = !{i32 1, !"wchar_size", i32 4} |
| 45 |
!1 = !{i32 2, i32 0} |