llvm-project/llvm/lib/Transforms/IPO
Teresa Johnson 748bb5a0f1 [WPD/LowerTypeTests] Delay lowering/removal of type tests until after ICP
Summary:
Currently type test assume sequences inserted for devirtualization are
removed during WPD. This patch delays their removal until later in the
optimization pipeline. This is an enabler for upcoming enhancements to
indirect call promotion, for example streamlined promotion guard
sequences that compare against vtable address instead of the target
function, when there are small number of possible vtables (either
determined via WPD or by in-progress type profiling). We need the type
tests to correlate the callsites with the address point offset needed in
the compare sequence, and optionally to associated type summary info
computed during WPD.

This depends on work in D71913 to enable invocation of LowerTypeTests to
drop type test assume sequences, which will now be invoked following ICP
in the ThinLTO post-LTO link pipelines, and also after the existing
export phase LowerTypeTests invocation in regular LTO (which is already
after ICP). We cannot simply move the existing import phase
LowerTypeTests pass later in the ThinLTO post link pipelines, as the
comment in PassBuilder.cpp notes (it must run early because when
performing CFI other passes may disturb the sequences it looks for).

This necessitated adding a new type test resolution "Unknown" that we
can use on the type test assume sequences previously removed by WPD,
that we now want LTT to ignore.

Depends on D71913.

Reviewers: pcc, evgeny777

Subscribers: mehdi_amini, Prazek, hiraditya, steven_wu, dexonsmith, arphaman, davidxl, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D73242
2020-02-05 08:59:48 -08:00
..
AlwaysInliner.cpp [NFC] Refactor InlineResult for readability 2020-01-15 13:34:20 -08:00
ArgumentPromotion.cpp [Attributor] Pointer privatization attribute (argument promotion) 2020-01-29 21:31:04 -06:00
Attributor.cpp [Attributor] AANoRecurse check all call sites for `norecurse` 2020-02-02 23:57:17 -06:00
BarrierNoopPass.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
BlockExtractor.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
CMakeLists.txt [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
CalledValuePropagation.cpp Add missing includes needed to prune LLVMContext.h include, NFC 2019-11-14 15:23:15 -08:00
ConstantMerge.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
CrossDSOCFI.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
DeadArgumentElimination.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
ElimAvailExtern.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
ExtractGV.cpp [llvm-extract] Add -keep-const-init commandline option 2020-02-03 14:30:28 +09:00
ForceFunctionAttrs.cpp Add missing includes needed to prune LLVMContext.h include, NFC 2019-11-14 15:23:15 -08:00
FunctionAttrs.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
FunctionImport.cpp [ThinLTO] More efficient export computation (NFC) 2020-02-03 09:15:33 -08:00
GlobalDCE.cpp [WPD/VFE] Always emit vcall_visibility metadata for -fwhole-program-vtables 2020-01-23 11:36:01 -08:00
GlobalOpt.cpp Revert "Recommit "[GlobalOpt] Pass DTU to removeUnreachableBlocks instead of recomputing."" 2020-01-14 14:50:07 +00:00
GlobalSplit.cpp [WPD/VFE] Always emit vcall_visibility metadata for -fwhole-program-vtables 2020-01-23 11:36:01 -08:00
HotColdSplitting.cpp HotColdSplitting: Do not outline within noreturn functions 2019-12-19 14:06:24 -08:00
IPConstantPropagation.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
IPO.cpp [NewPM] Port MergeFunctions pass 2020-01-14 20:55:41 +01:00
InferFunctionAttrs.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
InlineSimple.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
Inliner.cpp [NFC] Refactor InlineResult for readability 2020-01-15 13:34:20 -08:00
Internalize.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LoopExtractor.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
LowerTypeTests.cpp [WPD/LowerTypeTests] Delay lowering/removal of type tests until after ICP 2020-02-05 08:59:48 -08:00
MergeFunctions.cpp [NewPM] Port MergeFunctions pass 2020-01-14 20:55:41 +01:00
PartialInlining.cpp [NFC] Refactor InlineResult for readability 2020-01-15 13:34:20 -08:00
PassManagerBuilder.cpp [WPD/LowerTypeTests] Delay lowering/removal of type tests until after ICP 2020-02-05 08:59:48 -08:00
PruneEH.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
SCCP.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
SampleProfile.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
StripDeadPrototypes.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
StripSymbols.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
SyntheticCountsPropagation.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ThinLTOBitcodeWriter.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
WholeProgramDevirt.cpp [WPD/LowerTypeTests] Delay lowering/removal of type tests until after ICP 2020-02-05 08:59:48 -08:00