Skip to content

Commit 88baeea

Browse files
committed
Switch function signature optimization away from call graph.
Use the new function ordering utility instead.
1 parent 3f4519d commit 88baeea

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/SILPasses/IPO/FunctionSignatureOpts.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
#define DEBUG_TYPE "sil-function-signature-opts"
1414
#include "swift/SILPasses/Passes.h"
15-
#include "swift/SILAnalysis/CallGraphAnalysis.h"
15+
#include "swift/SILAnalysis/BasicCalleeAnalysis.h"
16+
#include "swift/SILAnalysis/FunctionOrder.h"
1617
#include "swift/SILAnalysis/RCIdentityAnalysis.h"
1718
#include "swift/SILAnalysis/ARCAnalysis.h"
1819
#include "swift/SILPasses/Transforms.h"
@@ -981,14 +982,12 @@ class FunctionSignatureOpts : public SILModuleTransform {
981982

982983
void run() override {
983984
SILModule *M = getModule();
984-
auto *CGA = getAnalysis<CallGraphAnalysis>();
985+
auto *BCA = getAnalysis<BasicCalleeAnalysis>();
985986
auto *RCIA = getAnalysis<RCIdentityAnalysis>();
986987
llvm::BumpPtrAllocator Allocator;
987988

988989
DEBUG(llvm::dbgs() << "**** Optimizing Function Signatures ****\n\n");
989990

990-
CallGraph &CG = CGA->getOrBuildCallGraph();
991-
992991
// Construct a map from Callee -> Call Site Set.
993992

994993
// Process each function in the callgraph that we are able to optimize.
@@ -1029,7 +1028,8 @@ class FunctionSignatureOpts : public SILModuleTransform {
10291028
}
10301029
}
10311030

1032-
for (auto *F : CG.getBottomUpFunctionOrder()) {
1031+
BottomUpFunctionOrder BottomUpOrder(*M, BCA);
1032+
for (auto *F : BottomUpOrder.getFunctions()) {
10331033
// Don't optimize callees that should not be optimized.
10341034
if (!F->shouldOptimize())
10351035
continue;

0 commit comments

Comments
 (0)