Repository navigation
Add IL scanner phase - #3503
Add IL scanner phase#3503
Conversation
Having the compilation builder create the scanner builder is a bit weird, but scanners will potentially need to be customized for various backends and it seems better than making the user exposed to selecting name mangling schemes.
|
Dropping the WIP tag. I still see a couple diffs when comparing to RyuJIT, but at least some of them are caused by #3608 that I'll need to go fix. Let's review this. |
| private DependencyAnalyzerBase<NodeFactory> CreateDependencyGraph(NodeFactory factory) | ||
| { | ||
| // Choose which dependency graph implementation to use based on the amount of logging requested. | ||
| switch (_dependencyTrackingLevel) |
There was a problem hiding this comment.
This is duplicated from CompilationBuilder. Refactor to a static helper that takes _dependencyTrackingLevel as an argument?
|
@kouvel @AntonLapounov @sergiy-k The Ubuntu Debug assertion might be unrelated. There's very little code in this pull request that actually runs (pretty much only the small refactorings to |
|
Looks good. I dislike that we can only have one variant of the ilscanner per binary due to the partial class implementation sharing, and we may wish to have more implementations of this thing in the future, but that's not an issue which I'd like to see you fix at this time. (Its fixable with no/negligible perf loss by going enthusiastic with generics and constraints, but I'm not sure I want to propose that.) |
Yes, I spent a couple hours trying to find a scheme where we could share the importer differently, but ended up kicking CppCodegen out of this assembly instead (#3468) - because as you noted, we had a need to have the importer in both, and I didn't want us to pay the perf penalty. We might be able to come up with a scheme where we make the scanner itself shareable (because most parts of the scanner-specific importer are boring). |
I don't see a link to a dump in the build output, and I couldn't find a dump on dumpling corresponding to this failure based on the build time. There's probably not much else in the build output that would be useful. Would need to try to repro this or figure it out from the stack trace. |
Sending this out to give people a chance to give early feedback.
This adds an initial (empty) implementation of an IL scanner that will scan method bodies, starting from the provided compilation roots, and expand the dependency graph based on scanning the IL, to determine the set of methods (and types, and other interesting artifacts) that will be compiled.
This nicely plugs into the existing architecture where the scanner looks almost just like another codegen backend - we have a separate NodeFactory for it, a separate builder class, and a separate compilation class. The actual IL parsing reuses the importer written for CppCodegen and ILVerifier.
The results of the scanning phase will flow into the metadata generator and potentially other parts of the system.