From c3456b796869b9eeff2f3f4fd9dd28fa44959c89 Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Fri, 15 Sep 2017 18:58:07 +0000 Subject: [PATCH] Fix selecting legal types in TypeInfer::getLegalTypes Collect all legal types for all modes. llvm-svn: 313380 --- utils/TableGen/CodeGenDAGPatterns.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/utils/TableGen/CodeGenDAGPatterns.cpp b/utils/TableGen/CodeGenDAGPatterns.cpp index 4de4bca75c3..8c460d84204 100644 --- a/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/utils/TableGen/CodeGenDAGPatterns.cpp @@ -804,20 +804,14 @@ void TypeInfer::expandOverloads(TypeSetByHwMode::SetType &Out, } } - TypeSetByHwMode TypeInfer::getLegalTypes() { TypeSetByHwMode VTS; TypeSetByHwMode::SetType &DS = VTS.getOrCreate(DefaultMode); const TypeSetByHwMode <S = 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; }