15
15
#include " swift/SIL/Dominance.h"
16
16
#include " swift/SIL/SILModule.h"
17
17
#include " swift/SIL/Projection.h"
18
+ #include " swift/SILAnalysis/BasicCalleeAnalysis.h"
19
+ #include " swift/SILAnalysis/CallGraphAnalysis.h"
18
20
#include " swift/SILAnalysis/ColdBlockInfo.h"
19
21
#include " swift/SILAnalysis/DominanceAnalysis.h"
20
- #include " swift/SILAnalysis/CallGraphAnalysis .h"
22
+ #include " swift/SILAnalysis/FunctionOrder .h"
21
23
#include " swift/SILAnalysis/LoopAnalysis.h"
22
24
#include " swift/SILPasses/Passes.h"
23
25
#include " swift/SILPasses/Transforms.h"
@@ -1302,6 +1304,7 @@ class SILPerformanceInlinerPass : public SILModuleTransform {
1302
1304
}
1303
1305
1304
1306
void run () override {
1307
+ BasicCalleeAnalysis *BCA = PM->getAnalysis <BasicCalleeAnalysis>();
1305
1308
CallGraphAnalysis *CGA = PM->getAnalysis <CallGraphAnalysis>();
1306
1309
DominanceAnalysis *DA = PM->getAnalysis <DominanceAnalysis>();
1307
1310
SILLoopAnalysis *LA = PM->getAnalysis <SILLoopAnalysis>();
@@ -1314,8 +1317,8 @@ class SILPerformanceInlinerPass : public SILModuleTransform {
1314
1317
SILPerformanceInliner Inliner (getOptions ().InlineThreshold ,
1315
1318
WhatToInline);
1316
1319
1317
- auto &CG = CGA-> getOrBuildCallGraph ( );
1318
- auto BottomUpFunctions = CG. getBottomUpFunctionOrder ();
1320
+ BottomUpFunctionOrder BottomUpOrder (* getModule (), BCA );
1321
+ auto BottomUpFunctions = BottomUpOrder. getFunctions ();
1319
1322
1320
1323
// Copy the bottom-up function list into a worklist.
1321
1324
llvm::SmallVector<SILFunction *, 32 > WorkList;
0 commit comments