[Mono] Add the capability of trimming IL code of individual methods#86722
Merged
fanyang-mono merged 27 commits intodotnet:mainfrom Jun 16, 2023
Merged
[Mono] Add the capability of trimming IL code of individual methods#86722fanyang-mono merged 27 commits intodotnet:mainfrom
fanyang-mono merged 27 commits intodotnet:mainfrom
Conversation
Comment on lines
47
to
49
| int allowedParallelism = DisableParallelStripping ? 1 : Math.Min(Assemblies.Length, Environment.ProcessorCount); | ||
| if (BuildEngine is IBuildEngine9 be9) | ||
| allowedParallelism = be9.RequestCores(allowedParallelism); |
Contributor
There was a problem hiding this comment.
Suggested change
| int allowedParallelism = DisableParallelStripping ? 1 : Math.Min(Assemblies.Length, Environment.ProcessorCount); | |
| if (BuildEngine is IBuildEngine9 be9) | |
| allowedParallelism = be9.RequestCores(allowedParallelism); | |
| int allowedParallelism = DisableParallelStripping ? 1 : BuildEngine9.RequestCores(Math.Min(Assemblies.Length, Environment.ProcessorCount)); |
Member
Author
There was a problem hiding this comment.
I hit an error when applying your change
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Comment on lines
77
to
79
| int allowedParallelism = DisableParallelStripping ? 1 : Math.Min(MethodTokenFiles.Length, Environment.ProcessorCount); | ||
| if (BuildEngine is IBuildEngine9 be9) | ||
| allowedParallelism = be9.RequestCores(allowedParallelism); |
Contributor
There was a problem hiding this comment.
Suggested change
| int allowedParallelism = DisableParallelStripping ? 1 : Math.Min(MethodTokenFiles.Length, Environment.ProcessorCount); | |
| if (BuildEngine is IBuildEngine9 be9) | |
| allowedParallelism = be9.RequestCores(allowedParallelism); | |
| int allowedParallelism = DisableParallelStripping ? 1 : BuildEngine9.RequestCores(Math.Min(Assemblies.Length, Environment.ProcessorCount)); |
This was referenced May 25, 2023
ivanpovazan
reviewed
May 29, 2023
ivanpovazan
reviewed
May 29, 2023
ivanpovazan
reviewed
May 29, 2023
ivanpovazan
reviewed
May 29, 2023
ivanpovazan
reviewed
May 29, 2023
Member
|
It would be nice to include a specification/documentation of how this feature is used/enabled (possibly with an example of |
vargaz
reviewed
May 31, 2023
Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
radical
reviewed
Jun 6, 2023
radical
requested changes
Jun 12, 2023
Co-authored-by: Ankit Jain <radical@gmail.com>
Member
Author
|
CI failures are not related to this PR. |
jonathanpeppers
added a commit
to jonathanpeppers/xamarin-android
that referenced
this pull request
Jul 6, 2023
Context: dotnet/runtime#86722 This adds an `<ILStrip/>` step after the `<MonoAOTCompiler/>` task. This trims away IL of AOT-compiled methods. This is WIP. Builds work currently, but the app crashes at runtime with: 07-06 16:57:07.413 8865 8865 E companyname.foo: * Assertion at /__w/1/s/src/mono/mono/mini/mini-trampolines.c:1416, condition `invoke' not met
This was referenced Jul 6, 2023
This was referenced Jul 11, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Contributes to #44855
@jonathanpeppers After this is merged. It should be adoptable by Android. I have updated the HelloWorld sample as an example to showcase how to use this feature.
Usage of this feature:
CollectCompiledMethodsandCompiledMethodsOutputDirectoryforMonoAOTCompilerILStripafterMonoAOTCompilerFor more details, please refer to the HelloWorld sample app change included in this PR.