1 ;; Make sure the backend doesn't crash if the input LLVM IR contains llvm.invariant.* intrinsics
2 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-linux %s -o - | FileCheck %s
4 ; CHECK-NOT: OpFunctionParameter
5 ; CHECK-NOT: OpFunctionCall
7 @WGSharedVar = internal addrspace(3) constant i64 0, align 8
9 declare {}* @llvm.invariant.start.p3i8(i64 immarg, i8 addrspace(3)* nocapture)
11 declare void @llvm.invariant.end.p3i8({}*, i64 immarg, i8 addrspace(3)* nocapture)
13 define linkonce_odr dso_local spir_func void @func() {
14 store i64 2, i64 addrspace(3)* @WGSharedVar
15 %1 = bitcast i64 addrspace(3)* @WGSharedVar to i8 addrspace(3)*
16 %2 = call {}* @llvm.invariant.start.p3i8(i64 8, i8 addrspace(3)* %1)
17 call void @llvm.invariant.end.p3i8({}* %2, i64 8, i8 addrspace(3)* %1)