Skip to content

Commit b16dfcd

Browse files
authored
Merge pull request #35434 from gottesmm/pr-60b428d117d8f41f7543a7a536081dff5f507ff5
[ownership] Some more comment post-commit fixes for ffa5593 0e946321e151fe54c0f4060
2 parents c0b617d + 3acb7df commit b16dfcd

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

lib/SILOptimizer/SILCombiner/SILCombine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ bool SILCombiner::trySinkOwnedForwardingInst(SingleValueInstruction *svi) {
172172
svi->moveBefore(consumingUser);
173173
MadeChange = true;
174174

175-
// NOTE: We return nullptr here so that our caller doesn't delete the
175+
// NOTE: We return false here so that our caller doesn't delete the
176176
// instruction and instead tries to simplify it.
177177
return false;
178178
}

lib/SILOptimizer/SILCombiner/SILCombiner.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,6 @@ class SILCombiner :
353353
bool optimizeIdentityCastComposition(ApplyInst *FInverse,
354354
StringRef FInverseName, StringRef FName);
355355

356-
/// Let \p user and \p value be two forwarding single value instructions with
357-
/// the property that \p user, through potentially a chain of forwarding
358-
/// instructions.
359-
///
360356
/// Let \p user and \p value be two forwarding single value instructions with
361357
/// the property that \p value is the value that \p user forwards. In this
362358
/// case, this helper routine will eliminate \p value if it can rewrite user

lib/SILOptimizer/SILCombiner/SILCombinerCastVisitors.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ class SingleBlockOwnedForwardingInstFolder {
141141
if (!hasOneNonDebugUse(next))
142142
return false;
143143

144+
assert(getSingleNonDebugUser(rest.back()) == next);
144145
rest.push_back(next);
145146
return true;
146147
}
@@ -166,14 +167,13 @@ class SingleBlockOwnedForwardingInstFolder {
166167
}
167168

168169
private:
169-
/// From backwards -> forwards, for each instruction in rest, delete all of
170-
/// its debug uses and then set its single remaining use to be SILUndef.
170+
/// Processing from def->use by walking rest backwards, delete all of its
171+
/// debug uses and then set its single remaining use to be SILUndef.
171172
///
172173
/// This means that after this runs front's forwarding operand is now
173174
/// SILUndef.
174175
void cleanupRest() & {
175-
// We process backwards -> forwards. This cleans up everything but the front
176-
// value.
176+
// We process from def->use. This cleans up everything but the front value.
177177
while (!rest.empty()) {
178178
auto *inst = rest.pop_back_val();
179179
deleteAllDebugUses(inst, SC.getInstModCallbacks());

0 commit comments

Comments
 (0)