On Thu, Oct 4, 2012 at 1:30 PM, Richard Guenther <richard.guent...@gmail.com> wrote: > Isn't _REVERSE vs. non-_RESERVE still kind-of "random" order?
Not at this stage. For cfglayout mode I would answer yes, but IRA/LRA operates in cfgrtl mode, so the sequence of insns and basic blocks must match. Therefore, if you walk the basic blocks in reverse, and the insns in each basic block in reverse, you effectively work on a, let's say, "reverse extended basic block" (??) in that your program points are sequential across fallthrough edges. > Thus, doesn't > the above show there exists an optimal order for processing which we could > use? There may be a smarter order: Could even walk blocks in that order if you know a priori what path through the CFG minimizes the length of the live range chains. But to know that order, you have to build the chains. So chicken-and-egg... > (I realize _REVERSE is a simple solution, but might there not exist a > pathological case where _REVERSE is even worse than non-_REVERSE?) Intuitively, I'm certain that _REVERSE is always better than non-_REVERSE, although I don't know how to prove that :-) Ciao! Steven