1
0
mirror of https://github.com/RPCS3/llvm.git synced 2025-03-04 16:47:41 +00:00

Fix selecting legal types in TypeInfer::getLegalTypes

Collect all legal types for all modes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313380 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Krzysztof Parzyszek 2017-09-15 18:58:07 +00:00
parent 126ab47270
commit 22b2c0d9c2

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