aboutsummaryrefslogtreecommitdiffstats
path: root/utils/TableGen
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-01-06 02:30:23 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-01-06 02:30:23 +0000
commite1050d616bafa1f52485b669b34163f1d00ff104 (patch)
tree3a11c323ca672ac0b08037d9cb0f9c9749031ede /utils/TableGen
parent6907708c23303703c6f89e055d1c204c5abb27a5 (diff)
downloadexternal_llvm-e1050d616bafa1f52485b669b34163f1d00ff104.zip
external_llvm-e1050d616bafa1f52485b669b34163f1d00ff104.tar.gz
external_llvm-e1050d616bafa1f52485b669b34163f1d00ff104.tar.bz2
Tweak pattern complexity calc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25122 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen')
-rw-r--r--utils/TableGen/DAGISelEmitter.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp
index 1d8e645..21e5ed3 100644
--- a/utils/TableGen/DAGISelEmitter.cpp
+++ b/utils/TableGen/DAGISelEmitter.cpp
@@ -1691,12 +1691,7 @@ static const ComplexPattern *NodeGetComplexPattern(TreePatternNode *N,
/// patterns before small ones. This is used to determine the size of a
/// pattern.
static unsigned getPatternSize(TreePatternNode *P, DAGISelEmitter &ISE) {
- assert(isExtIntegerInVTs(P->getExtTypes()) ||
- isExtFloatingPointInVTs(P->getExtTypes()) ||
- P->getExtTypeNum(0) == MVT::isVoid ||
- P->getExtTypeNum(0) == MVT::Flag &&
- "Not a valid pattern node to size!");
- unsigned Size = 1; // The node itself.
+ unsigned Size = 2; // The node itself.
// FIXME: This is a hack to statically increase the priority of patterns
// which maps a sub-dag to a complex pattern. e.g. favors LEA over ADD.
@@ -1713,10 +1708,10 @@ static unsigned getPatternSize(TreePatternNode *P, DAGISelEmitter &ISE) {
if (!Child->isLeaf() && Child->getExtTypeNum(0) != MVT::Other)
Size += getPatternSize(Child, ISE);
else if (Child->isLeaf()) {
+ Size += getPatternSize(Child, ISE);
if (dynamic_cast<IntInit*>(Child->getLeafValue()))
- ++Size; // Matches a ConstantSDNode.
- else if (NodeIsComplexPattern(Child))
- Size += getPatternSize(Child, ISE);
+ // Matches a ConstantSDNode. More specific to any immediate.
+ ++Size;
}
}