@@ -5381,6 +5381,11 @@ class DebugStepInst final
53815381 MutableArrayRef<Operand> getAllOperands () { return {}; }
53825382};
53835383
5384+ enum PoisonRefs_t : bool {
5385+ DontPoisonRefs = false ,
5386+ PoisonRefs = true ,
5387+ };
5388+
53845389// / Define the start or update to a symbolic variable value (for loadable
53855390// / types).
53865391class DebugValueInst final
@@ -5397,11 +5402,11 @@ class DebugValueInst final
53975402 USE_SHARED_UINT8;
53985403
53995404 DebugValueInst (SILDebugLocation DebugLoc, SILValue Operand,
5400- SILDebugVariable Var, bool poisonRefs,
5405+ SILDebugVariable Var, PoisonRefs_t poisonRefs,
54015406 UsesMoveableValueDebugInfo_t operandWasMoved, bool trace);
54025407 static DebugValueInst *create (SILDebugLocation DebugLoc, SILValue Operand,
54035408 SILModule &M, SILDebugVariable Var,
5404- bool poisonRefs,
5409+ PoisonRefs_t poisonRefs,
54055410 UsesMoveableValueDebugInfo_t operandWasMoved,
54065411 bool trace);
54075412 static DebugValueInst *createAddr (SILDebugLocation DebugLoc, SILValue Operand,
@@ -5511,9 +5516,11 @@ class DebugValueInst final
55115516 // / OSSA lowering. It should not be necessary to model the poison operation as
55125517 // / a side effect, which would violate the rule that debug_values cannot
55135518 // / affect optimization.
5514- bool poisonRefs () const { return sharedUInt8 ().DebugValueInst .poisonRefs ; }
5519+ PoisonRefs_t poisonRefs () const {
5520+ return PoisonRefs_t (sharedUInt8 ().DebugValueInst .poisonRefs );
5521+ }
55155522
5516- void setPoisonRefs (bool poisonRefs = true ) {
5523+ void setPoisonRefs (PoisonRefs_t poisonRefs = PoisonRefs ) {
55175524 sharedUInt8 ().DebugValueInst .poisonRefs = poisonRefs;
55185525 }
55195526
@@ -8799,15 +8806,22 @@ class UnownedCopyValueInst
87998806 };
88008807#include " swift/AST/ReferenceStorage.def"
88018808
8809+ enum IsDeadEnd_t : bool {
8810+ IsntDeadEnd = false ,
8811+ IsDeadEnd = true ,
8812+ };
8813+
88028814class DestroyValueInst
88038815 : public UnaryInstructionBase<SILInstructionKind::DestroyValueInst,
88048816 NonValueInstruction> {
88058817 friend class SILBuilder ;
88068818 USE_SHARED_UINT8;
88078819
8808- DestroyValueInst (SILDebugLocation DebugLoc, SILValue operand, bool poisonRefs)
8820+ DestroyValueInst (SILDebugLocation DebugLoc, SILValue operand,
8821+ PoisonRefs_t poisonRefs, IsDeadEnd_t isDeadEnd)
88098822 : UnaryInstructionBase(DebugLoc, operand) {
8810- setPoisonRefs (poisonRefs);
8823+ sharedUInt8 ().DestroyValueInst .poisonRefs = poisonRefs;
8824+ sharedUInt8 ().DestroyValueInst .deadEnd = isDeadEnd;
88118825 }
88128826
88138827public:
@@ -8824,15 +8838,21 @@ class DestroyValueInst
88248838 // / transformations keep the poison operation associated with the destroy
88258839 // / point. After OSSA, these are lowered to 'debug_values [poison]'
88268840 // / instructions, after which the Onone pipeline should avoid code motion.
8827- bool poisonRefs () const { return sharedUInt8 ().DestroyValueInst .poisonRefs ; }
8841+ PoisonRefs_t poisonRefs () const {
8842+ return PoisonRefs_t (sharedUInt8 ().DestroyValueInst .poisonRefs );
8843+ }
88288844
8829- void setPoisonRefs (bool poisonRefs = true ) {
8845+ void setPoisonRefs (PoisonRefs_t poisonRefs = PoisonRefs ) {
88308846 sharedUInt8 ().DestroyValueInst .poisonRefs = poisonRefs;
88318847 }
8832-
8848+
88338849 // / If the value being destroyed is a stack allocation of a nonescaping
88348850 // / closure, then return the PartialApplyInst that allocated the closure.
88358851 PartialApplyInst *getNonescapingClosureAllocation () const ;
8852+
8853+ IsDeadEnd_t isDeadEnd () const {
8854+ return IsDeadEnd_t (sharedUInt8 ().DestroyValueInst .deadEnd );
8855+ }
88368856};
88378857
88388858class MoveValueInst
@@ -9443,8 +9463,19 @@ class DeallocBoxInst
94439463{
94449464 friend SILBuilder;
94459465
9446- DeallocBoxInst (SILDebugLocation DebugLoc, SILValue operand)
9447- : UnaryInstructionBase(DebugLoc, operand) {}
9466+ USE_SHARED_UINT8;
9467+
9468+ public:
9469+ IsDeadEnd_t isDeadEnd () const {
9470+ return IsDeadEnd_t (sharedUInt8 ().DeallocBoxInst .deadEnd );
9471+ }
9472+
9473+ private:
9474+ DeallocBoxInst (SILDebugLocation DebugLoc, SILValue operand,
9475+ IsDeadEnd_t isDeadEnd)
9476+ : UnaryInstructionBase(DebugLoc, operand) {
9477+ sharedUInt8 ().DeallocBoxInst .deadEnd = isDeadEnd;
9478+ }
94489479};
94499480
94509481// / Deallocate memory allocated for a boxed existential container created by
0 commit comments