mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-23 14:25:07 +00:00
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
This commit is contained in:
@@ -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
|
// 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
|
// need to do a type check. Emit the check, apply the tyep to NodeNoTypes and
|
||||||
// reinfer any correlated types.
|
// reinfer any correlated types.
|
||||||
|
unsigned NodeType = EEVT::isUnknown;
|
||||||
if (NodeNoTypes->getExtTypes() != N->getExtTypes()) {
|
if (NodeNoTypes->getExtTypes() != N->getExtTypes()) {
|
||||||
AddMatcher(new CheckTypeMatcher(N->getTypeNum(0)));
|
NodeType = N->getTypeNum(0);
|
||||||
NodeNoTypes->setTypes(N->getExtTypes());
|
NodeNoTypes->setTypes(N->getExtTypes());
|
||||||
InferPossibleTypes();
|
InferPossibleTypes();
|
||||||
}
|
}
|
||||||
@@ -488,6 +489,10 @@ void MatcherGen::EmitMatchCode(const TreePatternNode *N,
|
|||||||
EmitLeafMatchCode(N);
|
EmitLeafMatchCode(N);
|
||||||
else
|
else
|
||||||
EmitOperatorMatchCode(N, NodeNoTypes);
|
EmitOperatorMatchCode(N, NodeNoTypes);
|
||||||
|
|
||||||
|
if (NodeType != EEVT::isUnknown)
|
||||||
|
AddMatcher(new CheckTypeMatcher((MVT::SimpleValueType)NodeType));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// EmitMatcherCode - Generate the code that matches the predicate of this
|
/// EmitMatcherCode - Generate the code that matches the predicate of this
|
||||||
|
Reference in New Issue
Block a user