diff options
author | Chris Lattner <sabre@nondot.org> | 2010-02-27 21:48:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-02-27 21:48:43 +0000 |
commit | a230f9623d864450d432bb76c397b0cb35a3437e (patch) | |
tree | 2be73812f216d3264745af0db51056fe19b32ce6 /utils/TableGen/DAGISelMatcher.cpp | |
parent | 9fa200d2a2360412465bbd6cfb485af2e9d5b1b4 (diff) | |
download | external_llvm-a230f9623d864450d432bb76c397b0cb35a3437e.zip external_llvm-a230f9623d864450d432bb76c397b0cb35a3437e.tar.gz external_llvm-a230f9623d864450d432bb76c397b0cb35a3437e.tar.bz2 |
change CheckOpcodeMatcher to hold the SDNodeInfo instead of
the opcode name. This gives the optimizer more semantic info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97346 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/DAGISelMatcher.cpp')
-rw-r--r-- | utils/TableGen/DAGISelMatcher.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/utils/TableGen/DAGISelMatcher.cpp b/utils/TableGen/DAGISelMatcher.cpp index d8aee08..ade058e 100644 --- a/utils/TableGen/DAGISelMatcher.cpp +++ b/utils/TableGen/DAGISelMatcher.cpp @@ -81,7 +81,7 @@ void CheckPredicateMatcher::printImpl(raw_ostream &OS, unsigned indent) const { } void CheckOpcodeMatcher::printImpl(raw_ostream &OS, unsigned indent) const { - OS.indent(indent) << "CheckOpcode " << OpcodeName << '\n'; + OS.indent(indent) << "CheckOpcode " << Opcode.getEnumName() << '\n'; } void CheckMultiOpcodeMatcher::printImpl(raw_ostream &OS, unsigned indent) const{ @@ -202,13 +202,13 @@ unsigned CheckPredicateMatcher::getHashImpl() const { } unsigned CheckOpcodeMatcher::getHashImpl() const { - return HashString(OpcodeName); + return HashString(Opcode.getEnumName()); } unsigned CheckMultiOpcodeMatcher::getHashImpl() const { unsigned Result = 0; - for (unsigned i = 0, e = OpcodeNames.size(); i != e; ++i) - Result |= HashString(OpcodeNames[i]); + for (unsigned i = 0, e = Opcodes.size(); i != e; ++i) + Result |= HashString(Opcodes[i]->getEnumName()); return Result; } @@ -263,7 +263,7 @@ unsigned CompleteMatchMatcher::getHashImpl() const { bool CheckOpcodeMatcher::isContradictoryImpl(const Matcher *M) const { if (const CheckOpcodeMatcher *COM = dyn_cast<CheckOpcodeMatcher>(M)) { // One node can't have two different opcodes! - return COM->getOpcodeName() != getOpcodeName(); + return &COM->getOpcode() != &getOpcode(); } // TODO: CheckMultiOpcodeMatcher? @@ -272,8 +272,8 @@ bool CheckOpcodeMatcher::isContradictoryImpl(const Matcher *M) const { // ISD::STORE nodes can't have non-void type. if (const CheckTypeMatcher *CT = dyn_cast<CheckTypeMatcher>(M)) // FIXME: This sucks, get void nodes from type constraints. - return (getOpcodeName() == "ISD::STORE" || - getOpcodeName() == "ISD::INTRINSIC_VOID") && + return (getOpcode().getEnumName() == "ISD::STORE" || + getOpcode().getEnumName() == "ISD::INTRINSIC_VOID") && CT->getType() != MVT::isVoid; return false; |