From 285cf9a84e1bd2f601b097fc29f75ea4c7779eba Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Fri, 22 Nov 2019 19:17:34 -0800 Subject: [IR] Move global_objects and global_values out of line, NFC 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::getResult::getResultImpl (420 times, avg 175 ms) 49657 ms: llvm::detail::concat_range Module::global_objects() { + return concat(functions(), globals()); +} +iterator_range +Module::global_objects() const { + return concat(functions(), globals()); +} + +iterator_range Module::global_values() { + return concat(functions(), globals(), aliases(), ifuncs()); +} +iterator_range +Module::global_values() const { + return concat(functions(), globals(), aliases(), ifuncs()); +} + //===----------------------------------------------------------------------===// // Methods to control the materialization of GlobalValues in the Module. // -- cgit v1.1