File: link-attribute.ll

package info (click to toggle)
swiftlang 6.1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,791,604 kB
  • sloc: cpp: 9,901,740; ansic: 2,201,431; asm: 1,091,827; python: 308,252; objc: 82,166; f90: 80,126; lisp: 38,358; pascal: 25,559; sh: 20,429; ml: 5,058; perl: 4,745; makefile: 4,484; awk: 3,535; javascript: 3,018; xml: 918; fortran: 664; cs: 573; ruby: 396
file content (31 lines) | stat: -rw-r--r-- 1,633 bytes parent folder | download | duplicates (7)
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
; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s

; CHECK: OpDecorate %[[#ID:]] LinkageAttributes "imageSampler" Export
; CHECK: %[[#ID]] = OpVariable %[[#]] UniformConstant %[[#]]

@imageSampler = addrspace(2) constant i32 36, align 4

define spir_kernel void @sample_kernel(target("spirv.Image", void, 1, 0, 0, 0, 0, 0, 0) %input, ptr addrspace(1) nocapture %xOffsets, ptr addrspace(1) nocapture %yOffsets, ptr addrspace(1) nocapture %results) {
  %1 = tail call spir_func i64 @_Z13get_global_idj(i32 0)
  %2 = trunc i64 %1 to i32
  %3 = tail call spir_func i64 @_Z13get_global_idj(i32 1)
  %4 = trunc i64 %3 to i32
  %5 = tail call spir_func i32 @_Z15get_image_width11ocl_image2d(target("spirv.Image", void, 1, 0, 0, 0, 0, 0, 0) %input)
  %6 = mul nsw i32 %4, %5
  %7 = add nsw i32 %6, %2
  %8 = sitofp i32 %2 to float
  %9 = insertelement <2 x float> undef, float %8, i32 0
  %10 = sitofp i32 %4 to float
  %11 = insertelement <2 x float> %9, float %10, i32 1
  %12 = tail call spir_func <4 x float> @_Z11read_imagef11ocl_image2d11ocl_samplerDv2_f(target("spirv.Image", void, 1, 0, 0, 0, 0, 0, 0) %input, i32 36, <2 x float> %11)
  %13 = sext i32 %7 to i64
  %14 = getelementptr inbounds <4 x float>, ptr addrspace(1) %results, i64 %13
  store <4 x float> %12, ptr addrspace(1) %14, align 16
  ret void
}

declare spir_func i64 @_Z13get_global_idj(i32)

declare spir_func i32 @_Z15get_image_width11ocl_image2d(target("spirv.Image", void, 1, 0, 0, 0, 0, 0, 0))

declare spir_func <4 x float> @_Z11read_imagef11ocl_image2d11ocl_samplerDv2_f(target("spirv.Image", void, 1, 0, 0, 0, 0, 0, 0), i32, <2 x float>)