Adds the `GroupMemoryBarrier()` HLSL function to SPIRV and DirectX with additional tests for the different backends. When this moves in, will create another PR with this as a template for the other Barriers: - `AllMemoryBarrier()` #99076 - `AllMemoryBarrierWithGroupSync()` #99090 - `DeviceMemoryBarrier()` #99105 - `DeviceMemoryBarrierWithGroupSync()` #99106 `Barrier()` does not have support for SPIRV, so I will exclude that from the next PR. - [x] Implement GroupMemoryBarrier clang builtin, - [x] Link GroupMemoryBarrier clang builtin with hlsl_intrinsics.h - [x] Add sema checks for GroupMemoryBarrier to CheckHLSLBuiltinFunctionCall in SemaChecking.cpp - [x] Add codegen for GroupMemoryBarrier to EmitHLSLBuiltinExpr in CGBuiltin.cpp - [x] Add codegen tests to clang/test/CodeGenHLSL/builtins/GroupMemoryBarrier.hlsl - [x] Add sema tests to clang/test/SemaHLSL/BuiltIns/GroupMemoryBarrier-errors.hlsl - [x] Create the int_dx_GroupMemoryBarrier intrinsic in IntrinsicsDirectX.td - [x] Create the DXILOpMapping of int_dx_GroupMemoryBarrier to 80 in DXIL.td - [x] Create the GroupMemoryBarrier.ll and GroupMemoryBarrier_errors.ll tests in llvm/test/CodeGen/DirectX/ - [x] Create the int_spv_GroupMemoryBarrier intrinsic in IntrinsicsSPIRV.td - [x] In SPIRVInstructionSelector.cpp create the GroupMemoryBarrier lowering and map it to int_spv_GroupMemoryBarrier in SPIRVInstructionSelector::selectIntrinsic. - [x] Create SPIR-V backend test case in llvm/test/CodeGen/SPIRV/hlsl-intrinsics/GroupMemoryBarrier.ll <!-- branch-stack-start --> <!-- branch-stack-end -->
9 lines
248 B
LLVM
9 lines
248 B
LLVM
; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library < %s | FileCheck %s
|
|
|
|
define void @test_group_memory_barrier() {
|
|
entry:
|
|
; CHECK: call void @dx.op.barrier(i32 80, i32 8)
|
|
call void @llvm.dx.group.memory.barrier()
|
|
ret void
|
|
}
|