How to define a pass requiring a register allocation pass?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to define a pass requiring a register allocation pass?

Tzu-Chien Chiu
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>

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: How to define a pass requiring a register allocation pass?

Chris Lattner
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/

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev