diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-01 07:54:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-01 07:54:59 +0000 |
commit | 60c0e37afcb62c934e8bd69891fe65f8141a4bb5 (patch) | |
tree | 0680e683f7ff82b2f7df3005f4c993e6b45ebd38 /utils | |
parent | 7d892d6e6d451e9a0d0f9db839a943a256126c05 (diff) | |
download | external_llvm-60c0e37afcb62c934e8bd69891fe65f8141a4bb5.zip external_llvm-60c0e37afcb62c934e8bd69891fe65f8141a4bb5.tar.gz external_llvm-60c0e37afcb62c934e8bd69891fe65f8141a4bb5.tar.bz2 |
Emit type checks late instead of early, this encourages
structural matching code to be factored and shared this
shrinks the X86 isel table from 86537 to 83890 bytes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97442 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/DAGISelMatcherGen.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/utils/TableGen/DAGISelMatcherGen.cpp b/utils/TableGen/DAGISelMatcherGen.cpp index 62442d0..cc3c4f1 100644 --- a/utils/TableGen/DAGISelMatcherGen.cpp +++ b/utils/TableGen/DAGISelMatcherGen.cpp @@ -460,8 +460,9 @@ void MatcherGen::EmitMatchCode(const TreePatternNode *N, // If N and NodeNoTypes don't agree on a type, then this is a case where we // need to do a type check. Emit the check, apply the tyep to NodeNoTypes and // reinfer any correlated types. + unsigned NodeType = EEVT::isUnknown; if (NodeNoTypes->getExtTypes() != N->getExtTypes()) { - AddMatcher(new CheckTypeMatcher(N->getTypeNum(0))); + NodeType = N->getTypeNum(0); NodeNoTypes->setTypes(N->getExtTypes()); InferPossibleTypes(); } @@ -488,6 +489,10 @@ void MatcherGen::EmitMatchCode(const TreePatternNode *N, EmitLeafMatchCode(N); else EmitOperatorMatchCode(N, NodeNoTypes); + + if (NodeType != EEVT::isUnknown) + AddMatcher(new CheckTypeMatcher((MVT::SimpleValueType)NodeType)); + } /// EmitMatcherCode - Generate the code that matches the predicate of this |