[LLVMdev] Requiring LiveIntervals

Chris Lattner sabre at nondot.org
Tue Sep 20 07:56:58 PDT 2005


On Tue, 20 Sep 2005, Tzu-Chien Chiu wrote:

> One of my pass requires LiveIntervals to build the interference graph,

Ok.

> because LiveVariables do not provide an interface to iterate through
> all viritual registers.

Ok, you could add a method to LiveVariables that returns 
VirtRegInfo.size().  The virtual registers are defined by the range: 
[MRegisterInfo::FirstVirtualRegister,
  MRegisterInfo::FirstVirtualRegister+VirtRegInfo.size()]

Alternatively, the same information can be obtained from the SSARegMap for 
the function: given a MachineFunction, use something like:

NumVRegs = MF.getSSARegMap()->getLastVirtReg()+1;

These also start from MRegisterInfo::FirstVirtualRegister.

> But LiveIntervalAnalysis.h is not in
> "include/llvm/CodeGen", so I have to either include it by:
>
>  #include "../../llvm/lib/CodeGen/LiveIntervalAnalysis.h"
>
> or point my project include path to "llvm/lib/CodeGen" (I use Visual Studio).
>
> Why LiveIntervalAnalysis.h is not in "include/llvm/CodeGen" ?

It was intended to be used as an internal interface, but if you really 
would like it, I would have no problem promoting it to be a public 
interface.  Let me know what you'd like.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/




More information about the llvm-dev mailing list