-
Notifications
You must be signed in to change notification settings - Fork 750
/
Copy pathAlignmentId.spvasm
34 lines (31 loc) · 1.24 KB
/
AlignmentId.spvasm
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