[PATCH] D150675: [AMDGPU] Rewrite device ctor / dtor handling to use .init / .fini sections

Joseph Huber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 19 11:46:46 PDT 2023


jhuber6 added a comment.

In D150675#4357229 <https://reviews.llvm.org/D150675#4357229>, @arsenm wrote:

> Wondering if it's worth maintaining a way to keep the old non-indirect codegen for LTO

That's true, these are indirect function calls so they can't be inlined or anything. But I feel like it may not be worthwhile considering that we execute this kernel with a single thread anyway, overhead from a few indirect function calls probably isn't going to add a lot of latency overall.



================
Comment at: llvm/test/CodeGen/AMDGPU/lower-ctor-dtor-constexpr-alias.ll:20
 ;.
+; CHECK: @__init_array_start = external addrspace(1) constant [0 x ptr addrspace(1)]
+; CHECK: @__init_array_end = external addrspace(1) constant [0 x ptr addrspace(1)]
----------------
arsenm wrote:
> It's not really wrong but maybe we should use the default program address space instead 
So I put it in `addrspace(1)` because I was getting weird failures. I think the LLVM ctor / dtor globals were either addrsapce(1) or default, the latter then causing problems.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150675



More information about the llvm-commits mailing list