Skip to content

Commit 872edea

Browse files
committed
[region-isolation] Add support for debug_step.
1 parent f6d7983 commit 872edea

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

lib/SILOptimizer/Analysis/RegionAnalysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2094,6 +2094,7 @@ CONSTANT_TRANSLATION(IsEscapingClosureInst, Ignored)
20942094
CONSTANT_TRANSLATION(MetatypeInst, Ignored)
20952095
CONSTANT_TRANSLATION(EndApplyInst, Ignored)
20962096
CONSTANT_TRANSLATION(AbortApplyInst, Ignored)
2097+
CONSTANT_TRANSLATION(DebugStepInst, Ignored)
20972098

20982099
//===---
20992100
// Require
@@ -2197,7 +2198,6 @@ CONSTANT_TRANSLATION(AssignInst, Unhandled)
21972198
CONSTANT_TRANSLATION(AssignByWrapperInst, Unhandled)
21982199
CONSTANT_TRANSLATION(AssignOrInitInst, Unhandled)
21992200
CONSTANT_TRANSLATION(MarkFunctionEscapeInst, Unhandled)
2200-
CONSTANT_TRANSLATION(DebugStepInst, Unhandled)
22012201
CONSTANT_TRANSLATION(TestSpecificationInst, Unhandled)
22022202
CONSTANT_TRANSLATION(StoreUnownedInst, Unhandled)
22032203
CONSTANT_TRANSLATION(DeinitExistentialAddrInst, Unhandled)

test/Concurrency/transfernonsendable_instruction_matching.sil

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,4 +831,24 @@ bb0:
831831
destroy_value %value : $NonSendableKlass
832832
%9999 = tuple ()
833833
return %9999 : $()
834-
}
834+
}
835+
836+
sil [ossa] @debug_step_test : $@convention(thin) @async () -> () {
837+
bb0:
838+
%constructFn = function_ref @constructNonSendableKlass : $@convention(thin) () -> @owned NonSendableKlass
839+
%value = apply %constructFn() : $@convention(thin) () -> @owned NonSendableKlass
840+
841+
%unowned = ref_to_unowned %value : $NonSendableKlass to $@sil_unowned NonSendableKlass
842+
%ref = unowned_to_ref %unowned : $@sil_unowned NonSendableKlass to $NonSendableKlass
843+
%refCopy = copy_value %ref : $NonSendableKlass
844+
%transferNonSendableKlass = function_ref @transferNonSendableKlass : $@convention(thin) @async (@guaranteed NonSendableKlass) -> ()
845+
apply [caller_isolation=nonisolated] [callee_isolation=global_actor] %transferNonSendableKlass(%refCopy) : $@convention(thin) @async (@guaranteed NonSendableKlass) -> ()
846+
847+
// Just make sure the pass sees the instruction
848+
debug_step
849+
850+
destroy_value %refCopy : $NonSendableKlass
851+
destroy_value %value : $NonSendableKlass
852+
%9999 = tuple ()
853+
return %9999 : $()
854+
}

0 commit comments

Comments
 (0)