Solang's intermediate representation does not use a static single assignment (SSA) form. This has introduced some ugliness in our code base. For instance, we have two three different implementations of reaching definitions: one for strength reduce, another for the vector to slice pass and a third one for all other optimization passes.
Advantages
SSA renders reaching definitions unnecessary and may carry enough information for all optimization passes.
This eliminates some tricks in our code to bypass the absence of SSA, like this one.
SSA streamlines the implementation of liveness analysis, allowing us to remove our impromptu unused variable removal code.
The CFG needs only small changes to support SSA.
Caveats
CFG::Instr need to be refactored to accommodate Phi instructions.
Challenges
We need to refactor our VarTable dirty tracker.
This will imply changes in emit.
All existing optimization passes need to be adapted.
Solang's intermediate representation does not use a static single assignment (SSA) form. This has introduced some ugliness in our code base. For instance, we have two three different implementations of reaching definitions: one for strength reduce, another for the vector to slice pass and a third one for all other optimization passes.
Advantages
Caveats
CFG::Instr
need to be refactored to accommodate Phi instructions.Challenges