diff options
author | Owen Anderson <resistor@mac.com> | 2009-08-10 22:56:29 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-08-10 22:56:29 +0000 |
commit | e50ed30282bb5b4a9ed952580523f2dda16215ac (patch) | |
tree | fa8e46b304328a852135fef969e13d47e51196d0 /utils/TableGen | |
parent | a8c6908995c39094fc071e5c629c40773197d571 (diff) |
Rename MVT to EVT, in preparation for splitting SimpleValueType out into its own struct type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78610 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen')
-rw-r--r-- | utils/TableGen/CallingConvEmitter.cpp | 12 | ||||
-rw-r--r-- | utils/TableGen/CodeGenDAGPatterns.cpp | 172 | ||||
-rw-r--r-- | utils/TableGen/CodeGenDAGPatterns.h | 28 | ||||
-rw-r--r-- | utils/TableGen/CodeGenIntrinsics.h | 8 | ||||
-rw-r--r-- | utils/TableGen/CodeGenRegisters.h | 6 | ||||
-rw-r--r-- | utils/TableGen/CodeGenTarget.cpp | 112 | ||||
-rw-r--r-- | utils/TableGen/CodeGenTarget.h | 20 | ||||
-rw-r--r-- | utils/TableGen/DAGISelEmitter.cpp | 96 | ||||
-rw-r--r-- | utils/TableGen/FastISelEmitter.cpp | 26 | ||||
-rw-r--r-- | utils/TableGen/IntrinsicEmitter.cpp | 54 | ||||
-rw-r--r-- | utils/TableGen/RegisterInfoEmitter.cpp | 4 | ||||
-rw-r--r-- | utils/TableGen/TGValueTypes.cpp | 34 |
12 files changed, 286 insertions, 286 deletions
diff --git a/utils/TableGen/CallingConvEmitter.cpp b/utils/TableGen/CallingConvEmitter.cpp index 5879c417e4..df962c7b78 100644 --- a/utils/TableGen/CallingConvEmitter.cpp +++ b/utils/TableGen/CallingConvEmitter.cpp @@ -26,9 +26,9 @@ void CallingConvEmitter::run(raw_ostream &O) { // other. for (unsigned i = 0, e = CCs.size(); i != e; ++i) { O << "static bool " << CCs[i]->getName() - << "(unsigned ValNo, MVT ValVT,\n" + << "(unsigned ValNo, EVT ValVT,\n" << std::string(CCs[i]->getName().size()+13, ' ') - << "MVT LocVT, CCValAssign::LocInfo LocInfo,\n" + << "EVT LocVT, CCValAssign::LocInfo LocInfo,\n" << std::string(CCs[i]->getName().size()+13, ' ') << "ISD::ArgFlagsTy ArgFlags, CCState &State);\n"; } @@ -44,9 +44,9 @@ void CallingConvEmitter::EmitCallingConv(Record *CC, raw_ostream &O) { Counter = 0; O << "\n\nstatic bool " << CC->getName() - << "(unsigned ValNo, MVT ValVT,\n" + << "(unsigned ValNo, EVT ValVT,\n" << std::string(CC->getName().size()+13, ' ') - << "MVT LocVT, CCValAssign::LocInfo LocInfo,\n" + << "EVT LocVT, CCValAssign::LocInfo LocInfo,\n" << std::string(CC->getName().size()+13, ' ') << "ISD::ArgFlagsTy ArgFlags, CCState &State) {\n"; // Emit all of the actions, in order. @@ -163,12 +163,12 @@ void CallingConvEmitter::EmitAction(Record *Action, O << Size << ", "; else O << "\n" << IndentStr << " State.getTarget().getTargetData()" - "->getTypeAllocSize(LocVT.getTypeForMVT()), "; + "->getTypeAllocSize(LocVT.getTypeForEVT()), "; if (Align) O << Align; else O << "\n" << IndentStr << " State.getTarget().getTargetData()" - "->getABITypeAlignment(LocVT.getTypeForMVT())"; + "->getABITypeAlignment(LocVT.getTypeForEVT())"; O << ");\n" << IndentStr << "State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset" << Counter << ", LocVT, LocInfo));\n"; diff --git a/utils/TableGen/CodeGenDAGPatterns.cpp b/utils/TableGen/CodeGenDAGPatterns.cpp index 2423ff93a1..05ede6cec6 100644 --- a/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/utils/TableGen/CodeGenDAGPatterns.cpp @@ -27,9 +27,9 @@ using namespace llvm; /// FilterVTs - Filter a list of VT's according to a predicate. /// template<typename T> -static std::vector<MVT::SimpleValueType> -FilterVTs(const std::vector<MVT::SimpleValueType> &InVTs, T Filter) { - std::vector<MVT::SimpleValueType> Result; +static std::vector<EVT::SimpleValueType> +FilterVTs(const std::vector<EVT::SimpleValueType> &InVTs, T Filter) { + std::vector<EVT::SimpleValueType> Result; for (unsigned i = 0, e = InVTs.size(); i != e; ++i) if (Filter(InVTs[i])) Result.push_back(InVTs[i]); @@ -41,29 +41,29 @@ static std::vector<unsigned char> FilterEVTs(const std::vector<unsigned char> &InVTs, T Filter) { std::vector<unsigned char> Result; for (unsigned i = 0, e = InVTs.size(); i != e; ++i) - if (Filter((MVT::SimpleValueType)InVTs[i])) + if (Filter((EVT::SimpleValueType)InVTs[i])) Result.push_back(InVTs[i]); return Result; } static std::vector<unsigned char> -ConvertVTs(const std::vector<MVT::SimpleValueType> &InVTs) { +ConvertVTs(const std::vector<EVT::SimpleValueType> &InVTs) { std::vector<unsigned char> Result; for (unsigned i = 0, e = InVTs.size(); i != e; ++i) Result.push_back(InVTs[i]); return Result; } -static inline bool isInteger(MVT::SimpleValueType VT) { - return MVT(VT).isInteger(); +static inline bool isInteger(EVT::SimpleValueType VT) { + return EVT(VT).isInteger(); } -static inline bool isFloatingPoint(MVT::SimpleValueType VT) { - return MVT(VT).isFloatingPoint(); +static inline bool isFloatingPoint(EVT::SimpleValueType VT) { + return EVT(VT).isFloatingPoint(); } -static inline bool isVector(MVT::SimpleValueType VT) { - return MVT(VT).isVector(); +static inline bool isVector(EVT::SimpleValueType VT) { + return EVT(VT).isVector(); } static bool LHSIsSubsetOfRHS(const std::vector<unsigned char> &LHS, @@ -76,7 +76,7 @@ static bool LHSIsSubsetOfRHS(const std::vector<unsigned char> &LHS, } namespace llvm { -namespace EMVT { +namespace EEVT { /// isExtIntegerInVTs - Return true if the specified extended value type vector /// contains isInt or an integer value type. bool isExtIntegerInVTs(const std::vector<unsigned char> &EVTs) { @@ -90,7 +90,7 @@ bool isExtFloatingPointInVTs(const std::vector<unsigned char> &EVTs) { assert(!EVTs.empty() && "Cannot check for integer in empty ExtVT list!"); return EVTs[0] == isFP || !(FilterEVTs(EVTs, isFloatingPoint).empty()); } -} // end namespace EMVT. +} // end namespace EEVT. } // end namespace llvm. @@ -254,27 +254,27 @@ bool SDTypeConstraint::ApplyTypeConstraint(TreePatternNode *N, return NodeToApply->UpdateNodeType(x.SDTCisVT_Info.VT, TP); case SDTCisPtrTy: { // Operand must be same as target pointer type. - return NodeToApply->UpdateNodeType(MVT::iPTR, TP); + return NodeToApply->UpdateNodeType(EVT::iPTR, TP); } case SDTCisInt: { // If there is only one integer type supported, this must be it. - std::vector<MVT::SimpleValueType> IntVTs = + std::vector<EVT::SimpleValueType> IntVTs = FilterVTs(CGT.getLegalValueTypes(), isInteger); // If we found exactly one supported integer type, apply it. if (IntVTs.size() == 1) return NodeToApply->UpdateNodeType(IntVTs[0], TP); - return NodeToApply->UpdateNodeType(EMVT::isInt, TP); + return NodeToApply->UpdateNodeType(EEVT::isInt, TP); } case SDTCisFP: { // If there is only one FP type supported, this must be it. - std::vector<MVT::SimpleValueType> FPVTs = + std::vector<EVT::SimpleValueType> FPVTs = FilterVTs(CGT.getLegalValueTypes(), isFloatingPoint); // If we found exactly one supported FP type, apply it. if (FPVTs.size() == 1) return NodeToApply->UpdateNodeType(FPVTs[0], TP); - return NodeToApply->UpdateNodeType(EMVT::isFP, TP); + return NodeToApply->UpdateNodeType(EEVT::isFP, TP); } case SDTCisSameAs: { TreePatternNode *OtherNode = @@ -290,7 +290,7 @@ bool SDTypeConstraint::ApplyTypeConstraint(TreePatternNode *N, !static_cast<DefInit*>(NodeToApply->getLeafValue())->getDef() ->isSubClassOf("ValueType")) TP.error(N->getOperator()->getName() + " expects a VT operand!"); - MVT::SimpleValueType VT = + EVT::SimpleValueType VT = getValueType(static_cast<DefInit*>(NodeToApply->getLeafValue())->getDef()); if (!isInteger(VT)) TP.error(N->getOperator()->getName() + " VT operand must be integer!"); @@ -300,14 +300,14 @@ bool SDTypeConstraint::ApplyTypeConstraint(TreePatternNode *N, // It must be integer. bool MadeChange = false; - MadeChange |= OtherNode->UpdateNodeType(EMVT::isInt, TP); + MadeChange |= OtherNode->UpdateNodeType(EEVT::isInt, TP); // This code only handles nodes that have one type set. Assert here so // that we can change this if we ever need to deal with multiple value // types at this point. assert(OtherNode->getExtTypes().size() == 1 && "Node has too many types!"); if (OtherNode->hasTypeSet() && OtherNode->getTypeNum(0) <= VT) - OtherNode->UpdateNodeType(MVT::Other, TP); // Throw an error. + OtherNode->UpdateNodeType(EVT::Other, TP); // Throw an error. return false; } case SDTCisOpSmallerThanOp: { @@ -320,25 +320,25 @@ bool SDTypeConstraint::ApplyTypeConstraint(TreePatternNode *N, // This code does not currently handle nodes which have multiple types, // where some types are integer, and some are fp. Assert that this is not // the case. - assert(!(EMVT::isExtIntegerInVTs(NodeToApply->getExtTypes()) && - EMVT::isExtFloatingPointInVTs(NodeToApply->getExtTypes())) && - !(EMVT::isExtIntegerInVTs(BigOperand->getExtTypes()) && - EMVT::isExtFloatingPointInVTs(BigOperand->getExtTypes())) && + assert(!(EEVT::isExtIntegerInVTs(NodeToApply->getExtTypes()) && + EEVT::isExtFloatingPointInVTs(NodeToApply->getExtTypes())) && + !(EEVT::isExtIntegerInVTs(BigOperand->getExtTypes()) && + EEVT::isExtFloatingPointInVTs(BigOperand->getExtTypes())) && "SDTCisOpSmallerThanOp does not handle mixed int/fp types!"); - if (EMVT::isExtIntegerInVTs(NodeToApply->getExtTypes())) - MadeChange |= BigOperand->UpdateNodeType(EMVT::isInt, TP); - else if (EMVT::isExtFloatingPointInVTs(NodeToApply->getExtTypes())) - MadeChange |= BigOperand->UpdateNodeType(EMVT::isFP, TP); - if (EMVT::isExtIntegerInVTs(BigOperand->getExtTypes())) - MadeChange |= NodeToApply->UpdateNodeType(EMVT::isInt, TP); - else if (EMVT::isExtFloatingPointInVTs(BigOperand->getExtTypes())) - MadeChange |= NodeToApply->UpdateNodeType(EMVT::isFP, TP); - - std::vector<MVT::SimpleValueType> VTs = CGT.getLegalValueTypes(); - - if (EMVT::isExtIntegerInVTs(NodeToApply->getExtTypes())) { + if (EEVT::isExtIntegerInVTs(NodeToApply->getExtTypes())) + MadeChange |= BigOperand->UpdateNodeType(EEVT::isInt, TP); + else if (EEVT::isExtFloatingPointInVTs(NodeToApply->getExtTypes())) + MadeChange |= BigOperand->UpdateNodeType(EEVT::isFP, TP); + if (EEVT::isExtIntegerInVTs(BigOperand->getExtTypes())) + MadeChange |= NodeToApply->UpdateNodeType(EEVT::isInt, TP); + else if (EEVT::isExtFloatingPointInVTs(BigOperand->getExtTypes())) + MadeChange |= NodeToApply->UpdateNodeType(EEVT::isFP, TP); + + std::vector<EVT::SimpleValueType> VTs = CGT.getLegalValueTypes(); + + if (EEVT::isExtIntegerInVTs(NodeToApply->getExtTypes())) { VTs = FilterVTs(VTs, isInteger); - } else if (EMVT::isExtFloatingPointInVTs(NodeToApply->getExtTypes())) { + } else if (EEVT::isExtFloatingPointInVTs(NodeToApply->getExtTypes())) { VTs = FilterVTs(VTs, isFloatingPoint); } else { VTs.clear(); @@ -349,7 +349,7 @@ bool SDTypeConstraint::ApplyTypeConstraint(TreePatternNode *N, case 0: break; // No info yet. case 1: // Only one VT of this flavor. Cannot ever satisfy the constraints. - return NodeToApply->UpdateNodeType(MVT::Other, TP); // throw + return NodeToApply->UpdateNodeType(EVT::Other, TP); // throw case 2: // If we have exactly two possible types, the little operand must be the // small one, the big operand should be the big one. Common with @@ -368,7 +368,7 @@ bool SDTypeConstraint::ApplyTypeConstraint(TreePatternNode *N, if (OtherOperand->hasTypeSet()) { if (!isVector(OtherOperand->getTypeNum(0))) TP.error(N->getOperator()->getName() + " VT operand must be a vector!"); - MVT IVT = OtherOperand->getTypeNum(0); + EVT IVT = OtherOperand->getTypeNum(0); IVT = IVT.getVectorElementType(); return NodeToApply->UpdateNodeType(IVT.getSimpleVT(), TP); } @@ -445,18 +445,18 @@ bool TreePatternNode::UpdateNodeType(const std::vector<unsigned char> &ExtVTs, TreePattern &TP) { assert(!ExtVTs.empty() && "Cannot update node type with empty type vector!"); - if (ExtVTs[0] == EMVT::isUnknown || LHSIsSubsetOfRHS(getExtTypes(), ExtVTs)) + if (ExtVTs[0] == EEVT::isUnknown || LHSIsSubsetOfRHS(getExtTypes(), ExtVTs)) return false; if (isTypeCompletelyUnknown() || LHSIsSubsetOfRHS(ExtVTs, getExtTypes())) { setTypes(ExtVTs); return true; } - if (getExtTypeNum(0) == MVT::iPTR || getExtTypeNum(0) == MVT::iPTRAny) { - if (ExtVTs[0] == MVT::iPTR || ExtVTs[0] == MVT::iPTRAny || - ExtVTs[0] == EMVT::isInt) + if (getExtTypeNum(0) == EVT::iPTR || getExtTypeNum(0) == EVT::iPTRAny) { + if (ExtVTs[0] == EVT::iPTR || ExtVTs[0] == EVT::iPTRAny || + ExtVTs[0] == EEVT::isInt) return false; - if (EMVT::isExtIntegerInVTs(ExtVTs)) { + if (EEVT::isExtIntegerInVTs(ExtVTs)) { std::vector<unsigned char> FVTs = FilterEVTs(ExtVTs, isInteger); if (FVTs.size()) { setTypes(ExtVTs); @@ -465,8 +465,8 @@ bool TreePatternNode::UpdateNodeType(const std::vector<unsigned char> &ExtVTs, } } - if ((ExtVTs[0] == EMVT::isInt || ExtVTs[0] == MVT::iAny) && - EMVT::isExtIntegerInVTs(getExtTypes())) { + if ((ExtVTs[0] == EEVT::isInt || ExtVTs[0] == EVT::iAny) && + EEVT::isExtIntegerInVTs(getExtTypes())) { assert(hasTypeSet() && "should be handled above!"); std::vector<unsigned char> FVTs = FilterEVTs(getExtTypes(), isInteger); if (getExtTypes() == FVTs) @@ -474,8 +474,8 @@ bool TreePatternNode::UpdateNodeType(const std::vector<unsigned char> &ExtVTs, setTypes(FVTs); return true; } - if ((ExtVTs[0] == MVT::iPTR || ExtVTs[0] == MVT::iPTRAny) && - EMVT::isExtIntegerInVTs(getExtTypes())) { + if ((ExtVTs[0] == EVT::iPTR || ExtVTs[0] == EVT::iPTRAny) && + EEVT::isExtIntegerInVTs(getExtTypes())) { //assert(hasTypeSet() && "should be handled above!"); std::vector<unsigned char> FVTs = FilterEVTs(getExtTypes(), isInteger); if (getExtTypes() == FVTs) @@ -485,8 +485,8 @@ bool TreePatternNode::UpdateNodeType(const std::vector<unsigned char> &ExtVTs, return true; } } - if ((ExtVTs[0] == EMVT::isFP || ExtVTs[0] == MVT::fAny) && - EMVT::isExtFloatingPointInVTs(getExtTypes())) { + if ((ExtVTs[0] == EEVT::isFP || ExtVTs[0] == EVT::fAny) && + EEVT::isExtFloatingPointInVTs(getExtTypes())) { assert(hasTypeSet() && "should be handled above!"); std::vector<unsigned char> FVTs = FilterEVTs(getExtTypes(), isFloatingPoint); @@ -501,15 +501,15 @@ bool TreePatternNode::UpdateNodeType(const std::vector<unsigned char> &ExtVTs, // // Similarly, we should probably set the type here to the intersection of // {isInt|isFP} and ExtVTs - if (((getExtTypeNum(0) == EMVT::isInt || getExtTypeNum(0) == MVT::iAny) && - EMVT::isExtIntegerInVTs(ExtVTs)) || - ((getExtTypeNum(0) == EMVT::isFP || getExtTypeNum(0) == MVT::fAny) && - EMVT::isExtFloatingPointInVTs(ExtVTs))) { + if (((getExtTypeNum(0) == EEVT::isInt || getExtTypeNum(0) == EVT::iAny) && + EEVT::isExtIntegerInVTs(ExtVTs)) || + ((getExtTypeNum(0) == EEVT::isFP || getExtTypeNum(0) == EVT::fAny) && + EEVT::isExtFloatingPointInVTs(ExtVTs))) { setTypes(ExtVTs); return true; } - if (getExtTypeNum(0) == EMVT::isInt && - (ExtVTs[0] == MVT::iPTR || ExtVTs[0] == MVT::iPTRAny)) { + if (getExtTypeNum(0) == EEVT::isInt && + (ExtVTs[0] == EVT::iPTR || ExtVTs[0] == EVT::iPTRAny)) { setTypes(ExtVTs); return true; } @@ -536,16 +536,16 @@ void TreePatternNode::print(raw_ostream &OS) const { // FIXME: At some point we should handle printing all the value types for // nodes that are multiply typed. switch (getExtTypeNum(0)) { - case MVT::Other: OS << ":Other"; break; - case EMVT::isInt: OS << ":isInt"; break; - case EMVT::isFP : OS << ":isFP"; break; - case EMVT::isUnknown: ; /*OS << ":?";*/ break; - case MVT::iPTR: OS << ":iPTR"; break; - case MVT::iPTRAny: OS << ":iPTRAny"; break; + case EVT::Other: OS << ":Other"; break; + case EEVT::isInt: OS << ":isInt"; break; + case EEVT::isFP : OS << ":isFP"; break; + case EEVT::isUnknown: ; /*OS << ":?";*/ break; + case EVT::iPTR: OS << ":iPTR"; break; + case EVT::iPTRAny: OS << ":iPTRAny"; break; default: { std::string VTName = llvm::getName(getTypeNum(0)); - // Strip off MVT:: prefix if present. - if (VTName.substr(0,5) == "MVT::") + // Strip off EVT:: prefix if present. + if (VTName.substr(0,5) == "EVT::") VTName = VTName.substr(5); OS << ":" << VTName; break; @@ -726,8 +726,8 @@ TreePatternNode *TreePatternNode::InlinePatternFragments(TreePattern &TP) { static std::vector<unsigned char> getImplicitType(Record *R, bool NotRegisters, TreePattern &TP) { // Some common return values - std::vector<unsigned char> Unknown(1, EMVT::isUnknown); - std::vector<unsigned char> Other(1, MVT::Other); + std::vector<unsigned char> Unknown(1, EEVT::isUnknown); + std::vector<unsigned char> Other(1, EVT::Other); // Check to see if this is a register or a register class... if (R->isSubClassOf("RegisterClass")) { @@ -754,7 +754,7 @@ static std::vector<unsigned char> getImplicitType(Record *R, bool NotRegisters, ComplexPat(1, TP.getDAGPatterns().getComplexPattern(R).getValueType()); return ComplexPat; } else if (R->isSubClassOf("PointerLikeRegClass")) { - Other[0] = MVT::iPTR; + Other[0] = EVT::iPTR; return Other; } else if (R->getName() == "node" || R->getName() == "srcvalue" || R->getName() == "zero_reg") { @@ -803,20 +803,20 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) { return UpdateNodeType(getImplicitType(DI->getDef(), NotRegisters, TP),TP); } else if (IntInit *II = dynamic_cast<IntInit*>(getLeafValue())) { // Int inits are always integers. :) - bool MadeChange = UpdateNodeType(EMVT::isInt, TP); + bool MadeChange = UpdateNodeType(EEVT::isInt, TP); if (hasTypeSet()) { // At some point, it may make sense for this tree pattern to have // multiple types. Assert here that it does not, so we revisit this // code when appropriate. assert(getExtTypes().size() >= 1 && "TreePattern doesn't have a type!"); - MVT::SimpleValueType VT = getTypeNum(0); + EVT::SimpleValueType VT = getTypeNum(0); for (unsigned i = 1, e = getExtTypes().size(); i != e; ++i) assert(getTypeNum(i) == VT && "TreePattern has too many types!"); VT = getTypeNum(0); - if (VT != MVT::iPTR && VT != MVT::iPTRAny) { - unsigned Size = MVT(VT).getSizeInBits(); + if (VT != EVT::iPTR && VT != EVT::iPTRAny) { + unsigned Size = EVT(VT).getSizeInBits(); // Make sure that the value is representable for this type. if (Size < 32) { int Val = (II->getValue() << (32-Size)) >> (32-Size); @@ -856,7 +856,7 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) { TP); MadeChange |= getChild(NC-1)->UpdateNodeType(getChild(i)->getExtTypes(), TP); - MadeChange |= UpdateNodeType(MVT::isVoid, TP); + MadeChange |= UpdateNodeType(EVT::isVoid, TP); } return MadeChange; } else if (getOperator()->getName() == "implicit" || @@ -864,7 +864,7 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) { bool MadeChange = false; for (unsigned i = 0; i < getNumChildren(); ++i) MadeChange = getChild(i)->ApplyTypeConstraints(TP, NotRegisters); - MadeChange |= UpdateNodeType(MVT::isVoid, TP); + MadeChange |= UpdateNodeType(EVT::isVoid, TP); return MadeChange; } else if (getOperator()->getName() == "COPY_TO_REGCLASS") { bool MadeChange = false; @@ -888,10 +888,10 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) { utostr(getNumChildren() - 1) + " operands!"); // Apply type info to the intrinsic ID. - MadeChange |= getChild(0)->UpdateNodeType(MVT::iPTR, TP); + MadeChange |= getChild(0)->UpdateNodeType(EVT::iPTR, TP); for (unsigned i = NumRetVTs, e = getNumChildren(); i != e; ++i) { - MVT::SimpleValueType OpVT = Int->IS.ParamVTs[i - NumRetVTs]; + EVT::SimpleValueType OpVT = Int->IS.ParamVTs[i - NumRetVTs]; MadeChange |= getChild(i)->UpdateNodeType(OpVT, TP); MadeChange |= getChild(i)->ApplyTypeConstraints(TP, NotRegisters); } @@ -905,7 +905,7 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) { // Branch, etc. do not produce results and top-level forms in instr pattern // must have void types. if (NI.getNumResults() == 0) - MadeChange |= UpdateNodeType(MVT::isVoid, TP); + MadeChange |= UpdateNodeType(EVT::isVoid, TP); return MadeChange; } else if (getOperator()->isSubClassOf("Instruction")) { @@ -920,17 +920,17 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) { CDP.getTargetInfo().getInstruction(getOperator()->getName()); // Apply the result type to the node if (NumResults == 0 || InstInfo.NumDefs == 0) { - MadeChange = UpdateNodeType(MVT::isVoid, TP); + MadeChange = UpdateNodeType(EVT::isVoid, TP); } else { Record *ResultNode = Inst.getResult(0); if (ResultNode->isSubClassOf("PointerLikeRegClass")) { std::vector<unsigned char> VT; - VT.push_back(MVT::iPTR); + VT.push_back(EVT::iPTR); MadeChange = UpdateNodeType(VT, TP); } else if (ResultNode->getName() == "unknown") { std::vector<unsigned char> VT; - VT.push_back(EMVT::isUnknown); + VT.push_back(EEVT::isUnknown); MadeChange = UpdateNodeType(VT, TP); } else { assert(ResultNode->isSubClassOf("RegisterClass") && @@ -959,7 +959,7 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) { TP.error("Instruction '" + getOperator()->getName() + "' expects more operands than were provided."); - MVT::SimpleValueType VT; + EVT::SimpleValueType VT; TreePatternNode *Child = getChild(ChildNo++); if (OperandNode->isSubClassOf("RegisterClass")) { const CodeGenRegisterClass &RC = @@ -969,9 +969,9 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) { VT = getValueType(OperandNode->getValueAsDef("Type")); MadeChange |= Child->UpdateNodeType(VT, TP); } else if (OperandNode->isSubClassOf("PointerLikeRegClass")) { - MadeChange |= Child->UpdateNodeType(MVT::iPTR, TP); + MadeChange |= Child->UpdateNodeType(EVT::iPTR, TP); } else if (OperandNode->getName() == "unknown") { - MadeChange |= Child->UpdateNodeType(EMVT::isUnknown, TP); + MadeChange |= Child->UpdateNodeType(EEVT::isUnknown, TP); } else { assert(0 && "Unknown operand type!"); abort(); @@ -1210,7 +1210,7 @@ TreePatternNode *TreePattern::ParseTreePattern(DagInit *Dag) { // If this intrinsic returns void, it must have side-effects and thus a // chain. - if (Int.IS.RetVTs[0] == MVT::isVoid) { + if (Int.IS.RetVTs[0] == EVT::isVoid) { Operator = getDAGPatterns().get_intrinsic_void_sdnode(); } else if (Int.ModRef != CodeGenIntrinsic::NoMem) { // Has side-effects, requires chain. @@ -1568,7 +1568,7 @@ FindPatternInputsAndOutputs(TreePattern *I, TreePatternNode *Pat, // If this is not a set, verify that the children nodes are not void typed, // and recurse. for (unsigned i = 0, e = Pat->getNumChildren(); i != e; ++i) { - if (Pat->getChild(i)->getExtTypeNum(0) == MVT::isVoid) + if (Pat->getChild(i)->getExtTypeNum(0) == EVT::isVoid) I->error("Cannot have void nodes inside of patterns!"); FindPatternInputsAndOutputs(I, Pat->getChild(i), InstInputs, InstResults, InstImpInputs, InstImpResults); @@ -1816,7 +1816,7 @@ void CodeGenDAGPatterns::ParseInstructions() { // fill in the InstResults map. for (unsigned j = 0, e = I->getNumTrees(); j != e; ++j) { TreePatternNode *Pat = I->getTree(j); - if (Pat->getExtTypeNum(0) != MVT::isVoid) + if (Pat->getExtTypeNum(0) != EVT::isVoid) I->error("Top-level forms in instruction pattern should have" " void types"); diff --git a/utils/TableGen/CodeGenDAGPatterns.h b/utils/TableGen/CodeGenDAGPatterns.h index d398006812..6dbc7596c6 100644 --- a/utils/TableGen/CodeGenDAGPatterns.h +++ b/utils/TableGen/CodeGenDAGPatterns.h @@ -33,11 +33,11 @@ namespace llvm { class CodeGenDAGPatterns; class ComplexPattern; -/// EMVT::DAGISelGenValueType - These are some extended forms of -/// MVT::SimpleValueType that we use as lattice values during type inference. -namespace EMVT { +/// EEVT::DAGISelGenValueType - These are some extended forms of +/// EVT::SimpleValueType that we use as lattice values during type inference. +namespace EEVT { enum DAGISelGenValueType { - isFP = MVT::LAST_VALUETYPE, + isFP = EVT::LAST_VALUETYPE, isInt, isUnknown }; @@ -140,7 +140,7 @@ public: /// patterns), and as such should be ref counted. We currently just leak all /// TreePatternNode objects! class TreePatternNode { - /// The inferred type for this node, or EMVT::isUnknown if it hasn't + /// The inferred type for this node, or EEVT::isUnknown if it hasn't /// been determined yet. This is a std::vector because during inference /// there may be multiple possible types. std::vector<unsigned char> Types; @@ -169,10 +169,10 @@ class TreePatternNode { public: TreePatternNode(Record *Op, const std::vector<TreePatternNode*> &Ch) : Types(), Operator(Op), Val(0), TransformFn(0), - Children(Ch) { Types.push_back(EMVT::isUnknown); } + Children(Ch) { Types.push_back(EEVT::isUnknown); } TreePatternNode(Init *val) // leaf ctor : Types(), Operator(0), Val(val), TransformFn(0) { - Types.push_back(EMVT::isUnknown); + Types.push_back(EEVT::isUnknown); } ~TreePatternNode(); @@ -181,19 +181,19 @@ public: bool isLeaf() const { return Val != 0; } bool hasTypeSet() const { - return (Types[0] < MVT::LAST_VALUETYPE) || (Types[0] == MVT::iPTR) || - (Types[0] == MVT::iPTRAny); + return (Types[0] < EVT::LAST_VALUETYPE) || (Types[0] == EVT::iPTR) || + (Types[0] == EVT::iPTRAny); } bool isTypeCompletelyUnknown() const { - return Types[0] == EMVT::isUnknown; + return Types[0] == EEVT::isUnknown; } bool isTypeDynamicallyResolved() const { - return (Types[0] == MVT::iPTR) || (Types[0] == MVT::iPTRAny); + return (Types[0] == EVT::iPTR) || (Types[0] == EVT::iPTRAny); } - MVT::SimpleValueType getTypeNum(unsigned Num) const { + EVT::SimpleValueType getTypeNum(unsigned Num) const { assert(hasTypeSet() && "Doesn't have a type yet!"); assert(Types.size() > Num && "Type num out of range!"); - return (MVT::SimpleValueType)Types[Num]; + return (EVT::SimpleValueType)Types[Num]; } unsigned char getExtTypeNum(unsigned Num) const { assert(Types.size() > Num && "Extended type num out of range!"); @@ -201,7 +201,7 @@ public: } const std::vector<unsigned char> &getExtTypes() const { return Types; } void setTypes(const std::vector<unsigned char> &T) { Types = T; } - void removeTypes() { Types = std::vector<unsigned char>(1, EMVT::isUnknown); } + void removeTypes() { Types = std::vector<unsigned char>(1, EEVT::isUnknown); } Init *getLeafValue() const { assert(isLeaf()); return Val; } Record *getOperator() const { assert(!isLeaf()); return Operator; } diff --git a/utils/TableGen/CodeGenIntrinsics.h b/utils/TableGen/CodeGenIntrinsics.h index 7e7bdf989a..685e141f99 100644 --- a/utils/TableGen/CodeGenIntrinsics.h +++ b/utils/TableGen/CodeGenIntrinsics.h @@ -37,20 +37,20 @@ namespace llvm { /// continues from there through the parameter list. This is useful for /// "matching" types. struct IntrinsicSignature { - /// RetVTs - The MVT::SimpleValueType for each return type. Note that this + /// RetVTs - The EVT::SimpleValueType for each return type. Note that this /// list is only populated when in the context of a target .td file. When /// building Intrinsics.td, this isn't available, because we don't know /// the target pointer size. - std::vector<MVT::SimpleValueType> RetVTs; + std::vector<EVT::SimpleValueType> RetVTs; /// RetTypeDefs - The records for each return type. std::vector<Record*> RetTypeDefs; - /// ParamVTs - The MVT::SimpleValueType for each parameter type. Note that + /// ParamVTs - The EVT::SimpleValueType for each parameter type. Note that /// this list is only populated when in the context of a target .td file. /// When building Intrinsics.td, this isn't available, because we don't /// know the target pointer size. - std::vector<MVT::SimpleValueType> ParamVTs; + std::vector<EVT::SimpleValueType> ParamVTs; /// ParamTypeDefs - The records for each parameter type. std::vector<Record*> ParamTypeDefs; diff --git a/utils/TableGen/CodeGenRegisters.h b/utils/TableGen/CodeGenRegisters.h index 6f8682be59..a52da6e50b 100644 --- a/utils/TableGen/CodeGenRegisters.h +++ b/utils/TableGen/CodeGenRegisters.h @@ -36,7 +36,7 @@ namespace llvm { Record *TheDef; std::string Namespace; std::vector<Record*> Elements; - std::vector<MVT::SimpleValueType> VTs; + std::vector<EVT::SimpleValueType> VTs; unsigned SpillSize; unsigned SpillAlignment; int CopyCost; @@ -44,10 +44,10 @@ namespace llvm { std::string MethodProtos, MethodBodies; const std::string &getName() const; - const std::vector<MVT::SimpleValueType> &getValueTypes() const {return VTs;} + const std::vector<EVT::SimpleValueType> &getValueTypes() const {return VTs;} unsigned getNumValueTypes() const { return VTs.size(); } - MVT::SimpleValueType getValueTypeNum(unsigned VTNum) const { + EVT::SimpleValueType getValueTypeNum(unsigned VTNum) const { if (VTNum < VTs.size()) return VTs[VTNum]; assert(0 && "VTNum greater than number of ValueTypes in RegClass!"); diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp index 0849d4f832..15aa2de1d5 100644 --- a/utils/TableGen/CodeGenTarget.cpp +++ b/utils/TableGen/CodeGenTarget.cpp @@ -30,62 +30,62 @@ static cl::opt<unsigned> AsmWriterNum("asmwriternum", cl::init(0), cl::desc("Make -gen-asm-writer emit assembly writer #N")); -/// getValueType - Return the MVT::SimpleValueType that the specified TableGen +/// getValueType - Return the EVT::SimpleValueType that the specified TableGen /// record corresponds to. -MVT::SimpleValueType llvm::getValueType(Record *Rec) { - return (MVT::SimpleValueType)Rec->getValueAsInt("Value"); +EVT::SimpleValueType llvm::getValueType(Record *Rec) { + return (EVT::SimpleValueType)Rec->getValueAsInt("Value"); } -std::string llvm::getName(MVT::SimpleValueType T) { +std::string llvm::getName(EVT::SimpleValueType T) { switch (T) { - case MVT::Other: return "UNKNOWN"; - case MVT::iPTR: return "TLI.getPointerTy()"; - case MVT::iPTRAny: return "TLI.getPointerTy()"; + case EVT::Other: return "UNKNOWN"; + case EVT::iPTR: return "TLI.getPointerTy()"; + case EVT::iPTRAny: return "TLI.getPointerTy()"; default: return getEnumName(T); } } -std::string llvm::getEnumName(MVT::SimpleValueType T) { +std::string llvm::getEnumName(EVT::SimpleValueType T) { switch (T) { - case MVT::Other: return "MVT::Other"; - case MVT::i1: return "MVT::i1"; - case MVT::i8: return "MVT::i8"; - case MVT::i16: return "MVT::i16"; - case MVT::i32: return "MVT::i32"; - case MVT::i64: return "MVT::i64"; - case MVT::i128: return "MVT::i128"; - case MVT::iAny: return "MVT::iAny"; - case MVT::fAny: return "MVT::fAny"; - case MVT::f32: return "MVT::f32"; - case MVT::f64: return "MVT::f64"; - case MVT::f80: return "MVT::f80"; - case MVT::f128: return "MVT::f128"; - case MVT::ppcf128: return "MVT::ppcf128"; - case MVT::Flag: return "MVT::Flag"; - case MVT::isVoid:return "MVT::isVoid"; - case MVT::v2i8: return "MVT::v2i8"; - case MVT::v4i8: return "MVT::v4i8"; - case MVT::v8i8: return "MVT::v8i8"; - case MVT::v16i8: return "MVT::v16i8"; - case MVT::v32i8: return "MVT::v32i8"; - case MVT::v2i16: return "MVT::v2i16"; - case MVT::v4i16: return "MVT::v4i16"; - case MVT::v8i16: return "MVT::v8i16"; - case MVT::v16i16: return "MVT::v16i16"; - case MVT::v2i32: return "MVT::v2i32"; - case MVT::v4i32: return "MVT::v4i32"; - case MVT::v8i32: return "MVT::v8i32"; - case MVT::v1i64: return "MVT::v1i64"; - case MVT::v2i64: return "MVT::v2i64"; - case MVT::v4i64: return "MVT::v4i64"; - case MVT::v2f32: return "MVT::v2f32"; - case MVT::v4f32: return "MVT::v4f32"; - case MVT::v8f32: return "MVT::v8f32"; - case MVT::v2f64: return "MVT::v2f64"; - case MVT::v4f64: return "MVT::v4f64"; - case MVT::Metadata: return "MVT::Metadata"; - case MVT::iPTR: return "MVT::iPTR"; - case MVT::iPTRAny: return "MVT::iPTRAny"; + case EVT::Other: return "EVT::Other"; + case EVT::i1: return "EVT::i1"; + case EVT::i8: return "EVT::i8"; + case EVT::i16: return "EVT::i16"; + case EVT::i32: return "EVT::i32"; + case EVT::i64: return "EVT::i64"; + case EVT::i128: return "EVT::i128"; + case EVT::iAny: return "EVT::iAny"; + case EVT::fAny: return "EVT::fAny"; + case EVT::f32: return "EVT::f32"; + case EVT::f64: return "EVT::f64"; + case EVT::f80: return "EVT::f80"; + case EVT::f128: return "EVT::f128"; + case EVT::ppcf128: return "EVT::ppcf128"; + case EVT::Flag: return "EVT::Flag"; + case EVT::isVoid:return "EVT::isVoid"; + case EVT::v2i8: return "EVT::v2i8"; + case EVT::v4i8: return "EVT::v4i8"; + case EVT::v8i8: return "EVT::v8i8"; + case EVT::v16i8: return "EVT::v16i8"; + case EVT::v32i8: return "EVT::v32i8"; + case EVT::v2i16: return "EVT::v2i16"; + case EVT::v4i16: return "EVT::v4i16"; + case EVT::v8i16: return "EVT::v8i16"; + case EVT::v16i16: return "EVT::v16i16"; + case EVT::v2i32: return "EVT::v2i32"; + case EVT::v4i32: return "EVT::v4i32"; + case EVT::v8i32: return "EVT::v8i32"; + case EVT::v1i64: return "EVT::v1i64"; + case EVT::v2i64: return "EVT::v2i64"; + case EVT::v4i64: return "EVT::v4i64"; + case EVT::v2f32: return "EVT::v2f32"; + case EVT::v4f32: return "EVT::v4f32"; + case EVT::v8f32: return "EVT::v8f32"; + case EVT::v2f64: return "EVT::v2f64"; + case EVT::v4f64: return "EVT::v4f64"; + case EVT::Metadata: return "EVT::Metadata"; + case EVT::iPTR: return "EVT::iPTR"; + case EVT::iPTRAny: return "EVT::iPTRAny"; default: assert(0 && "ILLEGAL VALUE TYPE!"); return ""; } } @@ -190,7 +190,7 @@ std::vector<unsigned char> CodeGenTarget::getRegisterVTs(Record *R) const { const CodeGenRegisterClass &RC = RegisterClasses[i]; for (unsigned ei = 0, ee = R |