Author: Evgeny Leviant Date: 2020-11-25T12:07:35+03:00 New Revision: d8f22c77699fe8483cdd80e0936d68875ead5838
URL: https://github.com/llvm/llvm-project/commit/d8f22c77699fe8483cdd80e0936d68875ead5838 DIFF: https://github.com/llvm/llvm-project/commit/d8f22c77699fe8483cdd80e0936d68875ead5838.diff LOG: [SchedModels] Return earlier removed checks It is possible that some write resource is variant in model A and sequence in model B. Such case will trigger assertion in getAllPredicates function. Added: Modified: llvm/utils/TableGen/CodeGenSchedule.cpp Removed: ################################################################################ diff --git a/llvm/utils/TableGen/CodeGenSchedule.cpp b/llvm/utils/TableGen/CodeGenSchedule.cpp index 030e16b744a88..abb2420188116 100644 --- a/llvm/utils/TableGen/CodeGenSchedule.cpp +++ b/llvm/utils/TableGen/CodeGenSchedule.cpp @@ -1456,7 +1456,9 @@ static std::vector<Record *> getAllPredicates(ArrayRef<TransVariant> Variants, ArrayRef<unsigned> ProcIndices) { std::vector<Record *> Preds; for (auto &Variant : Variants) { - assert(Variant.VarOrSeqDef->isSubClassOf("SchedVar")); + if (!Variant.VarOrSeqDef->isSubClassOf("SchedVar")) + continue; + if (ProcIndices[0] && Variant.ProcIdx) if (!llvm::count(ProcIndices, Variant.ProcIdx)) continue; @@ -1532,9 +1534,11 @@ void PredTransitions::getIntersectingVariants( " Ensure only one SchedAlias exists per RW."); } } - Record *PredDef = Variant.VarOrSeqDef->getValueAsDef("Predicate"); - if (mutuallyExclusive(PredDef, AllPreds, TransVec[TransIdx].PredTerm)) - continue; + if (Variant.VarOrSeqDef->isSubClassOf("SchedVar")) { + Record *PredDef = Variant.VarOrSeqDef->getValueAsDef("Predicate"); + if (mutuallyExclusive(PredDef, AllPreds, TransVec[TransIdx].PredTerm)) + continue; + } if (IntersectingVariants.empty()) { // The first variant builds on the existing transition. _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits