Fix findTransitiveUses to only record leaf uses.

Recording uses is now optional. This utility is also used simply to
check for PointerEscape. When uses are recorded, they are used to
extend a live range. There could be a large number of transitive uses
that we don't want to pass back to the caller.
This commit is contained in:
Andrew Trick
2021-10-01 16:49:01 -07:00
parent 1678354332
commit a336bcdea9
5 changed files with 58 additions and 45 deletions

View File

@@ -100,8 +100,7 @@ static bool canBorrowGuaranteedResult(SILValue guaranteedResult) {
// conversion to a non-guaranteed value. Either way, not interesting.
return true;
}
SmallVector<Operand *, 16> usePoints;
return findInnerTransitiveGuaranteedUses(guaranteedResult, usePoints);
return findInnerTransitiveGuaranteedUses(guaranteedResult);
}
bool swift::canCloneTerminator(TermInst *termInst) {