Rename AddedCost to AddedComplexity.
authorEvan Cheng <evan.cheng@apple.com>
Wed, 19 Apr 2006 20:36:09 +0000 (20:36 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Wed, 19 Apr 2006 20:36:09 +0000 (20:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27841 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/DAGISelEmitter.cpp
utils/TableGen/DAGISelEmitter.h

index 8d5186f2111df5ad4d8153d02bd54fd3d3bf176c..e7ee71564c50ce2ffac6eedf5c058050d414b394 100644 (file)
@@ -1505,7 +1505,7 @@ void DAGISelEmitter::ParseInstructions() {
     PatternsToMatch.
       push_back(PatternToMatch(Instr->getValueAsListInit("Predicates"),
                                SrcPattern, DstPattern,
-                               Instr->getValueAsInt("AddedCost")));
+                               Instr->getValueAsInt("AddedComplexity")));
   }
 }
 
@@ -1582,7 +1582,7 @@ void DAGISelEmitter::ParsePatterns() {
       push_back(PatternToMatch(Patterns[i]->getValueAsListInit("Predicates"),
                                Pattern->getOnlyTree(),
                                Temp.getOnlyTree(),
-                               Patterns[i]->getValueAsInt("AddedCost")));
+                               Patterns[i]->getValueAsInt("AddedComplexity")));
   }
 }
 
@@ -1826,7 +1826,7 @@ void DAGISelEmitter::GenerateVariants() {
       PatternsToMatch.
         push_back(PatternToMatch(PatternsToMatch[i].getPredicates(),
                                  Variant, PatternsToMatch[i].getDstPattern(),
-                                 PatternsToMatch[i].getAddedCost()));
+                                 PatternsToMatch[i].getAddedComplexity()));
     }
 
     DEBUG(std::cerr << "\n");
@@ -1936,8 +1936,8 @@ struct PatternSortingPredicate {
                   PatternToMatch *RHS) {
     unsigned LHSSize = getPatternSize(LHS->getSrcPattern(), ISE);
     unsigned RHSSize = getPatternSize(RHS->getSrcPattern(), ISE);
-    LHSSize += LHS->getAddedCost();
-    RHSSize += RHS->getAddedCost();
+    LHSSize += LHS->getAddedComplexity();
+    RHSSize += RHS->getAddedComplexity();
     if (LHSSize > RHSSize) return true;   // LHS -> bigger -> less cost
     if (LHSSize < RHSSize) return false;
     
@@ -2946,9 +2946,9 @@ void DAGISelEmitter::EmitPatterns(std::vector<std::pair<PatternToMatch*,
       OS << "\n" << std::string(Indent, ' ') << "// Emits: ";
       Pattern.getDstPattern()->print(OS);
       OS << "\n";
-      unsigned AddedCost = Pattern.getAddedCost();
+      unsigned AddedComplexity = Pattern.getAddedComplexity();
       OS << std::string(Indent, ' ') << "// Pattern complexity = "
-         << getPatternSize(Pattern.getSrcPattern(), *this) + AddedCost
+         << getPatternSize(Pattern.getSrcPattern(), *this) + AddedComplexity
          << "  cost = "
          << getResultPatternCost(Pattern.getDstPattern(), *this) << "\n";
     }
@@ -2969,9 +2969,9 @@ void DAGISelEmitter::EmitPatterns(std::vector<std::pair<PatternToMatch*,
       OS << "\n" << std::string(Indent, ' ') << "// Emits: ";
       Pattern.getDstPattern()->print(OS);
       OS << "\n";
-      unsigned AddedCost = Pattern.getAddedCost();
+      unsigned AddedComplexity = Pattern.getAddedComplexity();
       OS << std::string(Indent, ' ') << "// Pattern complexity = "
-         << getPatternSize(Pattern.getSrcPattern(), *this) + AddedCost
+         << getPatternSize(Pattern.getSrcPattern(), *this) + AddedComplexity
          << "  cost = "
          << getResultPatternCost(Pattern.getDstPattern(), *this) << "\n";
     }
index c0e984a527f5d616c2c0a351fc88c292af9d1a64..d30b8e35239042c99df5de441ee897bb34f4dd6f 100644 (file)
@@ -395,18 +395,20 @@ namespace llvm {
 /// to produce isel.
 struct PatternToMatch {
   PatternToMatch(ListInit *preds,
-                 TreePatternNode *src, TreePatternNode *dst, unsigned cost):
-    Predicates(preds), SrcPattern(src), DstPattern(dst), AddedCost(cost) {};
+                 TreePatternNode *src, TreePatternNode *dst,
+                 unsigned complexity):
+    Predicates(preds), SrcPattern(src), DstPattern(dst),
+    AddedComplexity(complexity) {};
 
   ListInit        *Predicates;  // Top level predicate conditions to match.
   TreePatternNode *SrcPattern;  // Source pattern to match.
   TreePatternNode *DstPattern;  // Resulting pattern.
-  unsigned         AddedCost;   // Add to matching pattern complexity.
+  unsigned         AddedComplexity; // Add to matching pattern complexity.
 
   ListInit        *getPredicates() const { return Predicates; }
   TreePatternNode *getSrcPattern() const { return SrcPattern; }
   TreePatternNode *getDstPattern() const { return DstPattern; }
-  unsigned         getAddedCost()  const { return AddedCost;  }
+  unsigned         getAddedComplexity() const { return AddedComplexity; }
 };
 
 /// DAGISelEmitter - The top-level class which coordinates construction