1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

If a pattern's root node is a constant, its size should be 3 rather than 2.

llvm-svn: 25870
This commit is contained in:
Evan Cheng 2006-02-01 06:06:31 +00:00
parent 8b429890aa
commit efdfb534a7

View File

@ -1709,6 +1709,10 @@ static unsigned getPatternSize(TreePatternNode *P, DAGISelEmitter &ISE) {
P->getExtTypeNum(0) == MVT::Flag &&
"Not a valid pattern node to size!");
unsigned Size = 2; // 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++;
// 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.