================ @@ -379,6 +380,18 @@ llvm::Value *CGHLSLRuntime::emitInputSemantic(IRBuilder<> &B, const ParmVarDecl &D, llvm::Type *Ty) { assert(D.hasAttrs() && "Entry parameter missing annotation attribute!"); + + if (D.hasAttr<HLSLSV_GroupIDAttr>()) { + if (getArch() == llvm::Triple::spirv) { + llvm::Type *Ty = CGM.getTypes().ConvertTypeForMem(D.getType()); + llvm::Function *IntrinsicID = + CGM.getIntrinsic(Intrinsic::spv_load_builtin, {Ty}); + return B.CreateCall(IntrinsicID, {B.getInt32(/* WorkgroupID */ 26)}); + } else + // FIXME: getIntrinsic(getGroupIDIntrinsic()) + return nullptr; + } ---------------- Keenuts wrote:
Yes, this can clearly be refactorized in a real implementation. Just wanted to keep it simple for the draft. https://github.com/llvm/llvm-project/pull/116393 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits