On Dec 10, 2007, at 1:23 PM, Bill Wendling wrote: > On Dec 10, 2007 11:36 AM, Evan Cheng <[EMAIL PROTECTED]> wrote: >> On Dec 10, 2007, at 6:47 AM, Dan Gohman wrote: >>> And if that's all it's doing, MachineLICM's traversal could be >>> simplified >>> a little. Instead of visiting each loop individually, taking care to >>> avoid >>> revisiting to blocks within inner loops, the pass could just >>> traverse >>> entire outer-most loops, which will implicitly include the blocks of >>> any >>> inner loops. Instructions nested deep in inner loops can then be >>> hoisted >>> all the way out of the outer-most loop in a single step instead of >>> being >>> hoisted out one loop at a time. >> >> I don't think lifting loop invariant from inner loop all the way out >> of outer-most loop is a good idea. That will increase register >> pressure in basic blocks where it is not used. >> > This is going to happen with the current pass, though. Each loop is > going to see the hoisted instructions from the previous iteration and > try to re-hoist them. Is there some heuristic we should apply to > prevent it from hoisting instructions too far? >
I am not sure. :-) For innermost loops, hoisting invariants out into the preheader always make sense. Intuitively, hoisting invariants from inner loops out of the outermost loop only makes sense when all (or a lot, whatever that means :-) of the inner loops use it. Or at least the first inner loop use it. What does the LLVM level LICM do? Evan > -bw > _______________________________________________ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits