File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
lib/SILOptimizer/Mandatory Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -775,6 +775,7 @@ static SILValue tryRewriteToPartialApplyStack(
775775 CopyAddrInst *initialization = nullptr ;
776776 MarkDependenceInst *markDep = nullptr ;
777777 for (auto *use : stack->getUses ()) {
778+ auto *user = use->getUser ();
778779 // Since we removed the `dealloc_stack`s from the capture arguments,
779780 // the only uses of this stack slot should be the initialization, the
780781 // partial application, and possibly a mark_dependence from the
@@ -840,7 +841,13 @@ static SILValue tryRewriteToPartialApplyStack(
840841 initialization = possibleInit;
841842 continue ;
842843 }
844+ if (isa<DebugValueInst>(user) || isa<DestroyAddrInst>(user) ||
845+ isa<DeallocStackInst>(user)) {
846+ continue ;
847+ }
843848 LLVM_DEBUG (llvm::dbgs () << " -- unrecognized use\n " );
849+ // Reset initialization on an unrecognized use
850+ initialization = nullptr ;
844851 break ;
845852 }
846853 if (!initialization) {
You can’t perform that action at this time.
0 commit comments