]> granicus.if.org Git - llvm/commitdiff
Fix selecting legal types in TypeInfer::getLegalTypes
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>
Fri, 15 Sep 2017 18:58:07 +0000 (18:58 +0000)
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>
Fri, 15 Sep 2017 18:58:07 +0000 (18:58 +0000)
Collect all legal types for all modes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313380 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/CodeGenDAGPatterns.cpp

index 4de4bca75c38844d2f2f809db9d7b07c26953d13..8c460d8420491da5b88412439a8b507889e5c34f 100644 (file)
@@ -804,20 +804,14 @@ void TypeInfer::expandOverloads(TypeSetByHwMode::SetType &Out,
   }
 }
 
-
 TypeSetByHwMode TypeInfer::getLegalTypes() {
   TypeSetByHwMode VTS;
   TypeSetByHwMode::SetType &DS = VTS.getOrCreate(DefaultMode);
   const TypeSetByHwMode &LTS = TP.getDAGPatterns().getLegalTypes();
 
-  if (!CodeGen) {
-    assert(LTS.hasDefault());
-    const TypeSetByHwMode::SetType &S = LTS.get(DefaultMode);
-    DS.insert(S.begin(), S.end());
-  } else {
-    for (const auto &I : LTS)
-      DS.insert(I.second.begin(), I.second.end());
-  }
+  // Stuff all types from all modes into the default mode.
+  for (const auto &I : LTS)
+    DS.insert(I.second.begin(), I.second.end());
   return VTS;
 }