summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-01 22:09:11 +0000
committerChris Lattner <sabre@nondot.org>2010-03-01 22:09:11 +0000
commitd39f75ba392bd1886886274a392db9b36ca54c04 (patch)
tree3de8d33c1d3bf8b6be2729ba168106fefcc046d3 /llvm/utils/TableGen/CodeGenDAGPatterns.cpp
parent664ac989ffe9358365d5d761df7800ac570cc08c (diff)
downloadbcm5719-llvm-d39f75ba392bd1886886274a392db9b36ca54c04.tar.gz
bcm5719-llvm-d39f75ba392bd1886886274a392db9b36ca54c04.zip
Fix PR2590 by making PatternSortingPredicate actually be
ordered correctly. Previously it would get in trouble when two patterns were too similar and give them nondet ordering. We force this by using the record ID order as a fallback. The testsuite diff is due to alpha patterns being ordered slightly differently, the change is a semantic noop afaict: < lda $0,-100($16) --- > subq $16,100,$0 llvm-svn: 97509
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.cpp')
-rw-r--r--llvm/utils/TableGen/CodeGenDAGPatterns.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
index 8f4788f872d..db90031709c 100644
--- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
+++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
@@ -2110,7 +2110,8 @@ void CodeGenDAGPatterns::ParseInstructions() {
SrcPattern,
TheInst.getResultPattern(),
TheInst.getImpResults(),
- Instr->getValueAsInt("AddedComplexity")));
+ Instr->getValueAsInt("AddedComplexity"),
+ Instr->getID()));
}
}
@@ -2320,7 +2321,8 @@ void CodeGenDAGPatterns::ParsePatterns() {
PatternToMatch(Patterns[i]->getValueAsListInit("Predicates"),
Pattern->getTree(0),
Temp.getOnlyTree(), InstImpResults,
- Patterns[i]->getValueAsInt("AddedComplexity")));
+ Patterns[i]->getValueAsInt("AddedComplexity"),
+ Patterns[i]->getID()));
}
}
@@ -2614,7 +2616,8 @@ void CodeGenDAGPatterns::GenerateVariants() {
push_back(PatternToMatch(PatternsToMatch[i].getPredicates(),
Variant, PatternsToMatch[i].getDstPattern(),
PatternsToMatch[i].getDstRegs(),
- PatternsToMatch[i].getAddedComplexity()));
+ PatternsToMatch[i].getAddedComplexity(),
+ Record::getNewUID()));
}
DEBUG(errs() << "\n");
OpenPOWER on IntegriCloud