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
David Greene wrote:> 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.Umm...yeah. That way be dragons. :-/ Fortunately, I found MachineFunction::getSSARegMap()->getRegClass(LI.reg) which works swimmingly. -Dave
On Fri, 11 May 2007, David Greene wrote:> Umm...yeah. That way be dragons. :-/ > > Fortunately, I found > MachineFunction::getSSARegMap()->getRegClass(LI.reg) which > works swimmingly.Yep, that's exactly the right way to go for vregs. It won't work for physregs, primarily because they can be in multiple reg classes :) -Chris -- nondot.org/sabre llvm.org