summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2014-08-01 00:32:36 +0000
committerTom Stellard <thomas.stellard@amd.com>2014-08-01 00:32:36 +0000
commit6655dd699f6e473aef52779ca922a2f43b5f6022 (patch)
tree242684715b288bb0b9fb7605e88fc326d941f8e1 /llvm/utils/TableGen/CodeGenDAGPatterns.cpp
parent0e975cf6e51904d38bd0deb0ec13cc5b29481258 (diff)
downloadbcm5719-llvm-6655dd699f6e473aef52779ca922a2f43b5f6022.tar.gz
bcm5719-llvm-6655dd699f6e473aef52779ca922a2f43b5f6022.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. There will be test cases for this added to the R600 backend in a future commit. llvm-svn: 214466
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