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

Another Different Struct for IR #8

Open
Lol3rrr opened this issue Jan 10, 2022 · 0 comments
Open

Another Different Struct for IR #8

Lol3rrr opened this issue Jan 10, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@Lol3rrr
Copy link
Owner

Lol3rrr commented Jan 10, 2022

Problem

Currently the IR can not really be cloned/copied in the Sense that you get independant Versions of it. This is very Problematic because it hinders the Options for Scaling the Optimizer as it cant run in in parallel if it needs access to information about other Functions, like for inlining.

Old-Design

The Old Design relies on Arc and WeakPointer to represent the IRs Controlflow, which works fine as it was intended, however as already noted above, this does not really allow for proper cloning/copying to create independant Objects that can be used concurrently.

New-Design

Add a new Representation where each Function contains a List of Blocks and then each Block is identified by its index in that List. All references to other Blocks are then replaced with their Index. This makes the entire Data Structure easily clonable and also makes it easier to keep track of everything.
There should also be a way to easily convert between these Formats as most of the Compiler will probably continue to use the Old-Design and just adopt the New-Design where needed, like in the Optimizer.

@Lol3rrr Lol3rrr added the enhancement New feature or request label Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant