Closed Fare9 closed 1 year ago
In some of the presented test, current algorithm crash, for what I see in the given URL it's possible to obtain a reference to the list of arguments from each jump, so it would be possible to apply the algorithm from the SSA paper without the Phi nodes.
For the moment the next commit fix part of the issue, and include the code from the link: https://github.com/Fare9/KUNAI-static-analyzer/commit/297d8fb702bb5884fd9ea4d98e2c340cea5da911
Algorithm has been changed, and tested with different cases, now it should be working.
The algorithm of SSA Generation created the terminal instructions after generating all the basic blocks, probably it is possible to follow the next code: https://github.com/J-MR-T/blc/blob/50da676f8c3fa965d5c877534cb068bdfc95dcf2/src/mlir.cpp#L163-L187 generate the terminal instructions in the moment they are found and later apply the generation of basic block parameters.