[llvm] r324028 - [GlobalISel][Legalizer] Relax a legalization loop detecting assert.

Amara Emerson via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 15:10:57 PST 2018


Author: aemerson
Date: Thu Feb  1 15:10:57 2018
New Revision: 324028

URL: http://llvm.org/viewvc/llvm-project?rev=324028&view=rev
Log:
[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.

Modified:
    llvm/trunk/lib/CodeGen/GlobalISel/LegalizerInfo.cpp

Modified: llvm/trunk/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/LegalizerInfo.cpp?rev=324028&r1=324027&r2=324028&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/LegalizerInfo.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/LegalizerInfo.cpp Thu Feb  1 15:10:57 2018
@@ -58,7 +58,9 @@ LegalizeActionStep LegalizeRuleSet::appl
       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




More information about the llvm-commits mailing list