File: AlignmentId.spvasm

package info (click to toggle)
spirv-llvm-translator-21 21.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 17,612 kB
  • sloc: cpp: 47,807; ansic: 6,283; lisp: 3,878; sh: 162; python: 58; makefile: 41
file content (34 lines) | stat: -rw-r--r-- 1,270 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
32
33
34
; REQUIRES: spirv-as

; RUN: spirv-as %s --target-env spv1.2 -o %t.spv
; RUN: spirv-val %t.spv
; RUN: llvm-spirv -r -o %t.rev.bc %t.spv
; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s

               OpCapability Addresses
               OpCapability Linkage
               OpCapability Kernel
               OpMemoryModel Physical64 OpenCL
               OpEntryPoint Kernel %fn "testAlignmentId"
               OpName %p "p"
               OpDecorate %x LinkageAttributes "x" Export
               OpDecorateId %x AlignmentId %al
               OpDecorateId %p AlignmentId %al_spec
       %void = OpTypeVoid
       %uint = OpTypeInt 32 0
        %ptr = OpTypePointer CrossWorkgroup %uint
       %fnTy = OpTypeFunction %void %ptr
         %al = OpConstant %uint 16
    %al_spec = OpSpecConstantOp %uint IAdd %al %al
    %uint_42 = OpConstant %uint 42
; Verify alignment of variable.
; CHECK: @x = addrspace(1) global i32 42, align 16
          %x = OpVariable %ptr CrossWorkgroup %uint_42

         %fn = OpFunction %void None %fnTy
; Verify alignment of function parameter.
; CHECK: define spir_kernel void @testAlignmentId(ptr addrspace(1) align 32 %p)
          %p = OpFunctionParameter %ptr
      %entry = OpLabel
               OpReturn
               OpFunctionEnd