[LLVMdev] Is it possible to use the SimpleRegisterCoalescing pass in an iterative way?
Evan Cheng
evan.cheng at apple.com
Fri Jan 9 11:55:37 PST 2009
SimpleRegisterCoalescer is a super class of RegisterCoalescer. A
RegisterCoalescer can be run both as a pass or directly. Perhaps the
answer is as simple as implementing coalesceFunction.
Evan
On Jan 9, 2009, at 1:36 AM, Roman Levenstein wrote:
> Hi,
>
> I'm implementing some variations of graph-coloring register
> allocators for LLVM.
> Many of them perform their phases (e.g. coalescing, graph
> simplification, spilling, color selection) in an iterative way. Since
> LLVM provides an implementation of the coalescing in the
> SimpleRegisterCoalescing class already, I would like to reuse it (even
> though I could of course create my own coalescing implementation). But
> this class is a MachineFunctionPass.
>
> I'm wondering, if it is possible to use this pass from another pass
> (i.e. regalloc) in an iterative way:
> I need to invoke it multiple times for the same MachineFunction at
> certain places in my regalloc pass implementation.
> May be some sort of analysis update can be performed? Or is it
> designed to be used just once per MachineFunction?
>
> Also overall, it would be interesting to know how LLVM supports such
> kind of iterative algorithms? What are the ways to formulate the
> independent phases of those algorithms as reusable passes that could
> be used in an iterative way?
>
> Thanks,
> -Roman
More information about the llvm-dev
mailing list