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.
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:
There if we inspect the CFG we can see the said block. Then, we can check that gen_primitiveLoopIncrementing contains an infinite loop.