aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>2017-06-16 13:44:34 +0000
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>2017-06-16 13:44:34 +0000
commitf723776fc0a55e34301b405479715c8d9ddfd94b (patch)
tree71fb5c5851e5699cba5e37403a96c603121d4f2e /llvm/utils/TableGen/CodeGenDAGPatterns.cpp
parent3298027951cf546dcca3c598362e4d2050efaf6d (diff)
downloadllvm-f723776fc0a55e34301b405479715c8d9ddfd94b.zip
llvm-f723776fc0a55e34301b405479715c8d9ddfd94b.tar.gz
llvm-f723776fc0a55e34301b405479715c8d9ddfd94b.tar.bz2
[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
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.cpp')
-rw-r--r--llvm/utils/TableGen/CodeGenDAGPatterns.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
index 231a6ad..7c41d9f 100644
--- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
+++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
@@ -3808,9 +3808,7 @@ void CodeGenDAGPatterns::GenerateVariants() {
DepVars);
assert(!Variants.empty() && "Must create at least original variant!");
- Variants.erase(Variants.begin()); // Remove the original pattern.
-
- if (Variants.empty()) // No variants for this pattern.
+ if (Variants.size() == 1) // No additional variants for this pattern.
continue;
DEBUG(errs() << "FOUND VARIANTS OF: ";