mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-21 18:22:53 +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:
parent
1a410d196a
commit
69039e7730
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user