[PATCH] D131203: [HLSL] Initial codegen for SV_GroupIndex

Chris Bieneman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 10 19:29:51 PDT 2022


beanz 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"
----------------
python3kgae wrote:
> Does this mean CGHLSLRuntime is only for DirectX backend?
No, it is fairly normal to include target intrinsics throughout codegen. That said, I'm not handling non-DirectX intrinsics nor am I verifying the appropriate target, so I should make some adjustment here.


================
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);
----------------
python3kgae wrote:
> Need to move all attributes from Fn to EntryFn.
> And make Fn a normal function.
Yes on the function attributes.

What do you mean by "normal function" as written it is an external linkage function, which matches what we expect in DXIL.


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