[all-commits] [llvm/llvm-project] 8b1327: [AMDGPU] Rewrite device ctor / dtor handling to us...
Joseph Huber via All-commits
all-commits at lists.llvm.org
Fri May 19 14:22:19 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 8b132747cd3bf351c34db0998b6908083bdf729a
https://github.com/llvm/llvm-project/commit/8b132747cd3bf351c34db0998b6908083bdf729a
Author: Joseph Huber <jhuber6 at vols.utk.edu>
Date: 2023-05-19 (Fri, 19 May 2023)
Changed paths:
M llvm/lib/Target/AMDGPU/AMDGPUCtorDtorLowering.cpp
M llvm/test/CodeGen/AMDGPU/lower-ctor-dtor-constexpr-alias.ll
M llvm/test/CodeGen/AMDGPU/lower-ctor-dtor-existing.ll
M llvm/test/CodeGen/AMDGPU/lower-ctor-dtor.ll
M llvm/test/CodeGen/AMDGPU/lower-multiple-ctor-dtor.ll
Log Message:
-----------
[AMDGPU] Rewrite device ctor / dtor handling to use .init / .fini sections
Currently, AMDGPU has special handling for constructors and destructors.
We manuall emit a kernel that calls the functoins listed in the global
constructor / destructor list. This currently has two main problems. The
first is that we do not repsect the priortiy and simply call them in any
order. The second is that we redefine the symbol unconditionally which
coulid have a different definition, meaning we cannot merge any code
with a constructor post-codegen. This patch changes the handling to
instead use the standard support for travering the `.init_array` and
`.fini_array` sections the compiler creates. This allows us to emit a
single kernel with `odr` semantics, so even if we emit this multiple
times they will be merged into a single kernel.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D150675
More information about the All-commits
mailing list