brintos

brintos / llvm-project-archived public Read only

0
0
Text · 922 B · 44d2f5e Raw
20 lines · plain
1; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s2; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}3 4; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s5; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}6 7; CHECK: OpDecorate %[[#Id:]] BuiltIn GlobalLinearId8; CHECK: %[[#Id:]] = OpVariable %[[#]]9 10@__spirv_BuiltInGlobalLinearId = external addrspace(1) global i3211 12define spir_kernel void @f(i32 addrspace(1)* nocapture %order) {13entry:14  %0 = load i32, i32 addrspace(4)* addrspacecast (i32 addrspace(1)* @__spirv_BuiltInGlobalLinearId to i32 addrspace(4)*), align 415  ;; Need to store the result somewhere, otherwise the access to GlobalLinearId16  ;; may be removed.17  store i32 %0, i32 addrspace(1)* %order, align 418  ret void19}20