Skip to content

Commit 8869548

Browse files
committed
Use the function order helper to compute bottom-up ordering.
Removes the one real use of the call graph in the performance inliner.
1 parent da70b97 commit 8869548

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/SILPasses/IPO/PerformanceInliner.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
#include "swift/SIL/Dominance.h"
1616
#include "swift/SIL/SILModule.h"
1717
#include "swift/SIL/Projection.h"
18+
#include "swift/SILAnalysis/BasicCalleeAnalysis.h"
19+
#include "swift/SILAnalysis/CallGraphAnalysis.h"
1820
#include "swift/SILAnalysis/ColdBlockInfo.h"
1921
#include "swift/SILAnalysis/DominanceAnalysis.h"
20-
#include "swift/SILAnalysis/CallGraphAnalysis.h"
22+
#include "swift/SILAnalysis/FunctionOrder.h"
2123
#include "swift/SILAnalysis/LoopAnalysis.h"
2224
#include "swift/SILPasses/Passes.h"
2325
#include "swift/SILPasses/Transforms.h"
@@ -1302,6 +1304,7 @@ class SILPerformanceInlinerPass : public SILModuleTransform {
13021304
}
13031305

13041306
void run() override {
1307+
BasicCalleeAnalysis *BCA = PM->getAnalysis<BasicCalleeAnalysis>();
13051308
CallGraphAnalysis *CGA = PM->getAnalysis<CallGraphAnalysis>();
13061309
DominanceAnalysis *DA = PM->getAnalysis<DominanceAnalysis>();
13071310
SILLoopAnalysis *LA = PM->getAnalysis<SILLoopAnalysis>();
@@ -1314,8 +1317,8 @@ class SILPerformanceInlinerPass : public SILModuleTransform {
13141317
SILPerformanceInliner Inliner(getOptions().InlineThreshold,
13151318
WhatToInline);
13161319

1317-
auto &CG = CGA->getOrBuildCallGraph();
1318-
auto BottomUpFunctions = CG.getBottomUpFunctionOrder();
1320+
BottomUpFunctionOrder BottomUpOrder(*getModule(), BCA);
1321+
auto BottomUpFunctions = BottomUpOrder.getFunctions();
13191322

13201323
// Copy the bottom-up function list into a worklist.
13211324
llvm::SmallVector<SILFunction *, 32> WorkList;

0 commit comments

Comments
 (0)