[all-commits] [llvm/llvm-project] a3bd87: [AMDGPU] Call the `FINI_ARRAY` destructors in the ...

Joseph Huber via All-commits all-commits at lists.llvm.org
Fri Nov 10 09:01:46 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a3bd87b100fba414306450b56e87752a5ea21eee
      https://github.com/llvm/llvm-project/commit/a3bd87b100fba414306450b56e87752a5ea21eee
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2023-11-10 (Fri, 10 Nov 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.ll
    M llvm/test/CodeGen/AMDGPU/lower-multiple-ctor-dtor.ll

  Log Message:
  -----------
  [AMDGPU] Call the `FINI_ARRAY` destructors in the correct order (#71815)

Summary:
The AMDGPU backend uses the linker-provided INIT_ARRAY and FINI_ARRAY
sections to call all the global constructors in a single kernel.
Previously this mistakenly used the same iteration logic for both
arrays. The destructors stored in FINI_ARRAY are stored in the same
order as
the ones in the INIT_ARRAY section so we need to traverse it in reverse
order.

Relanding after the revert in fe7b5e2cfcf6848287010291081f85fa1f6bb2ef
using the IR builder interface instead of ConstantExpr.




More information about the All-commits mailing list