llvm.org GIT mirror llvm / c81d2a0
Rename AddedCost to AddedComplexity. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27841 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 13 years ago
2 changed file(s) with 15 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
15041504 PatternsToMatch.
15051505 push_back(PatternToMatch(Instr->getValueAsListInit("Predicates"),
15061506 SrcPattern, DstPattern,
1507 Instr->getValueAsInt("AddedCost")));
1507 Instr->getValueAsInt("AddedComplexity")));
15081508 }
15091509 }
15101510
15811581 push_back(PatternToMatch(Patterns[i]->getValueAsListInit("Predicates"),
15821582 Pattern->getOnlyTree(),
15831583 Temp.getOnlyTree(),
1584 Patterns[i]->getValueAsInt("AddedCost")));
1584 Patterns[i]->getValueAsInt("AddedComplexity")));
15851585 }
15861586 }
15871587
18251825 PatternsToMatch.
18261826 push_back(PatternToMatch(PatternsToMatch[i].getPredicates(),
18271827 Variant, PatternsToMatch[i].getDstPattern(),
1828 PatternsToMatch[i].getAddedCost()));
1828 PatternsToMatch[i].getAddedComplexity()));
18291829 }
18301830
18311831 DEBUG(std::cerr << "\n");
19351935 PatternToMatch *RHS) {
19361936 unsigned LHSSize = getPatternSize(LHS->getSrcPattern(), ISE);
19371937 unsigned RHSSize = getPatternSize(RHS->getSrcPattern(), ISE);
1938 LHSSize += LHS->getAddedCost();
1939 RHSSize += RHS->getAddedCost();
1938 LHSSize += LHS->getAddedComplexity();
1939 RHSSize += RHS->getAddedComplexity();
19401940 if (LHSSize > RHSSize) return true; // LHS -> bigger -> less cost
19411941 if (LHSSize < RHSSize) return false;
19421942
29452945 OS << "\n" << std::string(Indent, ' ') << "// Emits: ";
29462946 Pattern.getDstPattern()->print(OS);
29472947 OS << "\n";
2948 unsigned AddedCost = Pattern.getAddedCost();
2948 unsigned AddedComplexity = Pattern.getAddedComplexity();
29492949 OS << std::string(Indent, ' ') << "// Pattern complexity = "
2950 << getPatternSize(Pattern.getSrcPattern(), *this) + AddedCost
2950 << getPatternSize(Pattern.getSrcPattern(), *this) + AddedComplexity
29512951 << " cost = "
29522952 << getResultPatternCost(Pattern.getDstPattern(), *this) << "\n";
29532953 }
29682968 OS << "\n" << std::string(Indent, ' ') << "// Emits: ";
29692969 Pattern.getDstPattern()->print(OS);
29702970 OS << "\n";
2971 unsigned AddedCost = Pattern.getAddedCost();
2971 unsigned AddedComplexity = Pattern.getAddedComplexity();
29722972 OS << std::string(Indent, ' ') << "// Pattern complexity = "
2973 << getPatternSize(Pattern.getSrcPattern(), *this) + AddedCost
2973 << getPatternSize(Pattern.getSrcPattern(), *this) + AddedComplexity
29742974 << " cost = "
29752975 << getResultPatternCost(Pattern.getDstPattern(), *this) << "\n";
29762976 }
394394 /// to produce isel.
395395 struct PatternToMatch {
396396 PatternToMatch(ListInit *preds,
397 TreePatternNode *src, TreePatternNode *dst, unsigned cost):
398 Predicates(preds), SrcPattern(src), DstPattern(dst), AddedCost(cost) {};
397 TreePatternNode *src, TreePatternNode *dst,
398 unsigned complexity):
399 Predicates(preds), SrcPattern(src), DstPattern(dst),
400 AddedComplexity(complexity) {};
399401
400402 ListInit *Predicates; // Top level predicate conditions to match.
401403 TreePatternNode *SrcPattern; // Source pattern to match.
402404 TreePatternNode *DstPattern; // Resulting pattern.
403 unsigned AddedCost; // Add to matching pattern complexity.
405 unsigned AddedComplexity; // Add to matching pattern complexity.
404406
405407 ListInit *getPredicates() const { return Predicates; }
406408 TreePatternNode *getSrcPattern() const { return SrcPattern; }
407409 TreePatternNode *getDstPattern() const { return DstPattern; }
408 unsigned getAddedCost() const { return AddedCost; }
410 unsigned getAddedComplexity() const { return AddedComplexity; }
409411 };
410412
411413 /// DAGISelEmitter - The top-level class which coordinates construction