Files
clang-p2996/llvm/test/CodeGen/SPIRV/transcoding/builtin_vars.ll
Vyacheslav Levytskyy 59f34e8c2b [SPIRV] Add Lifetime intrinsics/instructions (#85391)
This PR:
* adds Lifetime intrinsics/instructions
* fixes how the binary header is emitted (correct version and better
approximation of Bound)
* add validation into more test cases
2024-03-18 11:42:44 +01:00

17 lines
741 B
LLVM

; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}
; CHECK-SPIRV: OpDecorate %[[#Id:]] BuiltIn GlobalLinearId
; CHECK-SPIRV: %[[#Id:]] = OpVariable %[[#]]
@__spirv_BuiltInGlobalLinearId = external addrspace(1) global i32
define spir_kernel void @f(i32 addrspace(1)* nocapture %order) {
entry:
%0 = load i32, i32 addrspace(4)* addrspacecast (i32 addrspace(1)* @__spirv_BuiltInGlobalLinearId to i32 addrspace(4)*), align 4
;; Need to store the result somewhere, otherwise the access to GlobalLinearId
;; may be removed.
store i32 %0, i32 addrspace(1)* %order, align 4
ret void
}