|
| 1 | +; Check that !spirv.Decorations are handled on FPGA functions as well as global variables |
| 2 | +; RUN: llvm-as %s -o %t.bc |
| 3 | +; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_INTEL_fpga_invocation_pipelining_attributes -spirv-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV |
| 4 | +; RUN: llvm-spirv --spirv-ext=+SPV_INTEL_fpga_invocation_pipelining_attributes %t.bc -o %t.spv |
| 5 | +; RUN: llvm-spirv --spirv-ext=+SPV_INTEL_fpga_invocation_pipelining_attributes -r -emit-opaque-pointers %t.spv --spirv-target-env=SPV-IR -o %t.rev.bc |
| 6 | +; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-SPV-IR |
| 7 | +; RUN: llvm-spirv -r --spirv-ext=+SPV_INTEL_fpga_invocation_pipelining_attributes -emit-opaque-pointers %t.spv --spirv-target-env=SPV-IR -o %t.rev.bc |
| 8 | +; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM |
| 9 | + |
| 10 | +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" |
| 11 | +target triple = "spir" |
| 12 | + |
| 13 | +; Function Attrs: convergent nounwind |
| 14 | +define spir_kernel void @k(float %a, float %b, float %c) #0 !kernel_arg_addr_space !4 !kernel_arg_access_qual !5 !kernel_arg_type !6 !kernel_arg_type_qual !7 !kernel_arg_base_type !6 !spirv.Decorations !9 { |
| 15 | +entry: |
| 16 | + ret void |
| 17 | +} |
| 18 | + |
| 19 | +; CHECK-SPIRV: Decorate [[PId1:[0-9]+]] PipelineEnableINTEL 1 |
| 20 | +; CHECK-SPIRV: Decorate [[PId1]] InitiationIntervalINTEL 2 |
| 21 | + |
| 22 | +!llvm.module.flags = !{!0} |
| 23 | +!opencl.ocl.version = !{!1} |
| 24 | +!opencl.spir.version = !{!2} |
| 25 | +!llvm.ident = !{!3} |
| 26 | + |
| 27 | +!0 = !{i32 1, !"wchar_size", i32 4} |
| 28 | +!1 = !{i32 1, i32 0} |
| 29 | +!2 = !{i32 1, i32 2} |
| 30 | +!3 = !{!"clang version 14.0.0"} |
| 31 | +!4 = !{i32 0, i32 0, i32 0} |
| 32 | +!5 = !{!"none", !"none", !"none"} |
| 33 | +!6 = !{!"float", !"float", !"float"} |
| 34 | +!7 = !{!"", !"", !""} |
| 35 | +!8 = !{i32 19} |
| 36 | +!9 = !{!10, !11} |
| 37 | +!10 = !{i32 5919, i32 1} |
| 38 | +!11 = !{i32 5917, i32 2} |
| 39 | + |
| 40 | +; CHECK-SPV-IR: define spir_kernel void @k(float %a, float %b, float %c) {{.*}} !initiation_interval ![[II:[0-9]+]] !disable_loop_pipelining ![[DISABLE_LOOP_PIPELINING:[0-9]+]] { |
| 41 | +; CHECK-SPV-IR-DAG: ![[II]] = !{i32 2} |
| 42 | +; CHECK-SPV-IR-DAG: ![[DISABLE_LOOP_PIPELINING]] = !{i32 0} |
| 43 | + |
| 44 | +; CHECK-LLVM-NOT: define spir_kernel void @k(float %a, float %b, float %c) {{.*}} !spirv.Decorations ![[DecoListId:[0-9]+]] { |
| 45 | +; CHECK-LLVM: define spir_kernel void @k(float %a, float %b, float %c) {{.*}} { |
0 commit comments