aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/optimize.c
AgeCommit message (Collapse)AuthorFilesLines
2018-07-01ssa: activate the new SSA conversionLuc Van Oostenryck1-1/+2
This activate the new SSA conversion that will be used to replace simplify_symbol_usage() which created invalid SSA (phi-nodes were placed where the value was needed instead of where the paths meet, also and partially related, it was possible for a phi-node to have more operands/sources than the BB it was in had parents). Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2018-07-01dom: build the domtree before optimizationLuc Van Oostenryck1-0/+3
Now that can build the dominance tree, let's effectivey build it. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2018-06-16ir-validate: add more validation pointsLuc Van Oostenryck1-0/+7
2018-06-16ir-validate: add framework for IR validationLuc Van Oostenryck1-0/+3
To be meaningful, the IR instructions and their relationships must obey some constraints. This patch add the framework for doing this kind of validation. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2018-03-14optim: fix optimization loop's conditionLuc Van Oostenryck1-2/+2
The main inner & outer optimization loop must not only rerun if some CSE changes occured but must do so if any change occur. Insure this by testing any of the REPEAT_... flags as loop condition. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2018-03-14optim: no need to kill_unreachable_bbs() after main loopLuc Van Oostenryck1-1/+0
Now that unreachable BBs are removed after BB packing it's not needed to try to removed them again after the main loop. Remove the unneeded call to kill_unreachable_bbs() after the main optimization loop. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2018-03-14optim: kill unreachable BBS after CFG simplificationLuc Van Oostenryck1-0/+4
Normal instruction simplification & CSE must not be done on dead block (otherwise it's possible to have unsound situations like having an instruction defining its own operand with possible infinite loops as consequence). This is insured by the main optimization loop but not after BB packing or flow simplification. Fix this by calling kill_unreachabe_bbs() after BB packing and flow simplification. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2018-02-24move the inner optimization loop into the main loopLuc Van Oostenryck1-19/+12
Moving the inner optimization loop into the main one help to see the real structure of the optimization logic and facilitate experiments there and any needed changes. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2018-02-24move inner optimization loop into optimize.cLuc Van Oostenryck1-0/+38
The code for the inner optimization loop was in the same file than the one for CSE. Now that the CSE have a well defined interface, we can move this inner loop together with the main optimization loop in optimize.c This move make the code better structured and make it easier to understand the optimization logic and make any experiment or needed changes to it. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2018-02-24move liveness interface to its own headerLuc Van Oostenryck1-0/+1
Currently, the interface for liveness analysis is declared in the flow.h header file. There is no a real need to move it to its own file but it's the dual of the previous patch and help a bit to make the code structure clearer. Move the prototype for liveness analysis to its own header. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2018-02-24move the optimization loop in its own fileLuc Van Oostenryck1-0/+76
Once linearized, a few essentials optimizations are done but the logic of the succession of these optimizations is open-coded at the end of linearize_fn(). Obviously, this logic have nothing to do with the linearization and moving it to a separate file will help to clarify this logic and change it when needed. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>