diff --git a/utils/TableGen/DAGISelMatcher.cpp b/utils/TableGen/DAGISelMatcher.cpp index bebd205ad58..e436a931a9f 100644 --- a/utils/TableGen/DAGISelMatcher.cpp +++ b/utils/TableGen/DAGISelMatcher.cpp @@ -421,3 +421,15 @@ bool CheckImmAllZerosVMatcher::isContradictoryImpl(const Matcher *M) const { // AllOnes is contradictory. return isa(M); } + +bool CheckCondCodeMatcher::isContradictoryImpl(const Matcher *M) const { + if (const auto *CCCM = dyn_cast(M)) + return CCCM->getCondCodeName() != getCondCodeName(); + return false; +} + +bool CheckChild2CondCodeMatcher::isContradictoryImpl(const Matcher *M) const { + if (const auto *CCCCM = dyn_cast(M)) + return CCCCM->getCondCodeName() != getCondCodeName(); + return false; +} diff --git a/utils/TableGen/DAGISelMatcher.h b/utils/TableGen/DAGISelMatcher.h index ff9a0cb335d..77280acaf4c 100644 --- a/utils/TableGen/DAGISelMatcher.h +++ b/utils/TableGen/DAGISelMatcher.h @@ -635,6 +635,7 @@ private: bool isEqualImpl(const Matcher *M) const override { return cast(M)->CondCodeName == CondCodeName; } + bool isContradictoryImpl(const Matcher *M) const override; }; /// CheckChild2CondCodeMatcher - This checks to see if child 2 node is a @@ -656,6 +657,7 @@ private: bool isEqualImpl(const Matcher *M) const override { return cast(M)->CondCodeName == CondCodeName; } + bool isContradictoryImpl(const Matcher *M) const override; }; /// CheckValueTypeMatcher - This checks to see if the current node is a