1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00

[TableGen] Add isContradictoryImpl implementation to CheckCondCodeMatcher and CheckChild2CondCodeMatcher.

This enables better pattern factoring in the RISCV ISel table.
This commit is contained in:
Craig Topper 2021-01-26 19:41:52 -08:00
parent 1a410d196a
commit 69039e7730
2 changed files with 14 additions and 0 deletions

View File

@ -421,3 +421,15 @@ bool CheckImmAllZerosVMatcher::isContradictoryImpl(const Matcher *M) const {
// 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;
}

View File

@ -635,6 +635,7 @@ private:
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
@ -656,6 +657,7 @@ private:
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