Skip to content

Commit 022d3a5

Browse files
committed
Revert "[semantic-arc] Rename isWrittenTo -> isLoadGuaranteedByStorage."
This reverts commit dbf84f3. I closed the PR, but swift-ci merged anyways. The change was just a rename.
1 parent 88f8592 commit 022d3a5

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

lib/SILOptimizer/Mandatory/SemanticARCOpts.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,7 @@ struct SemanticARCOptVisitor
191191
bool visitBeginBorrowInst(BeginBorrowInst *bbi);
192192
bool visitLoadInst(LoadInst *li);
193193

194-
/// Return true if all of load insts destroy_value users are within the
195-
/// guaranteed lifetime of the storage that is being loaded from.
196-
bool isLoadGuaranteedByStorage(LoadInst *li);
194+
bool isWrittenTo(LoadInst *li);
197195

198196
bool processWorklist();
199197

@@ -716,7 +714,7 @@ class StorageGuaranteesLoadVisitor
716714
};
717715
} // namespace
718716

719-
bool SemanticARCOptVisitor::isLoadGuaranteedByStorage(LoadInst *load) {
717+
bool SemanticARCOptVisitor::isWrittenTo(LoadInst *load) {
720718
StorageGuaranteesLoadVisitor visitor(*this, load);
721719
return visitor.doIt();
722720
}
@@ -738,10 +736,9 @@ bool SemanticARCOptVisitor::visitLoadInst(LoadInst *li) {
738736
if (!isDeadLiveRange(li, destroyValues))
739737
return false;
740738

741-
// Then check if our address is guaranteed to never be written to within the
742-
// lifetime of our loaded value. If so, we can convert the loaded value to be
743-
// at +0 instead of +1.
744-
if (isLoadGuaranteedByStorage(li))
739+
// Then check if our address is ever written to. If it is, then we
740+
// can not use the load_borrow.
741+
if (isWrittenTo(li))
745742
return false;
746743

747744
// Ok, we can perform our optimization. Convert the load [copy] into a

0 commit comments

Comments
 (0)