| 1 |
; RUN: llvm-as %s -o %t.bc |
| 2 |
; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_INTEL_fpga_latency_control -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 |
|
| 6 |
; RUN: llvm-spirv -r %t.spv -o %t.rev.bc |
| 7 |
; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM |
| 8 |
|
| 9 |
; CHECK-SPIRV: Capability FPGALatencyControlINTEL |
| 10 |
; CHECK-SPIRV: Extension "SPV_INTEL_fpga_latency_control" |
| 11 |
; CHECK-SPIRV: Decorate [[#ARGA:]] LatencyControlLabelINTEL 0 |
| 12 |
; CHECK-SPIRV: Decorate [[#ARGB:]] LatencyControlLabelINTEL 1 |
| 13 |
; CHECK-SPIRV: Decorate [[#ARGB]] LatencyControlConstraintINTEL 0 1 5 |
| 14 |
; CHECK-SPIRV: Bitcast [[#]] [[#OUT1:]] [[#ARGA]] |
| 15 |
; CHECK-SPIRV-DAG: Bitcast [[#]] [[#OUT2:]] [[#OUT1]] |
| 16 |
; CHECK-SPIRV-DAG: Load [[#]] [[#]] [[#OUT2]] [[#]] [[#]] |
| 17 |
; CHECK-SPIRV: Bitcast [[#]] [[#OUT3:]] [[#ARGB]] |
| 18 |
; CHECK-SPIRV-DAG: Bitcast [[#]] [[#OUT4:]] [[#OUT3]] |
| 19 |
; CHECK-SPIRV-DAG: Load [[#]] [[#]] [[#OUT4]] [[#]] [[#]] |
| 20 |
|
| 21 |
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64" |
| 22 |
target triple = "spir64-unknown-unknown" |
| 23 |
|
| 24 |
%struct.__spirv_Something = type { i32, i32 } |
| 25 |
|
| 26 |
$_ZTSZ4fooEUlvE_ = comdat any |
| 27 |
|
| 28 |
@.str = private unnamed_addr addrspace(1) constant [16 x i8] c"sycl-properties\00", section "llvm.metadata" |
| 29 |
@.str.1 = private unnamed_addr addrspace(1) constant [19 x i8] c"inc/fpga_utils.hpp\00", section "llvm.metadata" |
| 30 |
@.str.9 = private unnamed_addr addrspace(1) constant [11 x i8] c"{6172:\220\22}\00", section "llvm.metadata" |
| 31 |
@.str.10 = private unnamed_addr addrspace(1) constant [25 x i8] c"{6172:\221\22}{6173:\220,1,5\22}\00", section "llvm.metadata" |
| 32 |
|
| 33 |
; CHECK-LLVM: @[[#ANN_STR1:]] = private unnamed_addr constant [27 x i8] c"{sycl-latency-anchor-id:0}\00" |
| 34 |
; CHECK-LLVM: @[[#ANN_STR2:]] = private unnamed_addr constant [58 x i8] c"{sycl-latency-anchor-id:1}{sycl-latency-constraint:0,1,5}\00" |
| 35 |
|
| 36 |
; Function Attrs: mustprogress norecurse |
| 37 |
define weak_odr dso_local spir_kernel void @_ZTSZ4fooEUlvE_(ptr %0) local_unnamed_addr #0 comdat !kernel_arg_buffer_location !5 !sycl_kernel_omit_args !5 { |
| 38 |
entry: |
| 39 |
%1 = alloca ptr, align 8 |
| 40 |
store ptr %0, ptr %1, align 8 |
| 41 |
%2 = load ptr, ptr %1, align 8 |
| 42 |
%3 = getelementptr inbounds %struct.__spirv_Something, ptr %2, i32 0, i32 0 |
| 43 |
%4 = bitcast ptr %3 to ptr |
| 44 |
; CHECK-LLVM: %[[#ANN_PTR1:]] = getelementptr inbounds %struct.__spirv_Something, ptr %[[#]], i32 0, i32 0 |
| 45 |
%5 = call ptr @llvm.ptr.annotation.p0.p1(ptr %4, ptr addrspace(1) @.str.9, ptr addrspace(1) @.str.1, i32 5, ptr addrspace(1) null) |
| 46 |
; CHECK-LLVM: call ptr @llvm.ptr.annotation.p0.p0(ptr %[[#ANN_PTR1]], ptr @[[#ANN_STR1]], ptr undef, i32 undef, ptr undef) |
| 47 |
%6 = load i32, ptr %5, align 8 |
| 48 |
%7 = load ptr, ptr %1, align 8 |
| 49 |
%8 = getelementptr inbounds %struct.__spirv_Something, ptr %7, i32 0, i32 1 |
| 50 |
%9 = bitcast ptr %8 to ptr |
| 51 |
; CHECK-LLVM: %[[#ANN_PTR2:]] = getelementptr inbounds %struct.__spirv_Something, ptr %[[#]], i32 0, i32 1 |
| 52 |
%10 = call ptr @llvm.ptr.annotation.p0.p1(ptr %9, ptr addrspace(1) @.str.10, ptr addrspace(1) @.str.1, i32 5, ptr addrspace(1) null) |
| 53 |
; CHECK-LLVM: call ptr @llvm.ptr.annotation.p0.p0(ptr %[[#ANN_PTR2]], ptr @[[#ANN_STR2]], ptr undef, i32 undef, ptr undef) |
| 54 |
%11 = load i32, ptr %10, align 8 |
| 55 |
ret void |
| 56 |
} |
| 57 |
|
| 58 |
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) |
| 59 |
declare ptr @llvm.ptr.annotation.p0.p1(ptr, ptr addrspace(1), ptr addrspace(1), i32, ptr addrspace(1)) #1 |
| 60 |
|
| 61 |
attributes #0 = { mustprogress norecurse "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "sycl-module-id"="sycl-properties-ptr-annotations.cpp" "uniform-work-group-size"="true" } |
| 62 |
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } |
| 63 |
|
| 64 |
!opencl.spir.version = !{!0, !0, !0, !0, !0, !0} |
| 65 |
!spirv.Source = !{!1, !1, !1, !1, !1, !1} |
| 66 |
!llvm.ident = !{!2, !2, !2, !2, !2, !2} |
| 67 |
!llvm.module.flags = !{!3, !4} |
| 68 |
|
| 69 |
!0 = !{i32 1, i32 2} |
| 70 |
!1 = !{i32 4, i32 100000} |
| 71 |
!2 = !{!"clang version 15.0.0"} |
| 72 |
!3 = !{i32 1, !"wchar_size", i32 4} |
| 73 |
!4 = !{i32 7, !"frame-pointer", i32 2} |
| 74 |
!5 = !{} |