diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2014-08-01 00:32:36 +0000 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2014-08-01 00:32:36 +0000 |
commit | 6655dd699f6e473aef52779ca922a2f43b5f6022 (patch) | |
tree | 242684715b288bb0b9fb7605e88fc326d941f8e1 /llvm/utils/TableGen/CodeGenDAGPatterns.cpp | |
parent | 0e975cf6e51904d38bd0deb0ec13cc5b29481258 (diff) | |
download | bcm5719-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.cpp | 2 |
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(); } |