[region-isolation] Add the ability for the analysis to emit "unknown error" partition ops in case we detect a case we cannot pattern match.

DISCUSSION: The analysis itself is unable to emit errors. So we achieve the same
functionality by in such cases emitting a partition op that signals to our user
that when they process that partition op they should emit an "unknown pattern"
error at the partition op's instructions.

I have wanted this for a long time, but I never got around to it.
This commit is contained in:
Michael Gottesman
2024-05-24 12:06:49 -07:00
parent 741244e16b
commit 1bef011e48
4 changed files with 56 additions and 0 deletions

View File

@@ -94,6 +94,10 @@ void PartitionOp::print(llvm::raw_ostream &os, bool extraSpace) const {
os << "%%" << opArgs[0];
break;
}
case PartitionOpKind::UnknownPatternError:
os << "unknown pattern error ";
os << "%%" << opArgs[0];
break;
}
os << ": " << *getSourceInst();
}