[llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp
Evan Cheng
evan.cheng at apple.com
Fri Sep 8 00:26:53 PDT 2006
Changes in directory llvm/utils/TableGen:
DAGISelEmitter.cpp updated: 1.253 -> 1.254
---
Log message:
Generated isel should favors explicit constant operand (+2) over an operand with a predicate (+1).
---
Diffs of the changes: (+4 -5)
DAGISelEmitter.cpp | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
Index: llvm/utils/TableGen/DAGISelEmitter.cpp
diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.253 llvm/utils/TableGen/DAGISelEmitter.cpp:1.254
--- llvm/utils/TableGen/DAGISelEmitter.cpp:1.253 Sun Aug 27 08:16:24 2006
+++ llvm/utils/TableGen/DAGISelEmitter.cpp Fri Sep 8 02:26:39 2006
@@ -768,7 +768,6 @@
if (OperandNode->isSubClassOf("RegisterClass")) {
const CodeGenRegisterClass &RC =
ISE.getTargetInfo().getRegisterClass(OperandNode);
- //VT = RC.getValueTypeNum(0);
MadeChange |=getChild(i)->UpdateNodeType(ConvertVTs(RC.getValueTypes()),
TP);
} else if (OperandNode->isSubClassOf("Operand")) {
@@ -1944,11 +1943,11 @@
P->getExtTypeNum(0) == MVT::Flag ||
P->getExtTypeNum(0) == MVT::iPTR) &&
"Not a valid pattern node to size!");
- unsigned Size = 2; // The node itself.
+ unsigned Size = 3; // The node itself.
// If the root node is a ConstantSDNode, increases its size.
// e.g. (set R32:$dst, 0).
if (P->isLeaf() && dynamic_cast<IntInit*>(P->getLeafValue()))
- Size++;
+ Size += 2;
// 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.
@@ -1957,7 +1956,7 @@
// calculate the complexity of all patterns a dag can potentially map to.
const ComplexPattern *AM = NodeGetComplexPattern(P, ISE);
if (AM)
- Size += AM->getNumOperands() * 2;
+ Size += AM->getNumOperands() * 3;
// If this node has some predicate function that must match, it adds to the
// complexity of this node.
@@ -1971,7 +1970,7 @@
Size += getPatternSize(Child, ISE);
else if (Child->isLeaf()) {
if (dynamic_cast<IntInit*>(Child->getLeafValue()))
- Size += 3; // Matches a ConstantSDNode (+2) and a specific value (+1).
+ Size += 5; // Matches a ConstantSDNode (+3) and a specific value (+2).
else if (NodeIsComplexPattern(Child))
Size += getPatternSize(Child, ISE);
else if (!Child->getPredicateFn().empty())
More information about the llvm-commits
mailing list