[PATCH] D105682: [AMDGPU] Handle functions in llvm's global ctors and dtors list

Reshabh Sharma via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 19 01:12:41 PDT 2021


rksharma marked an inline comment as done.
rksharma added a comment.

> Why is metadata needed here? I thought constructors/destructors went into a special section

I think we need ISA level linking for the init and fini section approach to work.



================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUCtorDtorLowering.cpp:33
+  Function *createInitOrFiniKerelFunction(Module &M, bool IsCtor) {
+    StringRef InitOrFiniKernelName = "__amdgpu_device_init";
+    if (!IsCtor)
----------------
arsenm wrote:
> Probably should use llvm.amdgcn prefix and . separators
With llvm. as a prefix, it starts to treat it as an intrinsic and complaints about it being defined. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105682/new/

https://reviews.llvm.org/D105682



More information about the llvm-commits mailing list