llvm-project/llvm/lib/Transforms/IPO
Evgeniy Stepanov 6c3a8cbc4d [asan] Fix dead stripping of globals on Linux.
Use a combination of !associated, comdat, @llvm.compiler.used and
custom sections to allow dead stripping of globals and their asan
metadata. Sometimes.

Currently this works on LLD, which supports SHF_LINK_ORDER with
sh_link pointing to the associated section.

This also works on BFD, which seems to treat comdats as
all-or-nothing with respect to linker GC. There is a weird quirk
where the "first" global in each link is never GC-ed because of the
section symbols.

At this moment it does not work on Gold (as in the globals are never
stripped).

This is a re-land of r298158 rebased on D31358. This time,
asan.module_ctor is put in a comdat as well to avoid quadratic
behavior in Gold.

llvm-svn: 299697
2017-04-06 19:55:17 +00:00
..
AlwaysInliner.cpp [PM] Teach the always inliner in the new pass manager to support 2016-12-26 23:43:27 +00:00
ArgumentPromotion.cpp Rename AttributeSet to AttributeList 2017-03-21 16:57:19 +00:00
BarrierNoopPass.cpp
CMakeLists.txt IPO: Introduce ThinLTOBitcodeWriter pass. 2016-12-16 00:26:30 +00:00
ConstantMerge.cpp Don't merge global constants with non-dbg metadata. 2017-03-09 00:03:37 +00:00
CrossDSOCFI.cpp Consistently use ModuleAnalysisManager 2016-08-09 00:28:38 +00:00
DeadArgumentElimination.cpp Set the prof weight correctly for call instructions in DeadArgumentElimination. 2017-03-23 23:26:00 +00:00
ElimAvailExtern.cpp [PM] Remove support for omitting the AnalysisManager argument to new 2016-06-17 00:11:01 +00:00
ExtractGV.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
ForceFunctionAttrs.cpp [PM] Remove support for omitting the AnalysisManager argument to new 2016-06-17 00:11:01 +00:00
FunctionAttrs.cpp Rename AttributeSet to AttributeList 2017-03-21 16:57:19 +00:00
FunctionImport.cpp SamplePGO ThinLTO ICP fix for local functions. 2017-03-14 17:33:01 +00:00
GlobalDCE.cpp Global DCE performance improvement 2017-01-27 19:48:57 +00:00
GlobalOpt.cpp Rename AttributeSet to AttributeList 2017-03-21 16:57:19 +00:00
GlobalSplit.cpp Fix one-after-the-end type metadata handling in globalsplit. 2017-03-07 22:18:48 +00:00
IPConstantPropagation.cpp [IPCP] Don't propagate return value for naked functions. 2017-02-04 19:44:14 +00:00
IPO.cpp Introduce GlobalSplit pass. 2016-11-16 23:40:26 +00:00
InferFunctionAttrs.cpp Consistently use ModuleAnalysisManager 2016-08-09 00:28:38 +00:00
InlineSimple.cpp Do not inline hot callsites for samplepgo in thinlto compile phase. 2017-03-21 19:55:36 +00:00
Inliner.cpp r286814 resulted that CallPenalty can be subtracted twice: 2017-03-22 12:01:57 +00:00
Internalize.cpp Consistently use ModuleAnalysisManager 2016-08-09 00:28:38 +00:00
LLVMBuild.txt Add missing library dep. 2016-12-16 00:43:00 +00:00
LoopExtractor.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
LowerTypeTests.cpp IPO: Const correctness for summaries passed into passes. 2017-03-22 18:22:59 +00:00
MergeFunctions.cpp Rename AttributeSet to AttributeList 2017-03-21 16:57:19 +00:00
PartialInlining.cpp Apply clang-tidy's performance-unnecessary-value-param to LLVM. 2017-01-13 14:39:03 +00:00
PassManagerBuilder.cpp [PGO] Memory intrinsic calls optimization based on profiled size 2017-04-04 16:42:20 +00:00
PruneEH.cpp [PruneEH] Be correct in the face IPO 2016-10-03 19:35:30 +00:00
SampleProfile.cpp Do not set branch weight if the branch weight annotation is present. 2017-03-23 14:43:10 +00:00
StripDeadPrototypes.cpp [PM] Remove support for omitting the AnalysisManager argument to new 2016-06-17 00:11:01 +00:00
StripSymbols.cpp [StripDeadDebugInfo] Drop dead CUs entirely 2017-04-06 19:26:22 +00:00
ThinLTOBitcodeWriter.cpp [asan] Fix dead stripping of globals on Linux. 2017-04-06 19:55:17 +00:00
WholeProgramDevirt.cpp IPO: Const correctness for summaries passed into passes. 2017-03-22 18:22:59 +00:00