aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/CodeGenDAGPatterns.h
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2014-07-21 13:28:54 +0000
committerTom Stellard <thomas.stellard@amd.com>2014-07-21 13:28:54 +0000
commitedf1570d4e300bb51f852da199a6fa8df141ad66 (patch)
tree467f17db0ee0530e73e313fd200e678ebc45b542 /llvm/utils/TableGen/CodeGenDAGPatterns.h
parent6f3382cd4450a658cb18ff60d84e2ffa9a0ef866 (diff)
downloadllvm-edf1570d4e300bb51f852da199a6fa8df141ad66.zip
llvm-edf1570d4e300bb51f852da199a6fa8df141ad66.tar.gz
llvm-edf1570d4e300bb51f852da199a6fa8df141ad66.tar.bz2
TableGen: Allow AddedComplexity values to be negative
This is useful for cases when stand-alone patterns are preferred to the patterns included in the instruction definitions. Instead of requiring that stand-alone patterns set a larger AddedComplexity value, which can be confusing to new developers, the allows us to reduce the complexity of the included patterns to achieve the same result. llvm-svn: 213521
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.h')
-rw-r--r--llvm/utils/TableGen/CodeGenDAGPatterns.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.h b/llvm/utils/TableGen/CodeGenDAGPatterns.h
index fb30cdd..ef6c787 100644
--- a/llvm/utils/TableGen/CodeGenDAGPatterns.h
+++ b/llvm/utils/TableGen/CodeGenDAGPatterns.h
@@ -667,7 +667,7 @@ public:
PatternToMatch(Record *srcrecord, ListInit *preds,
TreePatternNode *src, TreePatternNode *dst,
const std::vector<Record*> &dstregs,
- unsigned complexity, unsigned uid)
+ int complexity, unsigned uid)
: SrcRecord(srcrecord), Predicates(preds), SrcPattern(src), DstPattern(dst),
Dstregs(dstregs), AddedComplexity(complexity), ID(uid) {}
@@ -676,7 +676,7 @@ public:
TreePatternNode *SrcPattern; // Source pattern to match.
TreePatternNode *DstPattern; // Resulting pattern.
std::vector<Record*> Dstregs; // Physical register defs being matched.
- unsigned AddedComplexity; // Add to matching pattern complexity.
+ int AddedComplexity; // Add to matching pattern complexity.
unsigned ID; // Unique ID for the record.
Record *getSrcRecord() const { return SrcRecord; }
@@ -684,13 +684,13 @@ public:
TreePatternNode *getSrcPattern() const { return SrcPattern; }
TreePatternNode *getDstPattern() const { return DstPattern; }
const std::vector<Record*> &getDstRegs() const { return Dstregs; }
- unsigned getAddedComplexity() const { return AddedComplexity; }
+ int getAddedComplexity() const { return AddedComplexity; }
std::string getPredicateCheck() const;
/// Compute the complexity metric for the input pattern. This roughly
/// corresponds to the number of nodes that are covered.
- unsigned getPatternComplexity(const CodeGenDAGPatterns &CGP) const;
+ int getPatternComplexity(const CodeGenDAGPatterns &CGP) const;
};
class CodeGenDAGPatterns {