[llvm-commits] [llvm] r44687 - in /llvm/trunk: include/llvm/CodeGen/Passes.h lib/CodeGen/LLVMTargetMachine.cpp lib/CodeGen/MachineLICM.cpp lib/Target/PowerPC/PPCInstrInfo.td

Bill Wendling isanbard at gmail.com
Mon Dec 10 13:20:48 PST 2007


On Dec 10, 2007 6:47 AM, Dan Gohman <djg at cray.com> wrote:
> > Thanks for pointing this out. I'll go over it when I'm doing the load/
> > store instructions in my pass.
>
> Hi Bill,
>
> How involved will MachineLICM be? After LLVM's main LICM pass runs, it
> seems all that's left for MachineLICM to do are just the constant-pool
> loads, immediates, etc. that aren't exposed in the main LLVM IR, things
> that don't require alias analysis.
>
Good point. I was just leaving the option of needing AA open just in
case. But I won't use it if not needed, of course.

> 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 just want to make sure we're visiting all defs before uses. This
way, we won't be hoisting things that shouldn't be, and, of course,
that we hoist things which we should be hoisting. Take, for example,
an invariant in a subloop that is itself part of the body of a
conditional statement. Of course, we want to hoist the instruction to
the pre-header of the subloop, but not to the pre-header of the outer
loop. To make sure we do this without visiting the subloops first, I
think we would have to have a lot more checking.

-bw



More information about the llvm-commits mailing list