forked from OSchip/llvm-project
Revert a portion of r253836 that seems to have broke a couple bots.
llvm-svn: 253838
This commit is contained in:
parent
0194743fad
commit
2f70a7ef57
|
@ -3715,14 +3715,14 @@ void CodeGenDAGPatterns::GenerateVariants() {
|
||||||
// intentionally do not reconsider these. Any variants of added patterns have
|
// intentionally do not reconsider these. Any variants of added patterns have
|
||||||
// already been added.
|
// already been added.
|
||||||
//
|
//
|
||||||
for (PatternToMatch &PTM : PatternsToMatch) {
|
for (unsigned i = 0, e = PatternsToMatch.size(); i != e; ++i) {
|
||||||
MultipleUseVarSet DepVars;
|
MultipleUseVarSet DepVars;
|
||||||
std::vector<TreePatternNode*> Variants;
|
std::vector<TreePatternNode*> Variants;
|
||||||
FindDepVars(PTM.getSrcPattern(), DepVars);
|
FindDepVars(PatternsToMatch[i].getSrcPattern(), DepVars);
|
||||||
DEBUG(errs() << "Dependent/multiply used variables: ");
|
DEBUG(errs() << "Dependent/multiply used variables: ");
|
||||||
DEBUG(DumpDepVars(DepVars));
|
DEBUG(DumpDepVars(DepVars));
|
||||||
DEBUG(errs() << "\n");
|
DEBUG(errs() << "\n");
|
||||||
GenerateVariantsOf(PTM.getSrcPattern(), Variants, *this,
|
GenerateVariantsOf(PatternsToMatch[i].getSrcPattern(), Variants, *this,
|
||||||
DepVars);
|
DepVars);
|
||||||
|
|
||||||
assert(!Variants.empty() && "Must create at least original variant!");
|
assert(!Variants.empty() && "Must create at least original variant!");
|
||||||
|
@ -3732,7 +3732,7 @@ void CodeGenDAGPatterns::GenerateVariants() {
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
DEBUG(errs() << "FOUND VARIANTS OF: ";
|
DEBUG(errs() << "FOUND VARIANTS OF: ";
|
||||||
PTM.getSrcPattern()->dump();
|
PatternsToMatch[i].getSrcPattern()->dump();
|
||||||
errs() << "\n");
|
errs() << "\n");
|
||||||
|
|
||||||
for (unsigned v = 0, e = Variants.size(); v != e; ++v) {
|
for (unsigned v = 0, e = Variants.size(); v != e; ++v) {
|
||||||
|
@ -3744,12 +3744,14 @@ void CodeGenDAGPatterns::GenerateVariants() {
|
||||||
|
|
||||||
// Scan to see if an instruction or explicit pattern already matches this.
|
// Scan to see if an instruction or explicit pattern already matches this.
|
||||||
bool AlreadyExists = false;
|
bool AlreadyExists = false;
|
||||||
for (PatternToMatch &OtherPTM : PatternsToMatch) {
|
for (unsigned p = 0, e = PatternsToMatch.size(); p != e; ++p) {
|
||||||
// Skip if the top level predicates do not match.
|
// Skip if the top level predicates do not match.
|
||||||
if (PTM.getPredicates() != OtherPTM.getPredicates())
|
if (PatternsToMatch[i].getPredicates() !=
|
||||||
|
PatternsToMatch[p].getPredicates())
|
||||||
continue;
|
continue;
|
||||||
// Check to see if this variant already exists.
|
// Check to see if this variant already exists.
|
||||||
if (Variant->isIsomorphicTo(OtherPTM.getSrcPattern(), DepVars)) {
|
if (Variant->isIsomorphicTo(PatternsToMatch[p].getSrcPattern(),
|
||||||
|
DepVars)) {
|
||||||
DEBUG(errs() << " *** ALREADY EXISTS, ignoring variant.\n");
|
DEBUG(errs() << " *** ALREADY EXISTS, ignoring variant.\n");
|
||||||
AlreadyExists = true;
|
AlreadyExists = true;
|
||||||
break;
|
break;
|
||||||
|
@ -3759,10 +3761,11 @@ void CodeGenDAGPatterns::GenerateVariants() {
|
||||||
if (AlreadyExists) continue;
|
if (AlreadyExists) continue;
|
||||||
|
|
||||||
// Otherwise, add it to the list of patterns we have.
|
// Otherwise, add it to the list of patterns we have.
|
||||||
PatternsToMatch.emplace_back(PTM.getSrcRecord(), PTM.getPredicates(),
|
PatternsToMatch.emplace_back(
|
||||||
Variant, PTM.getDstPattern(),
|
PatternsToMatch[i].getSrcRecord(), PatternsToMatch[i].getPredicates(),
|
||||||
PTM.getDstRegs(), PTM.getAddedComplexity(),
|
Variant, PatternsToMatch[i].getDstPattern(),
|
||||||
Record::getNewUID());
|
PatternsToMatch[i].getDstRegs(),
|
||||||
|
PatternsToMatch[i].getAddedComplexity(), Record::getNewUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG(errs() << "\n");
|
DEBUG(errs() << "\n");
|
||||||
|
|
Loading…
Reference in New Issue