You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Causes the compilation of b.cpp to take longer than expected, especially if optimizations are turned on. Passing -ftime-trace shows that most of the non-optimizer time is spent in EvaluateAsInitializer on aa. If optimizations are turned on, it then spends a bunch of extra time compiling module b for optimizations, primarily SROAPass, but that is possibly just a duplicate of #60996
The text was updated successfully, but these errors were encountered:
davidstone
changed the title
[Modules] Initializers of used variable templates evaluated in every importer
[Modules] EvaluateAsInitializer executed on used variable templates in every importer
Feb 28, 2023
In this example, if I declare unsigned a() as constexpr unsigned a() and thereby cause aa to have constant initialization, then in this example module b no longer spends time in EvaluateAsInitializer. However, the real program I reduced this from has a module that spends time on EvaluateAsInitializer even when the module contains nothing but imports, and the variable templates it is evaluating are all declared constexpr.
Given the following two translation units:
export module b; import a;
And compiled with
Causes the compilation of b.cpp to take longer than expected, especially if optimizations are turned on. Passing -ftime-trace shows that most of the non-optimizer time is spent in EvaluateAsInitializer on
aa
. If optimizations are turned on, it then spends a bunch of extra time compilingmodule b
for optimizations, primarily SROAPass, but that is possibly just a duplicate of #60996The text was updated successfully, but these errors were encountered: