Looking at the backend optimizations, it is clear that some modify the
CFG. But my understanding is that loop optimizations and unrolling are
also being moved to GIMPLE. I do not know about others.
Loop optimizations are performed on GIMPLE only because they are really
hard to perform on RTL (in the case of ivopts) or because they are
high-level optimizations (such as loop interchange).
There are indeed some parts of the back-end that could be done on GIMPLE
too (for example load PRE).
Could it be that sometime all the optimizations that modify the CFG are
run on GIMPLE?
Some more, for sure. For example, I'm working in my spare time on
moving switch statement expansion to trees so that the tree passes can
see the decision trees. But not all of them; GCSE for example can
modify the CFG (it will be preceded by a critical edge split pass on RTL
in the future).
Is there any plan/interest in having a block layout pass running at
GIMPLE level?
I don't think so, especially considering that tree->RTL expansion itself
modifies the CFG. But basic block reordering should be pretty easy to
port from RTL to trees for your own treee.
Paolo
- Re: block reordering at GIMPLE level? Paolo Bonzini
-