mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-13 00:10:37 +00:00
![Reid Kleckner](/assets/img/avatar_default.png)
This saves 2.4% of CPU time compiling opt, according to ClangBuildAnalyzer. These helpers being inlined in the header was triggering the instantiation of concat_iterator in every TU using Module.h (~1118 TUs): https://reviews.llvm.org/P8171$35 **** Templates that took longest to instantiate: 76187 ms: llvm::AnalysisManager<llvm::Function>::getResult<llvm::TargetLibrary... (396 times, avg 192 ms) 73609 ms: llvm::AnalysisManager<llvm::Function>::getResultImpl (420 times, avg 175 ms) 49657 ms: llvm::detail::concat_range<llvm::GlobalValue, llvm::iterator_range<l... (1118 times, avg 44 ms) 49376 ms: llvm::detail::concat_range<const llvm::GlobalValue, llvm::iterator_r... (1118 times, avg 44 ms) 48167 ms: llvm::iterator_range<llvm::concat_iterator<llvm::GlobalValue, llvm::... (1118 times, avg 43 ms) 48125 ms: llvm::iterator_range<llvm::concat_iterator<const llvm::GlobalValue, ... (1118 times, avg 43 ms) 48061 ms: llvm::concat_iterator<llvm::GlobalValue, llvm::ilist_iterator<llvm::... (1118 times, avg 42 ms) 48014 ms: llvm::concat_iterator<const llvm::GlobalValue, llvm::ilist_iterator<... (1118 times, avg 42 ms) ... I haven't measured, but I don't think these helpers are performance critical. The iterator advance call can still be inlined, which is what matters for performance. Remove global_(objects|values)_(begin|end), since they were dead and would have to be out of line anyway.