[llvm] r355785 - [TableGen] Make CheckImmAllOnesVMatcher and CheckImmAllZerosVMatcher contradictory matchers.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 9 22:44:09 PST 2019
Author: ctopper
Date: Sat Mar 9 22:44:09 2019
New Revision: 355785
URL: http://llvm.org/viewvc/llvm-project?rev=355785&view=rev
Log:
[TableGen] Make CheckImmAllOnesVMatcher and CheckImmAllZerosVMatcher contradictory matchers.
This improves X86 factoring a little bit.
Modified:
llvm/trunk/utils/TableGen/DAGISelMatcher.cpp
llvm/trunk/utils/TableGen/DAGISelMatcher.h
Modified: llvm/trunk/utils/TableGen/DAGISelMatcher.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelMatcher.cpp?rev=355785&r1=355784&r2=355785&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelMatcher.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelMatcher.cpp Sat Mar 9 22:44:09 2019
@@ -412,3 +412,16 @@ bool CheckValueTypeMatcher::isContradict
return false;
}
+bool CheckImmAllOnesVMatcher::isContradictoryImpl(const Matcher *M) const {
+ // AllZeros is contradictory.
+ if (const auto *CIAZVM = dyn_cast<CheckImmAllZerosVMatcher>(M))
+ return true;
+ return false;
+}
+
+bool CheckImmAllZerosVMatcher::isContradictoryImpl(const Matcher *M) const {
+ // AllOnes is contradictory.
+ if (const auto *CIAOVM = dyn_cast<CheckImmAllOnesVMatcher>(M))
+ return true;
+ return false;
+}
Modified: llvm/trunk/utils/TableGen/DAGISelMatcher.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelMatcher.h?rev=355785&r1=355784&r2=355785&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelMatcher.h (original)
+++ llvm/trunk/utils/TableGen/DAGISelMatcher.h Sat Mar 9 22:44:09 2019
@@ -770,6 +770,7 @@ public:
private:
void printImpl(raw_ostream &OS, unsigned indent) const override;
bool isEqualImpl(const Matcher *M) const override { return true; }
+ bool isContradictoryImpl(const Matcher *M) const override;
};
/// CheckImmAllZerosVMatcher - This check if the current node is an build vector
@@ -785,6 +786,7 @@ public:
private:
void printImpl(raw_ostream &OS, unsigned indent) const override;
bool isEqualImpl(const Matcher *M) const override { return true; }
+ bool isContradictoryImpl(const Matcher *M) const override;
};
/// CheckFoldableChainNodeMatcher - This checks to see if the current node
More information about the llvm-commits
mailing list