[LLVMdev] How to define a pass requiring a register allocation pass?

Chris Lattner sabre at nondot.org
Tue Aug 2 15:37:23 PDT 2005

On Fri, 29 Jul 2005, Tzu-Chien Chiu wrote:
> Should there be a PassInfo for register allocation in Pass.h?
> Pass.h:
> namespace llvm {
>  extern const PassInfo *PHIEliminationID;
>  extern const PassInfo *TwoAddressInstructionPassID;
>  extern const PassInfo *RegisterAllocationPassID;              // <--
> add this one?
> There are four register allocation passes in CodeGen, but I don't know
> which one will be used unitl  run-time (the register allocator is
> chosen by a command line argument).

you don't really know.  The way to control this is the order in which 
passes are added to the pass manager by your target's addPassesToEmitFile 
method.  Just make sure that the pass that must run after register 
allocation is only added there.



More information about the llvm-dev mailing list