brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 54d0843 Raw
39 lines · plain
1; The goal of the test case is to ensure that the Backend doesn't crash on the stage2; of type inference. Result SPIR-V is not expected to be valid from the perspective3; of spirv-val in this case, because there is a difference of accepted return types4; between atomicrmw and OpAtomicExchange.5 6; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s7; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s8 9; CHECK-DAG: %[[#LongTy:]] = OpTypeInt 64 010; CHECK-DAG: %[[#PtrLongTy:]] = OpTypePointer CrossWorkgroup %[[#LongTy]]11; CHECK-DAG: %[[#IntTy:]] = OpTypeInt 32 012; CHECK-DAG: %[[#Scope:]] = OpConstantNull %[[#IntTy]]13; CHECK-DAG: %[[#MemSem:]] = OpConstant %[[#IntTy]] 814; CHECK-DAG: %[[#PtrPtrLongTy:]] = OpTypePointer CrossWorkgroup %[[#PtrLongTy]]15 16; CHECK: OpFunction17; CHECK: %[[#Arg1:]] = OpFunctionParameter %[[#PtrPtrLongTy]]18; CHECK: %[[#Arg2:]] = OpFunctionParameter %[[#PtrLongTy]]19; CHECK: OpAtomicExchange %[[#PtrLongTy]] %[[#Arg1]] %[[#Scope]] %[[#MemSem]] %[[#Arg2]]20; CHECK: OpFunctionEnd21 22define dso_local spir_func void @test1(ptr addrspace(1) %arg1, ptr addrspace(1) byval(i64) %arg_ptr) {23entry:24  %r = atomicrmw xchg ptr addrspace(1) %arg1, ptr addrspace(1) %arg_ptr acq_rel25  ret void26}27 28; CHECK: OpFunction29; CHECK: %[[#Arg3:]] = OpFunctionParameter %[[#PtrLongTy]]30; CHECK: %[[#Arg4:]] = OpFunctionParameter %[[#LongTy]]31; CHECK: OpAtomicExchange %[[#LongTy]] %[[#Arg3]] %[[#Scope]] %[[#MemSem]] %[[#Arg4]]32; CHECK: OpFunctionEnd33 34define dso_local spir_func void @test2(ptr addrspace(1) %arg1, i64 %arg_ptr) {35entry:36  %r = atomicrmw xchg ptr addrspace(1) %arg1, i64 %arg_ptr acq_rel37  ret void38}39