llvm/lib/Transforms/IPO
Peter Collingbourne 0bf16a5969 LowerTypeTests: Improve performance by optimising type metadata queries.
Requesting metadata for a global is a relatively expensive operation as it
involves a map lookup, but it's one that we need to do relatively frequently in
this pass to collect the list of type metadata nodes associated with a global.
This change improves the performance of type metadata queries by prebuilding
data structures that keep the global together with its list of type metadata,
and changing the pass to use that data structure wherever we were previously
passing global references around.

This change also eliminates some O(N^2) behavior by collecting the list of
globals associated with each type identifier during the first pass over the
list of globals rather than visiting each global to compute that list every
time we add a new type identifier.

Reduces pass runtime on a module containing Chrome's vtables from over 60s
to 0.9s.

Differential Revision: https://reviews.llvm.org/D27484

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288859 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 23:02:13 +00:00
..
AlwaysInliner.cpp [PM] Port the always inliner to the new pass manager in a much more 2016-08-17 02:56:20 +00:00
ArgumentPromotion.cpp IR: Change PointerType to derive from Type rather than SequentialType. 2016-12-02 03:05:41 +00:00
BarrierNoopPass.cpp
CMakeLists.txt [CMake] NFC. Updating CMake dependency specifications 2016-11-17 04:36:50 +00:00
ConstantMerge.cpp [PM] Remove support for omitting the AnalysisManager argument to new 2016-06-17 00:11:01 +00:00
CrossDSOCFI.cpp Consistently use ModuleAnalysisManager 2016-08-09 00:28:38 +00:00
DeadArgumentElimination.cpp Replace some callers of setTailCall with setTailCallKind 2016-11-25 22:35:09 +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 Fix 80-column violations. NFC. 2016-11-07 16:28:04 +00:00
FunctionImport.cpp [ThinLTO] Stop importing constant global vars as copies in the backend 2016-12-02 01:02:30 +00:00
GlobalDCE.cpp GlobalDCE: Restore a statement accidentally removed in r285048. 2016-10-25 02:57:27 +00:00
GlobalOpt.cpp IR: Move NumElements field from {Array,Vector}Type to SequentialType. 2016-12-02 03:20:58 +00:00
GlobalSplit.cpp [GlobalSplit] Port to the new pass manager. 2016-11-21 00:28:23 +00:00
InferFunctionAttrs.cpp Consistently use ModuleAnalysisManager 2016-08-09 00:28:38 +00:00
Inliner.cpp Fix spelling mistakes in Transforms comments. NFC. 2016-11-20 13:19:49 +00:00
InlineSimple.cpp Add a new method to create SimpleInliner instance and make pre-inliner use this. 2016-08-11 18:24:08 +00:00
Internalize.cpp Consistently use ModuleAnalysisManager 2016-08-09 00:28:38 +00:00
IPConstantPropagation.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
IPO.cpp Introduce GlobalSplit pass. 2016-11-16 23:40:26 +00:00
LLVMBuild.txt [PGO] Passmanagerbuilder change that enable IR level PGO instrumentation 2016-01-21 18:28:59 +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 LowerTypeTests: Improve performance by optimising type metadata queries. 2016-12-06 23:02:13 +00:00
MergeFunctions.cpp Make the FunctionComparator of the MergeFunctions pass a stand-alone utility. 2016-11-11 21:15:13 +00:00
PartialInlining.cpp CodeExtractor : Add ability to preserve profile data. 2016-08-02 02:15:45 +00:00
PassManagerBuilder.cpp Introduce GlobalSplit pass. 2016-11-16 23:40:26 +00:00
PruneEH.cpp [PruneEH] Be correct in the face IPO 2016-10-03 19:35:30 +00:00
SampleProfile.cpp Use CallSite to simplify code 2016-11-29 19:42:27 +00:00
StripDeadPrototypes.cpp [PM] Remove support for omitting the AnalysisManager argument to new 2016-06-17 00:11:01 +00:00
StripSymbols.cpp Don't create a SymbolTable in Function when the LLVMContext discards value names (NFC) 2016-09-17 06:00:02 +00:00
WholeProgramDevirt.cpp Shorten DiagnosticInfoOptimizationRemark* to OptimizationRemark*. NFC 2016-09-27 22:19:23 +00:00