@@ -123,6 +123,8 @@ class PassManager<Loop, LoopAnalysisManager, LoopStandardAnalysisResults &,
123
123
LoopAnalysisManager, LoopStandardAnalysisResults &,
124
124
LPMUpdater &>;
125
125
IsLoopNestPass.push_back (true );
126
+ // Do not use make_unique or emplace_back, they cause too many template
127
+ // instantiations, causing terrible compile times.
126
128
LoopNestPasses.push_back (std::unique_ptr<LoopNestPassConceptT>(
127
129
new LoopNestPassModelT (std::forward<PassT>(Pass))));
128
130
}
@@ -138,6 +140,8 @@ class PassManager<Loop, LoopAnalysisManager, LoopStandardAnalysisResults &,
138
140
LoopAnalysisManager, LoopStandardAnalysisResults &,
139
141
LPMUpdater &>;
140
142
IsLoopNestPass.push_back (false );
143
+ // Do not use make_unique or emplace_back, they cause too many template
144
+ // instantiations, causing terrible compile times.
141
145
LoopPasses.push_back (std::unique_ptr<LoopPassConceptT>(
142
146
new RepeatedLoopPassModelT (std::move (Pass))));
143
147
}
@@ -150,6 +154,8 @@ class PassManager<Loop, LoopAnalysisManager, LoopStandardAnalysisResults &,
150
154
LoopAnalysisManager, LoopStandardAnalysisResults &,
151
155
LPMUpdater &>;
152
156
IsLoopNestPass.push_back (true );
157
+ // Do not use make_unique or emplace_back, they cause too many template
158
+ // instantiations, causing terrible compile times.
153
159
LoopNestPasses.push_back (std::unique_ptr<LoopNestPassConceptT>(
154
160
new RepeatedLoopNestPassModelT (std::move (Pass))));
155
161
}
@@ -471,7 +477,6 @@ createFunctionToLoopPassAdaptor(LoopPassT &&Pass, bool UseMemorySSA = false,
471
477
LoopStandardAnalysisResults &, LPMUpdater &>;
472
478
// Do not use make_unique, it causes too many template instantiations,
473
479
// causing terrible compile times.
474
-
475
480
return FunctionToLoopPassAdaptor (
476
481
std::unique_ptr<FunctionToLoopPassAdaptor::PassConceptT>(
477
482
new PassModelT (std::forward<LoopPassT>(Pass))),
@@ -492,6 +497,8 @@ createFunctionToLoopPassAdaptor(LoopNestPassT &&Pass, bool UseMemorySSA = false,
492
497
detail::PassModel<Loop, LoopPassManager, PreservedAnalyses,
493
498
LoopAnalysisManager, LoopStandardAnalysisResults &,
494
499
LPMUpdater &>;
500
+ // Do not use make_unique, it causes too many template instantiations,
501
+ // causing terrible compile times.
495
502
return FunctionToLoopPassAdaptor (
496
503
std::unique_ptr<FunctionToLoopPassAdaptor::PassConceptT>(
497
504
new PassModelT (std::move (LPM))),
@@ -512,6 +519,8 @@ createFunctionToLoopPassAdaptor<LoopPassManager>(
512
519
LoopAnalysisManager, LoopStandardAnalysisResults &,
513
520
LPMUpdater &>;
514
521
bool LoopNestMode = (LPM.getNumLoopPasses () == 0 );
522
+ // Do not use make_unique, it causes too many template instantiations,
523
+ // causing terrible compile times.
515
524
return FunctionToLoopPassAdaptor (
516
525
std::unique_ptr<FunctionToLoopPassAdaptor::PassConceptT>(
517
526
new PassModelT (std::move (LPM))),
0 commit comments