Tzu-Chien Chiu
2005-Jul-29 07:12 UTC
[LLVMdev] How to define a pass requiring a register allocation pass?
How to define a MachineFunctionPass requireing one of the register allocation passes being executed first? 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). -- Tzu-Chien Chiu, 3D Graphics Hardware Architect <URL:http://www.csie.nctu.edu.tw/~jwchiu>
Chris Lattner
2005-Aug-02 22:37 UTC
[LLVMdev] How to define a pass requiring a register allocation pass?
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. -Chris -- http://nondot.org/sabre/ http://llvm.org/