[llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp
Evan Cheng
evan.cheng at apple.com
Thu Jan 5 18:30:35 PST 2006
Changes in directory llvm/utils/TableGen:
DAGISelEmitter.cpp updated: 1.125 -> 1.126
---
Log message:
Tweak pattern complexity calc.
---
Diffs of the changes: (+4 -9)
DAGISelEmitter.cpp | 13 ++++---------
1 files changed, 4 insertions(+), 9 deletions(-)
Index: llvm/utils/TableGen/DAGISelEmitter.cpp
diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.125 llvm/utils/TableGen/DAGISelEmitter.cpp:1.126
--- llvm/utils/TableGen/DAGISelEmitter.cpp:1.125 Thu Jan 5 18:41:12 2006
+++ llvm/utils/TableGen/DAGISelEmitter.cpp Thu Jan 5 20:30:23 2006
@@ -1691,12 +1691,7 @@
/// 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 @@
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;
}
}
More information about the llvm-commits
mailing list