Skip to content

Commit fb0be6a

Browse files
committed
Run AddressLowering after DI and RawSILInstLowering
1 parent 25186ff commit fb0be6a

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

lib/SILOptimizer/Mandatory/AddressLowering.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ static bool isStoreCopy(SILValue value) {
339339
return false;
340340

341341
auto *user = value->getSingleUse()->getUser();
342-
return isa<StoreInst>(user) || isa<AssignInst>(user);
342+
return isa<StoreInst>(user);
343343
}
344344

345345
void ValueStorageMap::insertValue(SILValue value, SILValue storageAddress) {
@@ -2605,8 +2605,6 @@ class UseRewriter : SILInstructionVisitor<UseRewriter> {
26052605
vmi->setOperand(opAddr);
26062606
}
26072607

2608-
void visitAssignInst(AssignInst *assignInst);
2609-
26102608
void visitBeginBorrowInst(BeginBorrowInst *borrow);
26112609

26122610
void visitEndBorrowInst(EndBorrowInst *end) {}
@@ -2837,11 +2835,6 @@ void UseRewriter::visitStoreInst(StoreInst *storeInst) {
28372835
rewriteStore(storeInst->getSrc(), storeInst->getDest(), isInit);
28382836
}
28392837

2840-
void UseRewriter::visitAssignInst(AssignInst *assignInst) {
2841-
rewriteStore(assignInst->getSrc(), assignInst->getDest(),
2842-
IsNotInitialization);
2843-
}
2844-
28452838
/// Emit end_borrows for a an incomplete BorrowedValue with only nonlifetime
28462839
/// ending uses. This function inserts end_borrows on the lifetime boundary.
28472840
void UseRewriter::emitEndBorrows(SILValue value) {

lib/SILOptimizer/PassManager/PassPipeline.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ static void addDefiniteInitialization(SILPassPipelinePlan &P) {
116116
static void addMandatoryDiagnosticOptPipeline(SILPassPipelinePlan &P) {
117117
P.startPipeline("Mandatory Diagnostic Passes + Enabling Optimization Passes");
118118
P.addSILGenCleanup();
119-
P.addAddressLowering();
120119
P.addDiagnoseInvalidEscapingCaptures();
121120
P.addDiagnoseStaticExclusivity();
122121
P.addNestedSemanticFunctionCheck();
@@ -129,6 +128,7 @@ static void addMandatoryDiagnosticOptPipeline(SILPassPipelinePlan &P) {
129128
P.addAllocBoxToStack();
130129
P.addNoReturnFolding();
131130
addDefiniteInitialization(P);
131+
P.addAddressLowering();
132132

133133
P.addFlowIsolation();
134134

0 commit comments

Comments
 (0)