File: OpDecorateString_UserSemantic.spvasm

package info (click to toggle)
spirv-llvm-translator-21 21.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 17,620 kB
  • sloc: cpp: 47,835; ansic: 6,283; lisp: 3,878; sh: 162; python: 58; makefile: 42
file content (33 lines) | stat: -rw-r--r-- 1,345 bytes parent folder | download | duplicates (3)
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
32
33
; REQUIRES: spirv-as
; RUN: spirv-as --target-env spv1.4 -o %t.spv %s
; RUN: spirv-val %t.spv
; RUN: llvm-spirv -r -o - %t.spv | llvm-dis | FileCheck %s

; SPIR-V
; Version: 1.4
; Generator: Khronos LLVM/SPIR-V Translator; 14
; Bound: 40
; Schema: 0
               OpCapability Addresses
               OpCapability Linkage
               OpCapability Kernel
               OpMemoryModel Physical64 OpenCL
               OpEntryPoint Kernel %kernel "test"
               ; Note: this is decorating a variable in the function storage class, which
               ; is not actually valid according to the SPIR-V spec, but is processed by
               ; the SPIR-V LLVM Translator and not rejected by spirv-val.
               OpDecorateString %temp UserSemantic "foo"
; CHECK: [[STR:@[0-9_.]+]] = {{.*}}foo
; CHECK: call void @llvm.var.annotation.p0.p0(ptr %{{.*}}, ptr [[STR]], ptr poison, i32 poison, ptr poison)
       %uint = OpTypeInt 32 0
       %void = OpTypeVoid
 %kernel_sig = OpTypeFunction %void %uint
   %ptr_uint = OpTypePointer Function %uint
     %kernel = OpFunction %void None %kernel_sig
          %a = OpFunctionParameter %uint
      %entry = OpLabel
       %temp = OpVariable %ptr_uint Function
        %add = OpIAdd %uint %a %a
               OpStore %temp %add Aligned 4
               OpReturn
               OpFunctionEnd