[PATCH] D131203: [HLSL] Initial codegen for SV_GroupIndex
Xiang Li via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 10 17:51:16 PDT 2022
python3kgae added inline comments.
================
Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:19
#include "clang/Basic/TargetOptions.h"
+#include "llvm/IR/IntrinsicsDirectX.h"
#include "llvm/IR/Metadata.h"
----------------
Does this mean CGHLSLRuntime is only for DirectX backend?
================
Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:103
+ const ParmVarDecl &D) {
+ assert(D.hasAttrs() && "Entry parameter missing annotation attribute!");
+ if (D.hasAttr<HLSLSV_GroupIndexAttr>()) {
----------------
FIXME: support struct parameter which may not have Annotation attribute.
================
Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:119
+ auto *EntryTy = llvm::FunctionType::get(llvm::Type::getVoidTy(Ctx), false);
+ Function *EntryFn =
+ Function::Create(EntryTy, Function::ExternalLinkage, FD->getName(), &M);
----------------
Need to move all attributes from Fn to EntryFn.
And make Fn a normal function.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131203/new/
https://reviews.llvm.org/D131203
More information about the cfe-commits
mailing list