Skip to content

Commit 20aa5b5

Browse files
authored
Merge pull request #62163 from gottesmm/pr-d898e26f3360cb9b52222e9ebdd9dec5de2d3392
[move-only-addr] Remove dead post order analysis. We don't actually use it.
2 parents 3d9ce27 + d898e26 commit 20aa5b5

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

lib/SILOptimizer/Mandatory/MoveOnlyAddressChecker.cpp

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@
125125
#include "swift/SIL/InstructionUtils.h"
126126
#include "swift/SIL/MemAccessUtils.h"
127127
#include "swift/SIL/OwnershipUtils.h"
128-
#include "swift/SIL/PostOrder.h"
129128
#include "swift/SIL/PrunedLiveness.h"
130129
#include "swift/SIL/SILArgument.h"
131130
#include "swift/SIL/SILArgumentConvention.h"
@@ -139,7 +138,6 @@
139138
#include "swift/SILOptimizer/Analysis/DeadEndBlocksAnalysis.h"
140139
#include "swift/SILOptimizer/Analysis/DominanceAnalysis.h"
141140
#include "swift/SILOptimizer/Analysis/NonLocalAccessBlockAnalysis.h"
142-
#include "swift/SILOptimizer/Analysis/PostOrderAnalysis.h"
143141
#include "swift/SILOptimizer/PassManager/Transforms.h"
144142
#include "swift/SILOptimizer/Utils/CanonicalizeOSSALifetime.h"
145143
#include "swift/SILOptimizer/Utils/InstructionDeleter.h"
@@ -724,21 +722,13 @@ struct MoveOnlyChecker {
724722
/// Per mark must check address use state.
725723
UseState addressUseState;
726724

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-
735725
/// Diagnostic emission routines wrapped around a consuming use cache. This
736726
/// ensures that we only emit a single error per use per marked value.
737727
DiagnosticEmitter diagnosticEmitter;
738728

739729
MoveOnlyChecker(SILFunction *fn, DeadEndBlocks *deBlocks,
740730
NonLocalAccessBlockAnalysis *accessBlockAnalysis,
741-
DominanceInfo *domTree, PostOrderAnalysis *poa)
731+
DominanceInfo *domTree)
742732
: fn(fn),
743733
deleter(InstModCallbacks().onDelete([&](SILInstruction *instToDelete) {
744734
if (auto *mvi = dyn_cast<MarkMustCheckInst>(instToDelete))
@@ -767,12 +757,6 @@ struct MoveOnlyChecker {
767757
bool performSingleCheck(MarkMustCheckInst *markedValue);
768758

769759
bool check();
770-
771-
PostOrderFunctionInfo *getPostOrderInfo() {
772-
if (!lazyPOI)
773-
lazyPOI = poa->get(fn);
774-
return lazyPOI;
775-
}
776760
};
777761

778762
} // namespace
@@ -1743,12 +1727,10 @@ class MoveOnlyCheckerPass : public SILFunctionTransform {
17431727
<< fn->getName() << '\n');
17441728
auto *accessBlockAnalysis = getAnalysis<NonLocalAccessBlockAnalysis>();
17451729
auto *dominanceAnalysis = getAnalysis<DominanceAnalysis>();
1746-
auto *postOrderAnalysis = getAnalysis<PostOrderAnalysis>();
17471730
DominanceInfo *domTree = dominanceAnalysis->get(fn);
17481731
auto *deAnalysis = getAnalysis<DeadEndBlocksAnalysis>()->get(fn);
17491732

1750-
if (MoveOnlyChecker(getFunction(), deAnalysis, accessBlockAnalysis, domTree,
1751-
postOrderAnalysis)
1733+
if (MoveOnlyChecker(getFunction(), deAnalysis, accessBlockAnalysis, domTree)
17521734
.check()) {
17531735
invalidateAnalysis(SILAnalysis::InvalidationKind::Instructions);
17541736
}

0 commit comments

Comments
 (0)