1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
llvm-mirror/unittests
Reid Kleckner 9369556310 Add PassManagerImpl.h to hide implementation details
ClangBuildAnalyzer results show that a lot of time is spent
instantiating AnalysisManager::getResultImpl across the code base:

**** Templates that took longest to instantiate:
 50445 ms: llvm::AnalysisManager<llvm::Function>::getResultImpl (412 times, avg 122 ms)
 47797 ms: llvm::AnalysisManager<llvm::Function>::getResult<llvm::TargetLibraryAnalysis> (389 times, avg 122 ms)
 46894 ms: std::tie<const unsigned long long, const bool> (2452 times, avg 19 ms)
 43851 ms: llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096, 4096>::Allocate (3228 times, avg 13 ms)
 33911 ms: std::tie<const unsigned int, const unsigned int, const unsigned int, const unsigned int> (897 times, avg 37 ms)
 33854 ms: std::tie<const unsigned long long, const unsigned long long> (1897 times, avg 17 ms)
 27886 ms: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string (11156 times, avg 2 ms)

I mentioned this result to @chandlerc, and he suggested this direction.

AnalysisManager is already explicitly instantiated, and getResultImpl
doesn't need to be inlined. Move the definition to an Impl header, and
include that header in files that explicitly instantiate
AnalysisManager. There are only four (real) IR units:
- function
- module
- loop
- cgscc

Looking at a specific transform (ArgumentPromotion.cpp), here are three
compilations before & after this change:

BEFORE:
$ for i in $(seq 3) ; do ./ccit.bat ; done
peak memory: 258.15MB
real: 0m6.297s
peak memory: 257.54MB
real: 0m5.906s
peak memory: 257.47MB
real: 0m6.219s

AFTER:
$ for i in $(seq 3) ; do ./ccit.bat ; done
peak memory: 235.35MB
real: 0m5.454s
peak memory: 234.72MB
real: 0m5.235s
peak memory: 234.39MB
real: 0m5.469s

The 20MB of memory saved seems real, and the time improvement seems like
it is there.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D73817
2020-02-03 11:15:55 -08:00
..
ADT [llvm] Replace SmallStr.str().str() with std::string conversion operator. 2020-01-29 21:16:46 -08:00
Analysis [PM][CGSCC] Add a helper to update the call graph from SCC passes 2020-02-02 23:32:18 -06:00
AsmParser
BinaryFormat [BinaryFormat] Teach identify_magic about Tapi files. 2019-08-21 21:00:16 +00:00
Bitcode Add AutoUpgrade function to add new address space datalayout string to existing datalayouts. 2019-09-18 22:15:58 +00:00
Bitstream [Bitcode] Move Bitstream to a separate library 2019-07-03 22:40:07 +00:00
CodeGen LLT: Add changeNumElements 2020-01-29 07:32:07 -08:00
DebugInfo [DebugInfo][test] Adjust line table unit length to account for contents 2020-02-03 12:16:36 +00:00
Demangle
ExecutionEngine Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Frontend Revert "[OpenMP][OMPIRBuilder] Add Directives (master and critical) to OMPBuilder." 2020-02-03 08:59:14 -06:00
FuzzMutate [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
IR Add PassManagerImpl.h to hide implementation details 2020-02-03 11:15:55 -08:00
LineEditor
Linker [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
MC [X86][Disassembler] Fix a bug when disassembling an empty string 2020-01-13 10:42:21 -08:00
MI [unittests] Add InitializePasses.h includes 2019-11-13 19:42:58 -08:00
Object [unittests] Fix "comparison of integers of different signs" warnings 2020-01-14 13:24:51 +01:00
ObjectYAML minidump: Add an "arm64" constant 2019-10-31 11:20:46 +01:00
Option
Passes Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
ProfileData Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Remarks [Remarks] Fix error message check in unit test 2019-10-31 15:51:36 -07:00
Support Reland "[llvm] Add a way to speed up the speed in which BumpPtrAllocator increases slab sizes"" 2020-02-03 12:06:15 +01:00
TableGen [UnitTests] Try and pacify gcc-5 2019-10-05 08:57:17 +00:00
Target Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
TextAPI Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
tools Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Transforms [CodeExtractor] Remove stale llvm.assume calls from extracted region 2020-01-28 17:18:01 -08:00
XRay [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
CMakeLists.txt CMake: Make most target symbols hidden by default 2020-01-14 19:46:52 -08:00
unittest.cfg.in