[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.
This commit is contained in:
Evgeny Leviant 2020-11-25 12:07:35 +03:00
parent 3d2c681f28
commit d8f22c7769
1 changed files with 8 additions and 4 deletions

View File

@ -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.