Skip to content

Commit ab3204b

Browse files
committed
[region-isolation] Add support for metatype instructions.
1 parent 34dcb8d commit ab3204b

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

lib/SILOptimizer/Analysis/RegionAnalysis.cpp

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2244,6 +2244,9 @@ CONSTANT_TRANSLATION(WitnessMethodInst, AssignFresh)
22442244
CONSTANT_TRANSLATION(IntegerLiteralInst, AssignFresh)
22452245
CONSTANT_TRANSLATION(FloatLiteralInst, AssignFresh)
22462246
CONSTANT_TRANSLATION(StringLiteralInst, AssignFresh)
2247+
// Metatypes are Sendable, but AnyObject isn't
2248+
CONSTANT_TRANSLATION(ObjCMetatypeToObjectInst, AssignFresh)
2249+
CONSTANT_TRANSLATION(ObjCExistentialMetatypeToObjectInst, AssignFresh)
22472250

22482251
//===---
22492252
// Assign
@@ -2407,6 +2410,19 @@ CONSTANT_TRANSLATION(UnmanagedAutoreleaseValueInst, Require)
24072410
CONSTANT_TRANSLATION(RebindMemoryInst, Require)
24082411
CONSTANT_TRANSLATION(BindMemoryInst, Require)
24092412
CONSTANT_TRANSLATION(BeginUnpairedAccessInst, Require)
2413+
// Require of the value we extract the metatype from.
2414+
CONSTANT_TRANSLATION(ValueMetatypeInst, Require)
2415+
// Require of the value we extract the metatype from.
2416+
CONSTANT_TRANSLATION(ExistentialMetatypeInst, Require)
2417+
2418+
//===---
2419+
// Asserting If Non Sendable Parameter
2420+
//
2421+
2422+
// Takes metatypes as parameters and metatypes today are always sendable.
2423+
CONSTANT_TRANSLATION(InitExistentialMetatypeInst, AssertingIfNonSendable)
2424+
CONSTANT_TRANSLATION(OpenExistentialMetatypeInst, AssertingIfNonSendable)
2425+
CONSTANT_TRANSLATION(ObjCToThickMetatypeInst, AssertingIfNonSendable)
24102426

24112427
//===---
24122428
// Terminators
@@ -2457,17 +2473,10 @@ CONSTANT_TRANSLATION(DeallocExistentialBoxInst, Ignored)
24572473
// Unhandled Instructions
24582474
//
24592475

2460-
CONSTANT_TRANSLATION(ObjCToThickMetatypeInst, Unhandled)
2461-
CONSTANT_TRANSLATION(ObjCMetatypeToObjectInst, Unhandled)
2462-
CONSTANT_TRANSLATION(ObjCExistentialMetatypeToObjectInst, Unhandled)
24632476
CONSTANT_TRANSLATION(WeakCopyValueInst, Unhandled)
24642477
CONSTANT_TRANSLATION(StrongCopyWeakValueInst, Unhandled)
24652478
CONSTANT_TRANSLATION(StrongCopyUnmanagedValueInst, Unhandled)
2466-
CONSTANT_TRANSLATION(ValueMetatypeInst, Unhandled)
2467-
CONSTANT_TRANSLATION(ExistentialMetatypeInst, Unhandled)
24682479
CONSTANT_TRANSLATION(InitExistentialValueInst, Unhandled)
2469-
CONSTANT_TRANSLATION(InitExistentialMetatypeInst, Unhandled)
2470-
CONSTANT_TRANSLATION(OpenExistentialMetatypeInst, Unhandled)
24712480

24722481
//===---
24732482
// Differentiable

0 commit comments

Comments
 (0)