[Inline] Attempt to delete any discardable if unused functions
authorArthur Eubanks <aeubanks@google.com>
Fri, 7 Jan 2022 17:47:55 +0000 (09:47 -0800)
committerArthur Eubanks <aeubanks@google.com>
Thu, 13 Jan 2022 22:48:38 +0000 (14:48 -0800)
commit9a0fe1b0fc23098d961750eb5310f307f4bb5ee5
tree0ae6e39ea819c89f1da0eb609ef88be1683d9af1
parentd53b979596530dc3e2e4be846d0ae330aab7be33
[Inline] Attempt to delete any discardable if unused functions

Previously we limited ourselves to only internal/private functions. We
can also delete linkonce_odr functions.

Minor compile time wins:
https://llvm-compile-time-tracker.com/compare.php?from=d51e3474e060cb0e90dc2e2487f778b0d3e6a8de&to=bccffe3f8d5dd4dda884c9ac1f93e51772519cad&stat=instructions

Major memory wins on tramp3d:
https://llvm-compile-time-tracker.com/compare.php?from=d51e3474e060cb0e90dc2e2487f778b0d3e6a8de&to=bccffe3f8d5dd4dda884c9ac1f93e51772519cad&stat=max-rss

Relanding with fix for compile times D117236.

Reviewed By: nikic, mtrofin

Differential Revision: https://reviews.llvm.org/D115545
llvm/lib/Transforms/IPO/Inliner.cpp
llvm/test/Transforms/Inline/delete-function-with-metadata-use.ll [new file with mode: 0644]
llvm/test/Transforms/Inline/delete-unused-function.ll [new file with mode: 0644]