Files
clang-p2996/llvm/test/CodeGen/DirectX/wave_is_first_lane.ll
Nathan Gauër afb6dafc6b [clang][HLSL] Add WaveIsFirstLane() intrinsic (#103299)
This commits add the WaveIsFirstLane() hlsl intrinsinc. This intrinsic
uses the convergence intrinsincs for the SPIR-V backend. On the DXIL
side, I'm not sure what the strategy is for convergence, so I
implemented that like in DXC: a normal builtin function.

Signed-off-by: Nathan Gauër <brioche@google.com>
2024-09-04 11:27:03 +02:00

14 lines
502 B
LLVM

; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-compute %s | FileCheck %s
define void @main() #0 {
entry:
; CHECK: call i1 @dx.op.waveIsFirstLane(i32 110)
%0 = call i1 @llvm.dx.wave.is.first.lane()
ret void
}
declare i1 @llvm.dx.wave.is.first.lane() #1
attributes #0 = { convergent norecurse "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
attributes #1 = { convergent nocallback nofree nosync nounwind willreturn }