Skip to content

SIL: Resilient types don't need to be treated as addressable-for-dependencies inside their resilience domain. #81583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

jckarter
Copy link
Contributor

Outside of the resilience domain, they have to be treated as opaque and therefore potentially addressable-for-dependencies, but inside of the resilience domain, we may take advantage of knowing the type layout to load indirect parameters out of memory and break the (unnecessary) dependency on a fixed memory location. Fixes rdar://151268401.

We do still however have problems when the type is actually @_addressableForDependencies inside of its resilience domain (rdar://151500074). I'll fix that in a follow up.

@jckarter jckarter requested a review from eeckstein as a code owner May 17, 2025 01:01
@jckarter
Copy link
Contributor Author

@swift-ci Please test

…ndencies inside their resilience domain.

Outside of the resilience domain, they have to be treated as opaque and therefore potentially
addressable-for-dependencies, but inside of the resilience domain, we may take advantage of
knowing the type layout to load indirect parameters out of memory and break the (unnecessary)
dependency on a fixed memory location. Fixes rdar://151268401.

We do still however have problems when the type is actually `@_addressableForDependencies`
inside of its resilience domain (rdar://151500074). I'll fix that in a follow up.
@jckarter jckarter force-pushed the resilient-types-arent-addressable-inside-resilience-domain branch from da283e2 to 21c1790 Compare May 19, 2025 16:07
@jckarter
Copy link
Contributor Author

@swift-ci Please test

@jckarter jckarter merged commit 10a80f5 into swiftlang:main May 20, 2025
5 checks passed
@3405691582
Copy link
Member

3405691582 commented May 21, 2025

After bisecting, this change appears to cause a crash for the compiler built with bootstrap_stage0 when building bootstrap_stage1 when compiling Swift.o:

...
3.      While evaluating request ExecuteSILPipelineRequest(Run pipelines { PrepareOptimizationPasses, EarlyModulePasses, 
HighLevel,Function+EarlyLoopOpt, HighLevel,Module+StackPromote, MidLevel,Function, ClosureSpecialize, 
LowLevel,Function, LateLoopOpt, SIL Debug Info Generator } on SIL for Runtime)
4.      While running pass #706075 SILFunctionTransform "DeadStoreElimination" on SILFunction 
"@$s7Runtime8untabify33_14E27A56B0F40E3A548846D78F6DBCB0LL_8tabWidthS2S_SitF".
...

This also occurs for

...
4.      While running pass #3086215 SILFunctionTransform "DeadStoreElimination" on SILFunction 
"@$ss16_StringGutsSliceV12_slowCompare4with9expectingSbAB_s01_A16ComparisonResultOtF".
...

I am double-checking the bisect to make sure this is the right change. Would you like a full issue created for this?

@jckarter
Copy link
Contributor Author

Sounds like an issue worth filing. Do you have more information about what configuration you're seeing this bootstrap failure under?

@3405691582
Copy link
Member

I created #81698. This is reproducible on Linux/x86_64. On double-checking this, it may actually not be this commit, but possibly something the merge for this commit dragged in somehow. Fulsome details are in the issue.

hamishknight added a commit to hamishknight/swift that referenced this pull request May 22, 2025
…pes-arent-addressable-inside-resilience-domain"

This reverts commit 10a80f5.
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