diff options
author | Max Winkler <max.enrico.winkler@gmail.com> | 2024-04-29 20:29:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-29 20:29:34 -0400 |
commit | ce3485a0cd12b45c725f008a7836e71a1d72df49 (patch) | |
tree | 30db0c5838e6be22022ef52ba6f7547c8aa00e67 /llvm/lib/CodeGen/MachinePassManager.cpp | |
parent | 6566ffdf8a543f50b75e9b3c66d771a3a9eb1560 (diff) | |
download | llvm-ce3485a0cd12b45c725f008a7836e71a1d72df49.zip llvm-ce3485a0cd12b45c725f008a7836e71a1d72df49.tar.gz llvm-ce3485a0cd12b45c725f008a7836e71a1d72df49.tar.bz2 |
[llvm][GlobalOpt] Remove empty atexit destructors/handlers (#88836)
https://godbolt.org/z/frjhqMKqc for an example.
Removal of allocations due to empty `__cxa_atexit` destructor calls is
done by the following globalopt pass.
This pass currently does not look for `atexit` handlers generated for
platforms that do not use `__cxa_atexit`.
By default Win32 and AIX use `atexit`.
I don't see an easy way to only remove `atexit` calls that the compiler
generated without looking at the generated mangled name of the atexit
handler that is being registered.
However we can easily remove all `atexit` calls that register empty
handlers since it is trivial to ensure the removed call still returns
`0` which is the value for success.
Diffstat (limited to 'llvm/lib/CodeGen/MachinePassManager.cpp')
0 files changed, 0 insertions, 0 deletions