summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
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.cpp
parent6f3382cd4450a658cb18ff60d84e2ffa9a0ef866 (diff)
downloadbcm5719-llvm-edf1570d4e300bb51f852da199a6fa8df141ad66.tar.gz
bcm5719-llvm-edf1570d4e300bb51f852da199a6fa8df141ad66.zip
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.cpp')
-rw-r--r--llvm/utils/TableGen/CodeGenDAGPatterns.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
index 2602bbcf6f6..d195ba823b5 100644
--- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
+++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
@@ -771,7 +771,7 @@ static unsigned getPatternSize(const TreePatternNode *P,
/// Compute the complexity metric for the input pattern. This roughly
/// corresponds to the number of nodes that are covered.
-unsigned PatternToMatch::
+int PatternToMatch::
getPatternComplexity(const CodeGenDAGPatterns &CGP) const {
return getPatternSize(getSrcPattern(), CGP) + getAddedComplexity();
}
OpenPOWER on IntegriCloud