[llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp 
    Evan Cheng 
    evan.cheng at apple.com
       
    Tue Jan 31 22:06:43 PST 2006
    
    
  
Changes in directory llvm/utils/TableGen:
DAGISelEmitter.cpp updated: 1.158 -> 1.159
---
Log message:
If a pattern's root node is a constant, its size should be 3 rather than 2.
---
Diffs of the changes:  (+4 -0)
 DAGISelEmitter.cpp |    4 ++++
 1 files changed, 4 insertions(+)
Index: llvm/utils/TableGen/DAGISelEmitter.cpp
diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.158 llvm/utils/TableGen/DAGISelEmitter.cpp:1.159
--- llvm/utils/TableGen/DAGISelEmitter.cpp:1.158	Sun Jan 29 14:01:35 2006
+++ llvm/utils/TableGen/DAGISelEmitter.cpp	Wed Feb  1 00:06:31 2006
@@ -1709,6 +1709,10 @@
          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.
    
    
More information about the llvm-commits
mailing list