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(
775
775
CopyAddrInst *initialization = nullptr ;
776
776
MarkDependenceInst *markDep = nullptr ;
777
777
for (auto *use : stack->getUses ()) {
778
+ auto *user = use->getUser ();
778
779
// Since we removed the `dealloc_stack`s from the capture arguments,
779
780
// the only uses of this stack slot should be the initialization, the
780
781
// partial application, and possibly a mark_dependence from the
@@ -840,7 +841,13 @@ static SILValue tryRewriteToPartialApplyStack(
840
841
initialization = possibleInit;
841
842
continue ;
842
843
}
844
+ if (isa<DebugValueInst>(user) || isa<DestroyAddrInst>(user) ||
845
+ isa<DeallocStackInst>(user)) {
846
+ continue ;
847
+ }
843
848
LLVM_DEBUG (llvm::dbgs () << " -- unrecognized use\n " );
849
+ // Reset initialization on an unrecognized use
850
+ initialization = nullptr ;
844
851
break ;
845
852
}
846
853
if (!initialization) {
You can’t perform that action at this time.
0 commit comments