[LLVMdev] Dynamically alternating between register allocators

Devang Patel dpatel at apple.com
Wed Sep 5 14:57:19 PDT 2007


On Sep 5, 2007, at 2:32 PM, Evan Cheng wrote:

> I would like to see hierarchical pass capability built into pass
> manager. This allows us to group live variables, phi lowering, two-
> address, lower subreg, live interval analysis, coalescing, allocation,
> and spilling into a single register allocator pass. The register
> allocator pass is then responsible for controlling its own sub-passes
> (not just the order of passes, but also termination conditions).
> Similarly, branch folding and if-conversion should be lumped together
> into a cfg optimization pass. Devang, hint hint. :-)

We already have pass hierarchy, each pass manger is itself a full  
fledged pass. For example, when you insert a loop pass manger in a  
pass queue, you're inserting a function pass which responds to  
runOnFunction().

However, it seems you want dynamic pass queue manager.  In loop  
optimizer, a pass can request reprocessing of a given loop by re- 
inserting loop into the queue. However this loop is reprocessed by all  
loop pass not just by few selected ones. One alternative way to  
achieve this is to create RAPassManager to group all these RA passes  
together. Yet another approach would be to keep track of followup  
passes but that would required significant modifications in PM because  
followup passes may require something that may not available and so  
on...

-
Devang




More information about the llvm-dev mailing list