This enables better pattern factoring in the RISCV ISel table.
// AllOnes is contradictory.
return isa<CheckImmAllOnesVMatcher>(M);
}
+
+bool CheckCondCodeMatcher::isContradictoryImpl(const Matcher *M) const {
+ if (const auto *CCCM = dyn_cast<CheckCondCodeMatcher>(M))
+ return CCCM->getCondCodeName() != getCondCodeName();
+ return false;
+}
+
+bool CheckChild2CondCodeMatcher::isContradictoryImpl(const Matcher *M) const {
+ if (const auto *CCCCM = dyn_cast<CheckChild2CondCodeMatcher>(M))
+ return CCCCM->getCondCodeName() != getCondCodeName();
+ return false;
+}
bool isEqualImpl(const Matcher *M) const override {
return cast<CheckCondCodeMatcher>(M)->CondCodeName == CondCodeName;
}
+ bool isContradictoryImpl(const Matcher *M) const override;
};
/// CheckChild2CondCodeMatcher - This checks to see if child 2 node is a
bool isEqualImpl(const Matcher *M) const override {
return cast<CheckChild2CondCodeMatcher>(M)->CondCodeName == CondCodeName;
}
+ bool isContradictoryImpl(const Matcher *M) const override;
};
/// CheckValueTypeMatcher - This checks to see if the current node is a