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

Correct Storing of Variables #5

Closed
Lol3rrr opened this issue Jan 7, 2022 · 3 comments
Closed

Correct Storing of Variables #5

Lol3rrr opened this issue Jan 7, 2022 · 3 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@Lol3rrr
Copy link
Owner

Lol3rrr commented Jan 7, 2022

Right now the Compiler only keeps the Variables in Registers, this however wont work as soon as Pointers are introduced and also supported by the Backends. Because of this the IR was extended to support 2 new Statements, LoadVariable and StoreVariable.

LoadVariable

This is intended to force the Compiler to read the Variable from the Stack (or wherever it is actually placed) back into its register, i.e. forcing a reload of it.

StoreVariable

This is intended to force the Compiler to write the Variable out from the Register to the actual storage Location, making it visible from Pointers as well. This should now be generated after every assignment as it ensures that Pointers always read the correct Value from it. To not hamper Performance to much we should also later on add a new Optimization-Pass that tries to remove unnecessary stores, but only where it is proven to be valid.

@Lol3rrr Lol3rrr added bug Something isn't working enhancement New feature or request labels Jan 7, 2022
@Lol3rrr
Copy link
Owner Author

Lol3rrr commented Feb 17, 2022

This was actually added in some basic form but im not quite sure how fleshed out it is at the moment

@Lol3rrr
Copy link
Owner Author

Lol3rrr commented Feb 21, 2022

LoadVariable has been replaced by simply using an Assignment with Unknown Value, which should be translated to a memory load from the correct location in memory for the given Variable

@Lol3rrr
Copy link
Owner Author

Lol3rrr commented Apr 6, 2022

As far as i ink this should be fixed as well and is no longer relevant

@Lol3rrr Lol3rrr closed this as completed Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant