X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=utils%2FTableGen%2FCodeGenDAGPatterns.cpp;h=6e7dd1eae05dd9a946434f53196f2b939d24f9f5;hb=13d5b71a957f51fc86e3d21606a312b391039a4b;hp=859a8ccac8d9e6cb1286f07b250547fbab038dcb;hpb=cdcc3e6e12b8b4e224bd62c96768c5f5e325aace;p=oota-llvm.git diff --git a/utils/TableGen/CodeGenDAGPatterns.cpp b/utils/TableGen/CodeGenDAGPatterns.cpp index 859a8ccac8d..6e7dd1eae05 100644 --- a/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/utils/TableGen/CodeGenDAGPatterns.cpp @@ -482,8 +482,9 @@ bool TreePatternNode::UpdateNodeType(const std::vector &ExtVTs, } } } - - if (ExtVTs[0] == EMVT::isInt && EMVT::isExtIntegerInVTs(getExtTypes())) { + + if ((ExtVTs[0] == EMVT::isInt || ExtVTs[0] == MVT::iAny) && + EMVT::isExtIntegerInVTs(getExtTypes())) { assert(hasTypeSet() && "should be handled above!"); std::vector FVTs = FilterEVTs(getExtTypes(), isInteger); if (getExtTypes() == FVTs) @@ -502,7 +503,8 @@ bool TreePatternNode::UpdateNodeType(const std::vector &ExtVTs, return true; } } - if (ExtVTs[0] == EMVT::isFP && EMVT::isExtFloatingPointInVTs(getExtTypes())) { + if ((ExtVTs[0] == EMVT::isFP || ExtVTs[0] == MVT::fAny) && + EMVT::isExtFloatingPointInVTs(getExtTypes())) { assert(hasTypeSet() && "should be handled above!"); std::vector FVTs = FilterEVTs(getExtTypes(), isFloatingPoint); @@ -517,9 +519,9 @@ bool TreePatternNode::UpdateNodeType(const std::vector &ExtVTs, // // Similarly, we should probably set the type here to the intersection of // {isInt|isFP} and ExtVTs - if ((getExtTypeNum(0) == EMVT::isInt && + if (((getExtTypeNum(0) == EMVT::isInt || getExtTypeNum(0) == MVT::iAny) && EMVT::isExtIntegerInVTs(ExtVTs)) || - (getExtTypeNum(0) == EMVT::isFP && + ((getExtTypeNum(0) == EMVT::isFP || getExtTypeNum(0) == MVT::fAny) && EMVT::isExtFloatingPointInVTs(ExtVTs))) { setTypes(ExtVTs); return true; @@ -807,7 +809,7 @@ TreePatternNode::isCommutativeIntrinsic(const CodeGenDAGPatterns &CDP) const { } -/// ApplyTypeConstraints - Apply all of the type constraints relevent to +/// ApplyTypeConstraints - Apply all of the type constraints relevant to /// this node and its children in the tree. This returns true if it makes a /// change, false otherwise. If a type contradiction is found, throw an /// exception. @@ -840,7 +842,7 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) { // If sign-extended doesn't fit, does it fit as unsigned? unsigned ValueMask; unsigned UnsignedVal; - ValueMask = unsigned(MVT(VT).getIntegerVTBitMask()); + ValueMask = unsigned(~uint32_t(0UL) >> (32-Size)); UnsignedVal = unsigned(II->getValue()); if ((ValueMask & UnsignedVal) != UnsignedVal) { @@ -1301,7 +1303,8 @@ void TreePattern::dump() const { print(*cerr.stream()); } // FIXME: REMOVE OSTREAM ARGUMENT CodeGenDAGPatterns::CodeGenDAGPatterns(RecordKeeper &R) : Records(R) { - Intrinsics = LoadIntrinsics(Records); + Intrinsics = LoadIntrinsics(Records, false); + TgtIntrinsics = LoadIntrinsics(Records, true); ParseNodeInfo(); ParseNodeTransforms(); ParseComplexPatterns();