|
12 | 12 |
|
13 | 13 | #define DEBUG_TYPE "sil-function-signature-opts"
|
14 | 14 | #include "swift/SILPasses/Passes.h"
|
15 |
| -#include "swift/SILAnalysis/CallGraphAnalysis.h" |
| 15 | +#include "swift/SILAnalysis/BasicCalleeAnalysis.h" |
| 16 | +#include "swift/SILAnalysis/FunctionOrder.h" |
16 | 17 | #include "swift/SILAnalysis/RCIdentityAnalysis.h"
|
17 | 18 | #include "swift/SILAnalysis/ARCAnalysis.h"
|
18 | 19 | #include "swift/SILPasses/Transforms.h"
|
@@ -981,14 +982,12 @@ class FunctionSignatureOpts : public SILModuleTransform {
|
981 | 982 |
|
982 | 983 | void run() override {
|
983 | 984 | SILModule *M = getModule();
|
984 |
| - auto *CGA = getAnalysis<CallGraphAnalysis>(); |
| 985 | + auto *BCA = getAnalysis<BasicCalleeAnalysis>(); |
985 | 986 | auto *RCIA = getAnalysis<RCIdentityAnalysis>();
|
986 | 987 | llvm::BumpPtrAllocator Allocator;
|
987 | 988 |
|
988 | 989 | DEBUG(llvm::dbgs() << "**** Optimizing Function Signatures ****\n\n");
|
989 | 990 |
|
990 |
| - CallGraph &CG = CGA->getOrBuildCallGraph(); |
991 |
| - |
992 | 991 | // Construct a map from Callee -> Call Site Set.
|
993 | 992 |
|
994 | 993 | // Process each function in the callgraph that we are able to optimize.
|
@@ -1029,7 +1028,8 @@ class FunctionSignatureOpts : public SILModuleTransform {
|
1029 | 1028 | }
|
1030 | 1029 | }
|
1031 | 1030 |
|
1032 |
| - for (auto *F : CG.getBottomUpFunctionOrder()) { |
| 1031 | + BottomUpFunctionOrder BottomUpOrder(*M, BCA); |
| 1032 | + for (auto *F : BottomUpOrder.getFunctions()) { |
1033 | 1033 | // Don't optimize callees that should not be optimized.
|
1034 | 1034 | if (!F->shouldOptimize())
|
1035 | 1035 | continue;
|
|
0 commit comments