teach the optimizer that opcode == ISD::STORE is contradictory
with getType() == MVT::i32 etc. Teach it that two different
integer constants are contradictory. This cuts 1K off the X86
table, down to 98k
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97314 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/TableGen/DAGISelMatcher.cpp b/utils/TableGen/DAGISelMatcher.cpp
index dfb2361..601ac87 100644
--- a/utils/TableGen/DAGISelMatcher.cpp
+++ b/utils/TableGen/DAGISelMatcher.cpp
@@ -267,7 +267,12 @@
}
// TODO: CheckMultiOpcodeMatcher?
- // TODO: CheckType?
+
+ // This is a special common case we see a lot in the X86 backend, we know that
+ // ISD::STORE nodes can't have non-void type.
+ if (const CheckTypeMatcher *CT = dyn_cast<CheckTypeMatcher>(M))
+ return getOpcodeName() == "ISD::STORE" && CT->getType() != MVT::isVoid;
+
return false;
}
@@ -307,4 +312,8 @@
return false;
}
-
+bool CheckIntegerMatcher::isContradictoryImpl(const Matcher *M) const {
+ if (const CheckIntegerMatcher *CIM = dyn_cast<CheckIntegerMatcher>(M))
+ return CIM->getValue() != getValue();
+ return false;
+}