[llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp DAGISelEmitter.h

Chris Lattner lattner at cs.uiuc.edu
Wed Sep 28 13:58:17 PDT 2005



Changes in directory llvm/utils/TableGen:

DAGISelEmitter.cpp updated: 1.48 -> 1.49
DAGISelEmitter.h updated: 1.27 -> 1.28
---
Log message:

add support for an associative marker


---
Diffs of the changes:  (+7 -5)

 DAGISelEmitter.cpp |    6 ++++--
 DAGISelEmitter.h   |    6 +++---
 2 files changed, 7 insertions(+), 5 deletions(-)


Index: llvm/utils/TableGen/DAGISelEmitter.cpp
diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.48 llvm/utils/TableGen/DAGISelEmitter.cpp:1.49
--- llvm/utils/TableGen/DAGISelEmitter.cpp:1.48	Wed Sep 28 14:27:25 2005
+++ llvm/utils/TableGen/DAGISelEmitter.cpp	Wed Sep 28 15:58:06 2005
@@ -145,6 +145,8 @@
     assert(DI && "Properties list must be list of defs!");
     if (DI->getDef()->getName() == "SDNPCommutative") {
       Properties |= 1 << SDNPCommutative;
+    } else if (DI->getDef()->getName() == "SDNPAssociative") {
+      Properties |= 1 << SDNPAssociative;
     } else {
       std::cerr << "Unknown SD Node property '" << DI->getDef()->getName()
                 << "' on node '" << R->getName() << "'!\n";
@@ -377,7 +379,7 @@
 /// used as a santity check for .td files (to prevent people from writing stuff
 /// that can never possibly work), and to prevent the pattern permuter from
 /// generating stuff that is useless.
-bool TreePatternNode::canPatternMatch(std::string &Reason, DAGISelEmitter &ISE) {
+bool TreePatternNode::canPatternMatch(std::string &Reason, DAGISelEmitter &ISE){
   if (isLeaf()) return true;
 
   for (unsigned i = 0, e = getNumChildren(); i != e; ++i)
@@ -1052,9 +1054,9 @@
 // GenerateVariants - Generate variants.  For example, commutative patterns can
 // match multiple ways.  Add them to PatternsToMatch as well.
 void DAGISelEmitter::GenerateVariants() {
-  
 }
 
+
 /// getPatternSize - Return the 'size' of this pattern.  We want to match large
 /// patterns before small ones.  This is used to determine the size of a
 /// pattern.


Index: llvm/utils/TableGen/DAGISelEmitter.h
diff -u llvm/utils/TableGen/DAGISelEmitter.h:1.27 llvm/utils/TableGen/DAGISelEmitter.h:1.28
--- llvm/utils/TableGen/DAGISelEmitter.h:1.27	Wed Sep 28 14:27:25 2005
+++ llvm/utils/TableGen/DAGISelEmitter.h	Wed Sep 28 15:58:06 2005
@@ -87,7 +87,7 @@
     }
     
     // SelectionDAG node properties.
-    enum SDNP { SDNPCommutative };
+    enum SDNP { SDNPCommutative, SDNPAssociative };
 
     /// hasProperty - Return true if this node has the specified property.
     ///
@@ -205,8 +205,8 @@
       return false;
     }
     
-    /// canPatternMatch - Return false if it is impossible for this pattern to
-    /// match on this target.
+    /// canPatternMatch - If it is impossible for this pattern to match on this
+    /// target, fill in Reason and return false.  Otherwise, return true.
     bool canPatternMatch(std::string &Reason, DAGISelEmitter &ISE);
   };
   






More information about the llvm-commits mailing list