diff options
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp | 29 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp | 19 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 2 |
3 files changed, 26 insertions, 24 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp index 3235f4aa492..499c2c7286b 100644 --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp @@ -52,8 +52,8 @@ static void CheckForPhysRegDependency(SDNode *Def, SDNode *Use, unsigned Op, unsigned ResNo = Use->getOperand(2).ResNo; if (Def->isTargetOpcode()) { const TargetInstrDescriptor &II = TII->get(Def->getTargetOpcode()); - if (ResNo >= II.numDefs && - II.ImplicitDefs[ResNo - II.numDefs] == Reg) { + if (ResNo >= II.getNumDefs() && + II.ImplicitDefs[ResNo - II.getNumDefs()] == Reg) { PhysReg = Reg; const TargetRegisterClass *RC = MRI->getPhysicalRegisterRegClass(Def->getValueType(ResNo), Reg); @@ -149,7 +149,7 @@ void ScheduleDAG::BuildSchedUnits() { if (MainNode->isTargetOpcode()) { unsigned Opc = MainNode->getTargetOpcode(); const TargetInstrDescriptor &TID = TII->get(Opc); - for (unsigned i = 0; i != TID.numOperands; ++i) { + for (unsigned i = 0; i != TID.getNumOperands(); ++i) { if (TID.getOperandConstraint(i, TOI::TIED_TO) != -1) { SU->isTwoAddress = true; break; @@ -166,8 +166,8 @@ void ScheduleDAG::BuildSchedUnits() { for (unsigned n = 0, e = SU->FlaggedNodes.size(); n != e; ++n) { SDNode *N = SU->FlaggedNodes[n]; if (N->isTargetOpcode() && - TII->getImplicitDefs(N->getTargetOpcode()) && - CountResults(N) > (unsigned)TII->getNumDefs(N->getTargetOpcode())) + TII->get(N->getTargetOpcode()).getImplicitDefs() && + CountResults(N) > TII->get(N->getTargetOpcode()).getNumDefs()) SU->hasPhysRegDefs = true; for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) { @@ -293,7 +293,7 @@ static const TargetRegisterClass *getInstrOperandRegClass( const TargetInstrInfo *TII, const TargetInstrDescriptor *II, unsigned Op) { - if (Op >= II->numOperands) { + if (Op >= II->getNumOperands()) { assert((II->Flags & M_VARIABLE_OPS)&& "Invalid operand # of instruction"); return NULL; } @@ -373,7 +373,7 @@ void ScheduleDAG::CreateVirtualRegisters(SDNode *Node, MachineInstr *MI, const TargetInstrDescriptor &II, DenseMap<SDOperand, unsigned> &VRBaseMap) { - for (unsigned i = 0; i < II.numDefs; ++i) { + for (unsigned i = 0; i < II.getNumDefs(); ++i) { // If the specific node value is only used by a CopyToReg and the dest reg // is a vreg, use the CopyToReg'd destination register instead of creating // a new vreg. @@ -435,7 +435,7 @@ void ScheduleDAG::AddOperand(MachineInstr *MI, SDOperand Op, // Get/emit the operand. unsigned VReg = getVR(Op, VRBaseMap); const TargetInstrDescriptor *TID = MI->getDesc(); - bool isOptDef = (IIOpNum < TID->numOperands) + bool isOptDef = (IIOpNum < TID->getNumOperands()) ? (TID->OpInfo[IIOpNum].isOptionalDef()) : false; MI->addOperand(MachineOperand::CreateReg(VReg, isOptDef)); @@ -674,10 +674,11 @@ void ScheduleDAG::EmitNode(SDNode *Node, unsigned InstanceNo, unsigned NumResults = CountResults(Node); unsigned NodeOperands = CountOperands(Node); unsigned NumMIOperands = NodeOperands + NumResults; - bool HasPhysRegOuts = (NumResults > II.numDefs) && II.ImplicitDefs; + bool HasPhysRegOuts = (NumResults > II.getNumDefs()) && + II.getImplicitDefs() != 0; #ifndef NDEBUG - assert((unsigned(II.numOperands) == NumMIOperands || - HasPhysRegOuts || (II.Flags & M_VARIABLE_OPS)) && + assert((II.getNumOperands() == NumMIOperands || + HasPhysRegOuts || II.hasVariableOperands()) && "#operands for dag node doesn't match .td file!"); #endif @@ -692,7 +693,7 @@ void ScheduleDAG::EmitNode(SDNode *Node, unsigned InstanceNo, // Emit all of the actual operands of this instruction, adding them to the // instruction as appropriate. for (unsigned i = 0; i != NodeOperands; ++i) - AddOperand(MI, Node->getOperand(i), i+II.numDefs, &II, VRBaseMap); + AddOperand(MI, Node->getOperand(i), i+II.getNumDefs(), &II, VRBaseMap); // Commute node if it has been determined to be profitable. if (CommuteSet.count(Node)) { @@ -719,8 +720,8 @@ void ScheduleDAG::EmitNode(SDNode *Node, unsigned InstanceNo, // Additional results must be an physical register def. if (HasPhysRegOuts) { - for (unsigned i = II.numDefs; i < NumResults; ++i) { - unsigned Reg = II.ImplicitDefs[i - II.numDefs]; + for (unsigned i = II.getNumDefs(); i < NumResults; ++i) { + unsigned Reg = II.getImplicitDefs()[i - II.getNumDefs()]; if (Node->hasAnyUseOfValue(i)) EmitCopyFromReg(Node, i, InstanceNo, Reg, VRBaseMap); } diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp index fcc2b8af28d..846004e2138 100644 --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp @@ -148,7 +148,7 @@ void ScheduleDAGRRList::CommuteNodesToReducePressure() { if (!SU || !SU->Node) continue; if (SU->isCommutable) { unsigned Opc = SU->Node->getTargetOpcode(); - unsigned NumRes = TII->getNumDefs(Opc); + unsigned NumRes = TII->get(Opc).getNumDefs(); unsigned NumOps = CountOperands(SU->Node); for (unsigned j = 0; j != NumOps; ++j) { if (TII->getOperandConstraint(Opc, j+NumRes, TOI::TIED_TO) == -1) @@ -431,7 +431,7 @@ SUnit *ScheduleDAGRRList::CopyAndMoveSuccessors(SUnit *SU) { SUnit *NewSU = NewSUnit(N); SUnitMap[N].push_back(NewSU); const TargetInstrDescriptor *TID = &TII->get(N->getTargetOpcode()); - for (unsigned i = 0; i != TID->numOperands; ++i) { + for (unsigned i = 0; i != TID->getNumOperands(); ++i) { if (TID->getOperandConstraint(i, TOI::TIED_TO) != -1) { NewSU->isTwoAddress = true; break; @@ -623,8 +623,8 @@ static MVT::ValueType getPhysicalRegisterVT(SDNode *N, unsigned Reg, const TargetInstrInfo *TII) { const TargetInstrDescriptor &TID = TII->get(N->getTargetOpcode()); assert(TID.ImplicitDefs && "Physical reg def must be in implicit def list!"); - unsigned NumRes = TID.numDefs; - for (const unsigned *ImpDef = TID.ImplicitDefs; *ImpDef; ++ImpDef) { + unsigned NumRes = TID.getNumDefs(); + for (const unsigned *ImpDef = TID.getImplicitDefs(); *ImpDef; ++ImpDef) { if (Reg == *ImpDef) break; ++NumRes; @@ -1287,7 +1287,7 @@ template<class SF> bool BURegReductionPriorityQueue<SF>::canClobber(SUnit *SU, SUnit *Op) { if (SU->isTwoAddress) { unsigned Opc = SU->Node->getTargetOpcode(); - unsigned NumRes = TII->getNumDefs(Opc); + unsigned NumRes = TII->get(Opc).getNumDefs(); unsigned NumOps = ScheduleDAG::CountOperands(SU->Node); for (unsigned i = 0; i != NumOps; ++i) { if (TII->getOperandConstraint(Opc, i+NumRes, TOI::TIED_TO) != -1) { @@ -1321,11 +1321,12 @@ static bool canClobberPhysRegDefs(SUnit *SuccSU, SUnit *SU, const TargetInstrInfo *TII, const MRegisterInfo *MRI) { SDNode *N = SuccSU->Node; - unsigned NumDefs = TII->getNumDefs(N->getTargetOpcode()); - const unsigned *ImpDefs = TII->getImplicitDefs(N->getTargetOpcode()); + unsigned NumDefs = TII->get(N->getTargetOpcode()).getNumDefs(); + const unsigned *ImpDefs = TII->get(N->getTargetOpcode()).getImplicitDefs(); if (!ImpDefs) return false; - const unsigned *SUImpDefs = TII->getImplicitDefs(SU->Node->getTargetOpcode()); + const unsigned *SUImpDefs = + TII->get(SU->Node->getTargetOpcode()).getImplicitDefs(); if (!SUImpDefs) return false; for (unsigned i = NumDefs, e = N->getNumValues(); i != e; ++i) { @@ -1361,7 +1362,7 @@ void BURegReductionPriorityQueue<SF>::AddPseudoTwoAddrDeps() { continue; unsigned Opc = Node->getTargetOpcode(); - unsigned NumRes = TII->getNumDefs(Opc); + unsigned NumRes = TII->get(Opc).getNumDefs(); unsigned NumOps = ScheduleDAG::CountOperands(Node); for (unsigned j = 0; j != NumOps; ++j) { if (TII->getOperandConstraint(Opc, j+NumRes, TOI::TIED_TO) != -1) { diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 74a506c24df..22065156497 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -3602,7 +3602,7 @@ std::string SDNode::getOperationName(const SelectionDAG *G) const { if (G) { if (const TargetInstrInfo *TII = G->getTarget().getInstrInfo()) if (getOpcode()-ISD::BUILTIN_OP_END < TII->getNumOpcodes()) - return TII->getName(getOpcode()-ISD::BUILTIN_OP_END); + return TII->get(getOpcode()-ISD::BUILTIN_OP_END).getName(); TargetLowering &TLI = G->getTargetLoweringInfo(); const char *Name = |

