Skip to content

Don't optimize alloc_stack with dynamic_lifetime in TempLValueElimination#88594

Open
meg-gupta wants to merge 1 commit intoswiftlang:mainfrom
meg-gupta:templvaluebailout
Open

Don't optimize alloc_stack with dynamic_lifetime in TempLValueElimination#88594
meg-gupta wants to merge 1 commit intoswiftlang:mainfrom
meg-gupta:templvaluebailout

Conversation

@meg-gupta
Copy link
Copy Markdown
Contributor

  • Explanation: The [dynamic_lifetime] attribute represents that the stack location's initialization state is tracked dynamically via a boolean flag — it may be uninitialized at certain program points. TempLValueElimination pass can replace an alloc_stack [dynamic_lifetime] with a destination alloc_stack that does not have dynamic_lifetime. This results in invalid SIL which triggers verifier errors due to lifetime mismatches in some program paths in ossa.

This PR fixes this issue by bailing out of TempLValueElimination for alloc_stack [dynamic_lifetime] in ossa.

…tion

The [dynamic_lifetime] attribute represents that the stack location's initialization state is tracked dynamically via a boolean flag — it may be uninitialized at certain program points. TempLValueElimination pass can replace an alloc_stack [dynamic_lifetime] with a destination alloc_stack that does not have dynamic_lifetime. This results in invalid SIL which triggers verifier errors due to lifetime mismatches in some program paths in ossa.

This PR fixes this issue by bailing out of TempLValueElimination for alloc_stack [dynamic_lifetime] in ossa.

Resolves rdar://175097584
@meg-gupta meg-gupta requested a review from eeckstein April 21, 2026 19:24
@meg-gupta meg-gupta requested a review from a team as a code owner April 21, 2026 19:24
@meg-gupta
Copy link
Copy Markdown
Contributor Author

@swift-ci test

@meg-gupta meg-gupta requested a review from atrick April 21, 2026 19:27
Copy link
Copy Markdown
Contributor

@eeckstein eeckstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants