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

Don't log warnings for certain RemoveAttributeInstances #91782

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

MichalStrehovsky
Copy link
Member

Fixes #88994.

ILLinker attribute XML format has a way to express "only remove these attributes when parameter X has value of Y". We currently generate a warning and don't trim the attribute at all.

The savings from trimming these attributes are going to be miniscule. Even in IL, this is scraping the bottom of the barrel. In Native AOT these attributes are pretty effectively deduplicated across assemblies. We'll likely never need this.

This keeps the existing behavior (don't trim the attribute), but removes the warning.

Cc @dotnet/ilc-contrib

Fixes #88994.

ILLinker attribute XML format has a way to express "only remove these attributes when parameter X has value of Y". We currently generate a warning and don't trim the attribute at all.

The savings from trimming these attributes are going to be miniscule. Even in IL, this is scraping the bottom of the barrel. In Native AOT these attributes are pretty effectively deduplicated across assemblies. We'll likely never need this.

This keeps the existing behavior (don't trim the attribute), but removes the warning.
@ghost
Copy link

ghost commented Sep 8, 2023

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #88994.

ILLinker attribute XML format has a way to express "only remove these attributes when parameter X has value of Y". We currently generate a warning and don't trim the attribute at all.

The savings from trimming these attributes are going to be miniscule. Even in IL, this is scraping the bottom of the barrel. In Native AOT these attributes are pretty effectively deduplicated across assemblies. We'll likely never need this.

This keeps the existing behavior (don't trim the attribute), but removes the warning.

Cc @dotnet/ilc-contrib

Author: MichalStrehovsky
Assignees: -
Labels:

area-NativeAOT-coreclr

Milestone: -

@ivanpovazan
Copy link
Member

/cc: @rolfbjarne

Copy link
Member

@vitek-karas vitek-karas left a comment

Choose a reason for hiding this comment

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

We're likely missing a test here - this should have been caught by a test.

I agree that if NativeAOT doesn't support that feature, it should not warn because of it being used.

@MichalStrehovsky
Copy link
Member Author

We're likely missing a test here - this should have been caught by a test.

We have validation for the things that work (unconditional removal) in Native AOT smoke test suite. We just don't run the shared ILLinker tests for these. We probably don't have any sort of Kept validation for attributes. One could extract that information from the dependency graph in theory.

@MichalStrehovsky MichalStrehovsky merged commit a603693 into main Sep 11, 2023
@MichalStrehovsky MichalStrehovsky deleted the MichalStrehovsky-patch-3 branch September 11, 2023 07:56
@MichalStrehovsky
Copy link
Member Author

/backport to release-8.0

@github-actions
Copy link
Contributor

Started backporting to release-8.0: https://github.com/dotnet/runtime/actions/runs/6143538866

@github-actions
Copy link
Contributor

@MichalStrehovsky an error occurred while backporting to release-8.0, please check the run log for details!

Error: The specified backport target branch release-8.0 wasn't found in the repo.

@MichalStrehovsky
Copy link
Member Author

/backport to release/8.0

@github-actions
Copy link
Contributor

Started backporting to release/8.0: https://github.com/dotnet/runtime/actions/runs/6143568355

@ghost ghost locked as resolved and limited conversation to collaborators Oct 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple IL2049 warnings when publishing with NativeAOT and _AggressiveAttributeTrimming
4 participants