[GlobalISel][Legalizer] Relax a legalization loop detecting assert.

Legalizing vectors may keep the element type the same but change the number of
elements, the assert didn't take this into account.

llvm-svn: 324028
This commit is contained in:
Amara Emerson 2018-02-01 23:10:57 +00:00
parent f37c07c313
commit 4d19655a56

View File

@ -58,7 +58,9 @@ LegalizeActionStep LegalizeRuleSet::apply(const LegalityQuery &Query) const {
std::pair<unsigned, LLT> Mutation = Rule.determineMutation(Query);
DEBUG(dbgs() << ".. .. " << (unsigned)Rule.getAction() << ", "
<< Mutation.first << ", " << Mutation.second << "\n");
assert(Query.Types[Mutation.first] != Mutation.second &&
assert((Query.Types[Mutation.first] != Mutation.second ||
Rule.getAction() == MoreElements ||
Rule.getAction() == FewerElements) &&
"Simple loop detected");
return {Rule.getAction(), Mutation.first, Mutation.second};
} else