Skip to content

[swift-vfe] Disable for @objc classes #69434

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

Merged
merged 1 commit into from
Oct 27, 2023
Merged

[swift-vfe] Disable for @objc classes #69434

merged 1 commit into from
Oct 27, 2023

Conversation

NuriAmari
Copy link
Contributor

Swift methods can be called from Objective-C without a vtable load, and more importantly without emitting an llvm.type.checked.load instruction. These are effectively virtual callsites that are not visible to the VFE logic in GlobalDCE.

To to safely enable swift-vfe we must prevent vtables whose functions are callable from Objective-C from being eliminated.

To do this we ensure such vtables have public vcall_visibility, which indirectly prevents GlobalDCE from stripping them.

Swift methods can be called from Objective-C without a vtable
load, and more importantly without emitting an `llvm.type.checked.load`
instruction. These are effectively virtual callsites that are not
visible to the VFE logic in GlobalDCE.

To to safely enable swift-vfe we must prevent vtables whose functions
are callable from Objective-C from being eliminated.

To do this we ensure such vtables have public vcall_visibility, which
indirectly prevents GlobalDCE from stripping them.
@NuriAmari
Copy link
Contributor Author

@swift-ci Please test

@NuriAmari NuriAmari marked this pull request as ready for review October 27, 2023 17:25
@NuriAmari NuriAmari merged commit a67b818 into main Oct 27, 2023
@NuriAmari NuriAmari deleted the vfe-objc-fixes branch October 27, 2023 19:42
@NuriAmari
Copy link
Contributor Author

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