Skip to content

Commit ff7aa3c

Browse files
committed
[LifetimeExtension] Fixed reinit collection.
During initializeLiveness, all blocks which contain destroys are to be recorded in consuming blocks. Previously, however, certain reinits were not being added. Here, all reinits are correctly added.
1 parent 8eff2e8 commit ff7aa3c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/SILOptimizer/Mandatory/MoveOnlyAddressCheckerUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,11 +1070,11 @@ void UseState::initializeLiveness(
10701070
// Now at this point, we have defined all of our defs so we can start adding
10711071
// uses to the liveness.
10721072
for (auto reinitInstAndValue : reinitInsts) {
1073+
recordConsumingBlock(reinitInstAndValue.first->getParent(),
1074+
reinitInstAndValue.second);
10731075
if (!isReinitToInitConvertibleInst(reinitInstAndValue.first)) {
10741076
liveness.updateForUse(reinitInstAndValue.first, reinitInstAndValue.second,
10751077
false /*lifetime ending*/);
1076-
recordConsumingBlock(reinitInstAndValue.first->getParent(),
1077-
reinitInstAndValue.second);
10781078
LLVM_DEBUG(llvm::dbgs() << "Added liveness for reinit: "
10791079
<< *reinitInstAndValue.first;
10801080
liveness.print(llvm::dbgs()));

0 commit comments

Comments
 (0)