diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2006-01-06 02:30:23 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2006-01-06 02:30:23 +0000 |
| commit | 46634d21e36a13bf13a2b69904d6674293e9bc05 (patch) | |
| tree | d945ae2d0dd9b4065b9ebcdb4c6f6d8364e1994c /llvm/utils | |
| parent | 85c973cda9109056aaafb65ebee89d7062fa45fd (diff) | |
| download | bcm5719-llvm-46634d21e36a13bf13a2b69904d6674293e9bc05.tar.gz bcm5719-llvm-46634d21e36a13bf13a2b69904d6674293e9bc05.zip | |
Tweak pattern complexity calc.
llvm-svn: 25122
Diffstat (limited to 'llvm/utils')
| -rw-r--r-- | llvm/utils/TableGen/DAGISelEmitter.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/llvm/utils/TableGen/DAGISelEmitter.cpp b/llvm/utils/TableGen/DAGISelEmitter.cpp index 1d8e645e937..21e5ed393dd 100644 --- a/llvm/utils/TableGen/DAGISelEmitter.cpp +++ b/llvm/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; } } |

