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

If an IR's BasicBlock jumps to itself, the Cogit code generated from it will be broken #123

Open
doste opened this issue Mar 14, 2024 · 0 comments

Comments

@doste
Copy link
Collaborator

doste commented Mar 14, 2024

When dealing with an IR that has a self loop, the IR->Cogit translation is broken.
If a BasicBlock has a Jump to itself, the Cogit code generated will have an infinite loop.

A concrete example of this can be seen when generating the primitive primitiveLoopIncrementing.
Here we can see that the corresponding IR, after some the optimizations, will have a BasicBlock jumping to itself.

To check this we can do something like this:

        cfg := self generateBasicDruidIRFor: #primitiveLoopIncrementing.
	self optimize: cfg.
	1halt.

There if we inspect the CFG we can see the said block.
Then, we can check that gen_primitiveLoopIncrementing contains an infinite loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant