-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[ILLink] Mark recursive interface implementations in MarkStep #99922
Conversation
- ILVerify will fail due to members not being kept, so to make the errors more informative, run kept member validation first, then ILVerify
The only test diff compared with #99566 comes in MultipleDimsProvidedByRecursiveInterface.cs: @@ -16,14 +16,16 @@ namespace Mono.Linker.Tests.Cases.Inheritance.Interfaces.DefaultInterfaceMethods
[KeptMemberInAssembly ("library.dll", typeof(Program.I0), "Method()")]
[KeptTypeInAssembly ("library.dll", typeof(Program.I00))]
[KeptMemberInAssembly ("library.dll", typeof(Program.I00), "Program.I0.Method()")]
- [KeptMemberInAssembly ("library.dll", typeof(Program.I01), "Program.I0.Method()")]
+ // Bug: DIM resolution doesn't look at recursive interfaces
+ //[KeptMemberInAssembly ("library.dll", typeof(Program.I01), "Program.I0.Method()")]
[KeptInterfaceOnTypeInAssembly ("library.dll", typeof (Program.I00), "library.dll", typeof (Program.I0))]
[KeptInterfaceOnTypeInAssembly ("library.dll", typeof (Program.MyFoo), "library.dll", typeof (Program.I000))]
[KeptTypeInAssembly ("library.dll", typeof(Program.I000))]
[KeptInterfaceOnTypeInAssembly ("library.dll", typeof (Program.I000), "library.dll", typeof (Program.I00))]
- [KeptInterfaceOnTypeInAssembly ("library.dll", typeof (Program.MyFoo), "library.dll", typeof (Program.I010))]
- [KeptInterfaceOnTypeInAssembly ("library.dll", typeof (Program.I010), "library.dll", typeof (Program.I01))]
- [KeptInterfaceOnTypeInAssembly ("library.dll", typeof (Program.I01), "library.dll", typeof (Program.I0))]
+ // Bug: DIM resolution doesn't look at recursive interfaces
+ //[KeptInterfaceOnTypeInAssembly ("library.dll", typeof (Program.MyFoo), "library.dll", typeof (Program.I010))]
+ //[KeptInterfaceOnTypeInAssembly ("library.dll", typeof (Program.I010), "library.dll", typeof (Program.I01))]
+ //[KeptInterfaceOnTypeInAssembly ("library.dll", typeof (Program.I01), "library.dll", typeof (Program.I0))]
#endif
class MultipleDimsProvidedByRecursiveInterface
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we mitigate the perf impact by caching the recursive interfaces? It seems like that would still be substantially simpler than #99566.
...s/illink/test/Mono.Linker.Tests.Cases/UnreachableBlock/CompilerGeneratedCodeSubstitutions.cs
Show resolved
Hide resolved
Do we need to update any other calls to |
Yeah, there are a few places, like interface method resolution, but they might be fairly significant changes, so should we separate them out into their own PRs? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, there are a few places, like interface method resolution, but they might be fairly significant changes, so should we separate them out into their own PRs?
That seems fine to me. The worst I would expect is that we miss marking some interfaces which we are already missing today.
Co-authored-by: Sven Boemer <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
From #99566 (comment), splitting off a simpler change that doesn't cache the recursive interfaces and doesn't use the recursive interfaces in DIM finding. This does nearly double the time it takes to trim a hello world, whereas #99566 speeds it up slightly, so I'd be concerned about timeouts if this gets merged.