|
125 | 125 | #include "swift/SIL/InstructionUtils.h" |
126 | 126 | #include "swift/SIL/MemAccessUtils.h" |
127 | 127 | #include "swift/SIL/OwnershipUtils.h" |
128 | | -#include "swift/SIL/PostOrder.h" |
129 | 128 | #include "swift/SIL/PrunedLiveness.h" |
130 | 129 | #include "swift/SIL/SILArgument.h" |
131 | 130 | #include "swift/SIL/SILArgumentConvention.h" |
|
139 | 138 | #include "swift/SILOptimizer/Analysis/DeadEndBlocksAnalysis.h" |
140 | 139 | #include "swift/SILOptimizer/Analysis/DominanceAnalysis.h" |
141 | 140 | #include "swift/SILOptimizer/Analysis/NonLocalAccessBlockAnalysis.h" |
142 | | -#include "swift/SILOptimizer/Analysis/PostOrderAnalysis.h" |
143 | 141 | #include "swift/SILOptimizer/PassManager/Transforms.h" |
144 | 142 | #include "swift/SILOptimizer/Utils/CanonicalizeOSSALifetime.h" |
145 | 143 | #include "swift/SILOptimizer/Utils/InstructionDeleter.h" |
@@ -724,21 +722,13 @@ struct MoveOnlyChecker { |
724 | 722 | /// Per mark must check address use state. |
725 | 723 | UseState addressUseState; |
726 | 724 |
|
727 | | - /// Post order analysis used to lazily initialize post order function info |
728 | | - /// only if we need it. |
729 | | - PostOrderAnalysis *poa; |
730 | | - |
731 | | - /// Lazy function info, do not use directly. Use getPostOrderInfo() instead |
732 | | - /// which will initialize this. |
733 | | - PostOrderFunctionInfo *lazyPOI; |
734 | | - |
735 | 725 | /// Diagnostic emission routines wrapped around a consuming use cache. This |
736 | 726 | /// ensures that we only emit a single error per use per marked value. |
737 | 727 | DiagnosticEmitter diagnosticEmitter; |
738 | 728 |
|
739 | 729 | MoveOnlyChecker(SILFunction *fn, DeadEndBlocks *deBlocks, |
740 | 730 | NonLocalAccessBlockAnalysis *accessBlockAnalysis, |
741 | | - DominanceInfo *domTree, PostOrderAnalysis *poa) |
| 731 | + DominanceInfo *domTree) |
742 | 732 | : fn(fn), |
743 | 733 | deleter(InstModCallbacks().onDelete([&](SILInstruction *instToDelete) { |
744 | 734 | if (auto *mvi = dyn_cast<MarkMustCheckInst>(instToDelete)) |
@@ -767,12 +757,6 @@ struct MoveOnlyChecker { |
767 | 757 | bool performSingleCheck(MarkMustCheckInst *markedValue); |
768 | 758 |
|
769 | 759 | bool check(); |
770 | | - |
771 | | - PostOrderFunctionInfo *getPostOrderInfo() { |
772 | | - if (!lazyPOI) |
773 | | - lazyPOI = poa->get(fn); |
774 | | - return lazyPOI; |
775 | | - } |
776 | 760 | }; |
777 | 761 |
|
778 | 762 | } // namespace |
@@ -1743,12 +1727,10 @@ class MoveOnlyCheckerPass : public SILFunctionTransform { |
1743 | 1727 | << fn->getName() << '\n'); |
1744 | 1728 | auto *accessBlockAnalysis = getAnalysis<NonLocalAccessBlockAnalysis>(); |
1745 | 1729 | auto *dominanceAnalysis = getAnalysis<DominanceAnalysis>(); |
1746 | | - auto *postOrderAnalysis = getAnalysis<PostOrderAnalysis>(); |
1747 | 1730 | DominanceInfo *domTree = dominanceAnalysis->get(fn); |
1748 | 1731 | auto *deAnalysis = getAnalysis<DeadEndBlocksAnalysis>()->get(fn); |
1749 | 1732 |
|
1750 | | - if (MoveOnlyChecker(getFunction(), deAnalysis, accessBlockAnalysis, domTree, |
1751 | | - postOrderAnalysis) |
| 1733 | + if (MoveOnlyChecker(getFunction(), deAnalysis, accessBlockAnalysis, domTree) |
1752 | 1734 | .check()) { |
1753 | 1735 | invalidateAnalysis(SILAnalysis::InvalidationKind::Instructions); |
1754 | 1736 | } |
|
0 commit comments