[MandatoryGenericSpecializer] Fix stack nesting when lowering OSSA during inlining. #64013
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Volume three of #63980 , #64005 .
MandatoryGenericSpecializer
inlines transparent functions that it specializes.Now that in OSSA
partial_apply [on_stack]
s are represented as owned values rather than stack locations, it is possible for their destroys to violate stack discipline. A direct lowering of the instructions to non-OSSA would violate stack nesting.Previously, when inlining during
MandatoryGenericSpecializer
, it was assumed that the callee maintained stack discipline. And, when inlining an OSSA function into a non-OSSA function, OSSA instructions were lowered directly. The result was that stack discipline would be violated when directly lowering callees withpartial_apply [on_stack]
s that violate stack discipline.Here, when
MandatoryGenericSpecializer
inlines a specialized generic function in OSSA form into a function lowered out of OSSA form, stack nesting is fixed up.