Skip to content

Commit ee9d309

Browse files
committed
[NFC] Added TODO about phi pruning of lifetimes.
1 parent 8af76de commit ee9d309

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/SILOptimizer/Transforms/SILMem2Reg.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,11 @@ StoreInst *StackAllocationPromoter::promoteAllocationInBlock(
666666
runningVals = beginLexicalLifetimeAfterStore(asi, si);
667667
// Create a use of the newly created copy in order to keep phi pruning
668668
// from deleting our lifetime beginning instructions.
669+
//
670+
// TODO: Remove this hack, it is only necessary because erasePhiArgument
671+
// calls deleteEdgeValue which calls
672+
// deleteTriviallyDeadOperandsOfDeadArgument and deletes the copy
673+
// and borrow that we added and want not to have deleted.
669674
SILBuilderWithScope::insertAfter(
670675
runningVals->value.copy->getDefiningInstruction(),
671676
[&](auto builder) {

0 commit comments

Comments
 (0)