1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Fix selecting legal types in TypeInfer::getLegalTypes

Collect all legal types for all modes.

llvm-svn: 313380
This commit is contained in:
Krzysztof Parzyszek 2017-09-15 18:58:07 +00:00
parent 36d48161a2
commit c3456b7968

View 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;
}