Skip to content

Commit c5c1330

Browse files
committed
Add comments
1 parent f3c2dec commit c5c1330

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/SILOptimizer/Transforms/TempRValueElimination.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ bool TempRValueOptPass::collectLoadsFromProjection(
115115
return true;
116116
}
117117

118+
/// Check if 'tempObjUser' passed to the apply instruction can be modified by it
118119
bool TempRValueOptPass::checkNoTempObjectModificationInApply(
119120
Operand *tempObjUser, SILInstruction *applyInst, SILValue srcAddr) {
120121
ApplySite apply(applyInst);
@@ -242,6 +243,9 @@ bool TempRValueOptPass::collectLoads(
242243
return false;
243244

244245
auto beginApply = cast<BeginApplyInst>(user);
246+
// Register 'eng_apply'/'abort_apply' as loads as well
247+
// 'checkNoSourceModification' should check instructions until
248+
// 'end_apply'/'abort_apply' as well
245249
for (auto tokenUses : beginApply->getTokenResult()->getUses()) {
246250
loadInsts.insert(tokenUses->getUser());
247251
}

0 commit comments

Comments
 (0)