[LLVMdev] Live Intervals and Register Classes

David Greene greened at obbligato.org
Fri May 11 15:24:22 PDT 2007


Given a live interval LI, what's the right way to get the
register class of the interval?

I'm assuming that all LiveRange entries in the LiveInterval
are consistent in that if allocated to a register they would
all go in the same register class.  Fair assumption?

If I take the first LiveRange LR from LI, look up its
instruction/operand at "start" and then look at its
TargetOperandInfo and send TOI::RegClass to
MRegisterInfo:getRegClass, is that sufficient.

It seems way overly complicated.

After LiveIntervalAnalysis runs we have a set of LIs we can
iterate over.  What's the most efficient way to get the
register classes for these intervals so I know which machine
registers they can go into?

                              -Dave



More information about the llvm-dev mailing list