mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-05 12:31:33 +00:00
If a pattern's root node is a constant, its size should be 3 rather than 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25870 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
09f0bd39b1
commit
657416cfba
@ -1709,6 +1709,10 @@ static unsigned getPatternSize(TreePatternNode *P, DAGISelEmitter &ISE) {
|
|||||||
P->getExtTypeNum(0) == MVT::Flag &&
|
P->getExtTypeNum(0) == MVT::Flag &&
|
||||||
"Not a valid pattern node to size!");
|
"Not a valid pattern node to size!");
|
||||||
unsigned Size = 2; // The node itself.
|
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
|
// 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.
|
// which maps a sub-dag to a complex pattern. e.g. favors LEA over ADD.
|
||||||
|
Loading…
Reference in New Issue
Block a user