Skip to content

[ownership] Some more comment post-commit fixes for ffa55937c4fa3b843 0e946321e151fe54c0f4060 #35434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/SILOptimizer/SILCombiner/SILCombine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ bool SILCombiner::trySinkOwnedForwardingInst(SingleValueInstruction *svi) {
svi->moveBefore(consumingUser);
MadeChange = true;

// NOTE: We return nullptr here so that our caller doesn't delete the
// NOTE: We return false here so that our caller doesn't delete the
// instruction and instead tries to simplify it.
return false;
}
Expand Down
4 changes: 0 additions & 4 deletions lib/SILOptimizer/SILCombiner/SILCombiner.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,6 @@ class SILCombiner :
bool optimizeIdentityCastComposition(ApplyInst *FInverse,
StringRef FInverseName, StringRef FName);

/// Let \p user and \p value be two forwarding single value instructions with
/// the property that \p user, through potentially a chain of forwarding
/// instructions.
///
/// Let \p user and \p value be two forwarding single value instructions with
/// the property that \p value is the value that \p user forwards. In this
/// case, this helper routine will eliminate \p value if it can rewrite user
Expand Down
8 changes: 4 additions & 4 deletions lib/SILOptimizer/SILCombiner/SILCombinerCastVisitors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ class SingleBlockOwnedForwardingInstFolder {
if (!hasOneNonDebugUse(next))
return false;

assert(getSingleNonDebugUser(rest.back()) == next);
rest.push_back(next);
return true;
}
Expand All @@ -166,14 +167,13 @@ class SingleBlockOwnedForwardingInstFolder {
}

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