#include "llvm/CodeGen/LiveRangeInfo.h"
#include "RegAllocCommon.h"
-#include "llvm/CodeGen/RegClass.h"
+#include "RegClass.h"
#include "llvm/CodeGen/IGNode.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "Support/SetOperations.h"
using std::cerr;
+unsigned LiveRange::getRegClassID() const { return getRegClass()->getID(); }
+
LiveRangeInfo::LiveRangeInfo(const Function *F, const TargetMachine &tm,
std::vector<RegClass *> &RCL)
: Meth(F), TM(tm), RegClassList(RCL), MRI(tm.getRegInfo()) { }
LiveRangeMap[Def] = DefRange; // and update the map.
// set the register class of the new live range
- DefRange->setRegClass(RegClassList[MRI.getRegClassIDOfValue(Def, isCC)]);
+ DefRange->setRegClass(RegClassList[MRI.getRegClassIDOfType(Def->getType(),
+ isCC)]);
if (DEBUG_RA >= RA_DEBUG_LiveRanges) {
cerr << " Creating a LR for def ";
continue;
if (MRI.getRegType(LROfDef) == MRI.getRegType(LROfUse)) {
-
// If the two RegTypes are the same
if (!RCOfDef->getInterference(LROfDef, LROfUse) ) {
#include "llvm/CodeGen/RegisterAllocation.h"
#include "RegAllocCommon.h"
+#include "RegClass.h"
#include "llvm/CodeGen/IGNode.h"
-#include "llvm/CodeGen/RegClass.h"
#include "llvm/CodeGen/PhyRegAlloc.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineInstrAnnot.h"
MachineOperand& Op = MInst->getOperand(OpNum);
bool isDef = MInst->operandIsDefined(OpNum);
bool isDefAndUse = MInst->operandIsDefinedAndUsed(OpNum);
- unsigned RegType = MRI.getRegType( LR );
+ unsigned RegType = MRI.getRegType(LR);
int SpillOff = LR->getSpillOffFromFP();
RegClass *RC = LR->getRegClass();
const ValueSet &LVSetBef = LVI->getLiveVarSetBeforeMInst(MInst, BB);
if (MInst->getOperandType(OpNum) == MachineOperand::MO_VirtualRegister ||
MInst->getOperandType(OpNum) == MachineOperand::MO_CCRegister)
if (const Value* Val = Op.getVRegValue())
- if (MRI.getRegClassIDOfValue(Val) == RC->getID())
+ if (MRI.getRegClassIDOfType(Val->getType()) == RC->getID())
if (Op.getAllocatedRegNum() == -1)
if (LiveRange *LROfVal = LRI.getLiveRangeForValue(Val))
if (LROfVal->hasColor() )
#include "llvm/CodeGen/LiveRangeInfo.h"
#include "RegAllocCommon.h"
-#include "llvm/CodeGen/RegClass.h"
+#include "RegClass.h"
#include "llvm/CodeGen/IGNode.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "Support/SetOperations.h"
using std::cerr;
+unsigned LiveRange::getRegClassID() const { return getRegClass()->getID(); }
+
LiveRangeInfo::LiveRangeInfo(const Function *F, const TargetMachine &tm,
std::vector<RegClass *> &RCL)
: Meth(F), TM(tm), RegClassList(RCL), MRI(tm.getRegInfo()) { }
LiveRangeMap[Def] = DefRange; // and update the map.
// set the register class of the new live range
- DefRange->setRegClass(RegClassList[MRI.getRegClassIDOfValue(Def, isCC)]);
+ DefRange->setRegClass(RegClassList[MRI.getRegClassIDOfType(Def->getType(),
+ isCC)]);
if (DEBUG_RA >= RA_DEBUG_LiveRanges) {
cerr << " Creating a LR for def ";
continue;
if (MRI.getRegType(LROfDef) == MRI.getRegType(LROfUse)) {
-
// If the two RegTypes are the same
if (!RCOfDef->getInterference(LROfDef, LROfUse) ) {
#include "llvm/CodeGen/RegisterAllocation.h"
#include "RegAllocCommon.h"
+#include "RegClass.h"
#include "llvm/CodeGen/IGNode.h"
-#include "llvm/CodeGen/RegClass.h"
#include "llvm/CodeGen/PhyRegAlloc.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineInstrAnnot.h"
MachineOperand& Op = MInst->getOperand(OpNum);
bool isDef = MInst->operandIsDefined(OpNum);
bool isDefAndUse = MInst->operandIsDefinedAndUsed(OpNum);
- unsigned RegType = MRI.getRegType( LR );
+ unsigned RegType = MRI.getRegType(LR);
int SpillOff = LR->getSpillOffFromFP();
RegClass *RC = LR->getRegClass();
const ValueSet &LVSetBef = LVI->getLiveVarSetBeforeMInst(MInst, BB);
if (MInst->getOperandType(OpNum) == MachineOperand::MO_VirtualRegister ||
MInst->getOperandType(OpNum) == MachineOperand::MO_CCRegister)
if (const Value* Val = Op.getVRegValue())
- if (MRI.getRegClassIDOfValue(Val) == RC->getID())
+ if (MRI.getRegClassIDOfType(Val->getType()) == RC->getID())
if (Op.getAllocatedRegNum() == -1)
if (LiveRange *LROfVal = LRI.getLiveRangeForValue(Val))
if (LROfVal->hasColor() )