Skip to content
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

[WIP][mono] Add ILLink vector substitutions #79753

Closed
wants to merge 1 commit into from

Conversation

kotlarmilos
Copy link
Member

Add ILLink substitutions to allow Vector classes trimming. Size reduction for iOS sample app should be 8%. Similar is done in #79672.

Draft PR should confirm if the runtime works as expected.

cc @ivanpovazan

@kotlarmilos kotlarmilos self-assigned this Dec 16, 2022
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@ghost ghost added the linkable-framework Issues associated with delivering a linker friendly framework label Dec 16, 2022
@ghost
Copy link

ghost commented Dec 16, 2022

Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @sbomer, @joperezr
See info in area-owners.md if you want to be subscribed.

Issue Details

Add ILLink substitutions to allow Vector classes trimming. Size reduction for iOS sample app should be 8%. Similar is done in #79672.

Draft PR should confirm if the runtime works as expected.

cc @ivanpovazan

Author: kotlarmilos
Assignees: kotlarmilos
Labels:

linkable-framework

Milestone: -

@kotlarmilos kotlarmilos added NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) NO-REVIEW Experimental/testing PR, do NOT review it labels Dec 16, 2022
@kotlarmilos kotlarmilos changed the title [mono] Add ILLink vector substitutions [WIP][mono] Add ILLink vector substitutions Dec 16, 2022
@SamMonoRT
Copy link
Member

/cc @fanyang-mono

@fanyang-mono
Copy link
Member

I am trying to understand the impact of this change. According to

<ILLinkSubstitutionsXmls Include="$(ILLinkSharedDirectory)ILLink.Substitutions.NoArmIntrinsics.xml" Condition="'$(SupportsArmIntrinsics)' != 'true'" />

ILLink.Substitutions.NoArmIntrinsics.xml will only be included, when SupportsArmIntrinsics is false. Does the value of SupportsArmIntrinsics equal to false on iOS?

@fanyang-mono
Copy link
Member

Also, these files are shared between Mono and CoreCLR. I can imagine changing this file would change the behavior of both runtimes. If we want to tailor Mono runtime behavior but not changing CoreCLR, we probably should create a new file.

@ivanpovazan
Copy link
Member

ILLink.Substitutions.NoArmIntrinsics.xml will only be included, when SupportsArmIntrinsics is false. Does the value of SupportsArmIntrinsics equal to false on iOS?

@fanyang-mono I believe when targeting iOS devices most of the time the target architecture is arm64, which means that from:

<SupportsArmIntrinsics Condition="'$(Platform)' == 'arm64'">true</SupportsArmIntrinsics>

the linker would actually include NoX86Intrinsics.xml

@kotlarmilos
Copy link
Member Author

Also, these files are shared between Mono and CoreCLR. I can imagine changing this file would change the behavior of both runtimes. If we want to tailor Mono runtime behavior but not changing CoreCLR, we probably should create a new file.

Makes sense.

the linker would actually include NoX86Intrinsics.xml

In both scenarios there should a size reduction as some code will be trimmed.

@kotlarmilos
Copy link
Member Author

Finding is that in AOT mode for iOS apps we are not allowed to trim fallback code in vectors as JIT and Interpreter don't support vector intrinsics yet. Once vector intrinsics are supported in JIT and Interpreter we will be allowed to trim the fallback code.

@kotlarmilos kotlarmilos deleted the vector-substitutions branch December 16, 2022 17:02
@ghost ghost locked as resolved and limited conversation to collaborators Jan 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
linkable-framework Issues associated with delivering a linker friendly framework NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) NO-REVIEW Experimental/testing PR, do NOT review it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants