[clang] [llvm] [HLSL] Implement SV_GroupThreadId semantic (PR #117781)
Zhengxing li via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 9 09:51:12 PST 2024
================
@@ -3606,6 +3613,32 @@ bool SPIRVInstructionSelector::selectSpvThreadId(Register ResVReg,
return Result && MIB.constrainAllUses(TII, TRI, RBI);
}
+bool SPIRVInstructionSelector::selectSpvThreadId(Register ResVReg,
+ const SPIRVType *ResType,
+ MachineInstr &I) const {
+ // DX intrinsic: @llvm.dx.thread.id(i32)
+ // ID Name Description
+ // 93 ThreadId reads the thread ID
+ //
+ // In SPIR-V, llvm.dx.thread.id maps to a `GlobalInvocationId` builtin
+ // variable
+ return loadVec3BuiltinInputID(SPIRV::BuiltIn::GlobalInvocationId, ResVReg,
+ ResType, I);
----------------
lizhengxing wrote:
@tex3d Done. Updated the PR based on your comments.
https://github.com/llvm/llvm-project/pull/117781
More information about the llvm-commits
mailing list