Skip to content

Commit 22e75e0

Browse files
authored
Merge pull request swiftlang#74421 from apple/fix-array-property-opt
ArrayPropertyOpt: update borrowed-from instructions
2 parents 5b9e5a2 + 35017db commit 22e75e0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/SILOptimizer/LoopTransforms/ArrayPropertyOpt.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
#include "swift/SILOptimizer/PassManager/Transforms.h"
6565
#include "swift/SILOptimizer/Utils/BasicBlockOptUtils.h"
6666
#include "swift/SILOptimizer/Utils/CFGOptUtils.h"
67+
#include "swift/SILOptimizer/Utils/OwnershipOptUtils.h"
6768
#include "swift/SILOptimizer/Utils/LoopUtils.h"
6869
#include "swift/SILOptimizer/Utils/SILSSAUpdater.h"
6970
#include "llvm/ADT/SmallSet.h"
@@ -835,6 +836,8 @@ class SwiftArrayPropertyOptPass : public SILFunctionTransform {
835836
if (getFunction()->getModule().getOptions().VerifyAll)
836837
getFunction()->verifyCriticalEdges();
837838

839+
updateBorrowedFrom(getPassManager(), Fn);
840+
838841
// We preserve the dominator tree. Let's invalidate everything
839842
// else.
840843
DA->lockInvalidation();

test/SILOptimizer/simplify_cfg_crash.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -O %s -emit-sil -o /dev/null
1+
// RUN: %target-swift-frontend -O %s -enable-ossa-modules -emit-sil -o /dev/null
22

33
public class X {}
44

0 commit comments

Comments
 (0)