This change adds allErased to the applyOpPatternsAndFold(ArrayRef<Operation *>, ...) overload. This overload now supports all functionality that is also supported by applyOpPatternsAndFold(Operation *, ...) and can be used as a replacement.
This change has no performance implications when allErased = nullptr.
The single-operation overload is removed in a subsequent NFC change.
Depends On: D141904
Since an operation can be erased once, we should be able to use a vector here?
I guess the issue is that vector does not help later if the intent is checking if an op has been erased.
That said this all seems a bit "expensive" overall here, and I'm not sure that the extra bool *allOpsErased justified this (in itself it seems already like a bit "ad-hoc" in the API).