[TableGen] Do not assume that the first variant is the original pattern

The variant generation for commutative/associative patterns would simply
delete the first output from the list assuming that it was identical to
the original pattern. This does not have to be the case, and a legitimate
variant could actually be removed that way. 

llvm-svn: 305556
This commit is contained in:
Krzysztof Parzyszek 2017-06-16 13:44:34 +00:00
parent 3298027951
commit f723776fc0
1 changed files with 1 additions and 3 deletions

View File

@ -3808,9 +3808,7 @@ void CodeGenDAGPatterns::GenerateVariants() {
DepVars); DepVars);
assert(!Variants.empty() && "Must create at least original variant!"); assert(!Variants.empty() && "Must create at least original variant!");
Variants.erase(Variants.begin()); // Remove the original pattern. if (Variants.size() == 1) // No additional variants for this pattern.
if (Variants.empty()) // No variants for this pattern.
continue; continue;
DEBUG(errs() << "FOUND VARIANTS OF: "; DEBUG(errs() << "FOUND VARIANTS OF: ";