|
| 1 | +; RUN: llvm-as %s -o %t.bc |
| 2 | +; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_INTEL_fpga_memory_accesses -o %t.spv |
| 3 | +; RUN: llvm-spirv %t.spv -to-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV |
| 4 | + |
| 5 | +; RUN: llvm-spirv -r %t.spv -o %t.rev.bc |
| 6 | +; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM |
| 7 | + |
| 8 | +; CHECK-SPIRV-DAG: Capability FPGAMemoryAccessesINTEL |
| 9 | +; CHECK-SPIRV-DAG: Extension "SPV_INTEL_fpga_memory_accesses" |
| 10 | +; CHECK-SPIRV: Decorate [[#DecTarget:]] BurstCoalesceINTEL |
| 11 | +; CHECK-SPIRV: FunctionCall [[#]] [[#DecTarget]] |
| 12 | + |
| 13 | +; CHECK-LLVM: [[#GV:]] = private unnamed_addr constant [11 x i8] c"{params:1}\00" |
| 14 | +; CHECK-LLVM: %[[Call:[a-z0-9_.]+]] = call spir_func ptr addrspace(4) @accessor |
| 15 | +; CHECK-LLVM: %[[#Ann:]] = call ptr addrspace(4) @llvm.ptr.annotation.p4.p0(ptr addrspace(4) %call, ptr @[[#GV]], ptr undef, i32 undef, ptr undef) |
| 16 | +; CHECK-LLVM: call spir_func ptr addrspace(4) @_ZN8MyStructaSERKS_(ptr addrspace(4) %[[#Ann]] |
| 17 | + |
| 18 | +; ModuleID = 'test.bc' |
| 19 | +source_filename = "llvm-link" |
| 20 | +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" |
| 21 | +target triple = "spir64-unknown-unknown" |
| 22 | + |
| 23 | +%struct.MyStruct = type { i32 } |
| 24 | + |
| 25 | +$_ZN8MyStructaSERKS_ = comdat any |
| 26 | + |
| 27 | +$accessor = comdat any |
| 28 | + |
| 29 | +@.str.1 = private unnamed_addr addrspace(1) constant [14 x i8] c"<invalid loc>\00", section "llvm.metadata" |
| 30 | +@.str.2 = private unnamed_addr addrspace(1) constant [11 x i8] c"{params:1}\00", section "llvm.metadata" |
| 31 | + |
| 32 | +define spir_func void @foo(ptr %Ptr, ptr byval(%struct.MyStruct) align 4 %Val) { |
| 33 | +entry: |
| 34 | + %Ptr.ascast = addrspacecast ptr %Ptr to ptr addrspace(4) |
| 35 | + %Val.ascast = addrspacecast ptr %Val to ptr addrspace(4) |
| 36 | + %call = call spir_func noundef ptr addrspace(4) @accessor(ptr addrspace(4) %Ptr.ascast) |
| 37 | + %0 = call ptr addrspace(4) @llvm.ptr.annotation.p4.p1(ptr addrspace(4) %call, ptr addrspace(1) @.str.2, ptr addrspace(1) @.str.1, i32 0, ptr addrspace(1) null) |
| 38 | + %call1 = call spir_func ptr addrspace(4) @_ZN8MyStructaSERKS_(ptr addrspace(4) %0, ptr addrspace(4) %Val.ascast) |
| 39 | + ret void |
| 40 | +} |
| 41 | + |
| 42 | +declare ptr addrspace(4) @llvm.ptr.annotation.p4.p1(ptr addrspace(4), ptr addrspace(1), ptr addrspace(1), i32, ptr addrspace(1)) |
| 43 | + |
| 44 | +declare spir_func ptr addrspace(4) @_ZN8MyStructaSERKS_(ptr addrspace(4) %this, ptr addrspace(4) %op) |
| 45 | + |
| 46 | +declare spir_func ptr addrspace(4) @accessor(ptr addrspace(4) %this) |
0 commit comments