Optimizer: update borrowed-from instructions in some passes

Fixes verifier crashes (once the borrowed-from verifier is fixed).
This commit is contained in:
Erik Eckstein
2024-08-07 11:02:52 +02:00
parent 2b2b763697
commit 80a0da9615
5 changed files with 48 additions and 1 deletions

View File

@@ -62,6 +62,7 @@
#include "swift/SILOptimizer/Utils/CanonicalizeBorrowScope.h"
#include "swift/SILOptimizer/Utils/CanonicalizeOSSALifetime.h"
#include "swift/SILOptimizer/Utils/InstOptUtils.h"
#include "swift/SILOptimizer/Utils/OwnershipOptUtils.h"
#include "llvm/ADT/SetVector.h"
using namespace swift;
@@ -634,6 +635,7 @@ void CopyPropagation::run() {
// Invalidate analyses.
if (changed || deleter.hadCallbackInvocation()) {
updateBorrowedFrom(getPassManager(), getFunction());
// Preserves NonLocalAccessBlockAnalysis.
accessBlockAnalysis->lockInvalidation();
invalidateAnalysis(SILAnalysis::InvalidationKind::Instructions);