[Verifier] Significantly speed up IsolatedFromAbove checking. NFC.
authorChris Lattner <clattner@nondot.org>
Fri, 28 May 2021 22:12:44 +0000 (15:12 -0700)
committerChris Lattner <clattner@nondot.org>
Fri, 28 May 2021 23:13:45 +0000 (16:13 -0700)
commitbde21b624585255dbd28c0bc0e93d37045b5a9a9
treebc75beb8de80273b604f74d9286c60ca8154b8e9
parent577fea4e1a13319adf2b660f57bf570195a7f78d
[Verifier] Significantly speed up IsolatedFromAbove checking. NFC.

The implementation had a couple of problems, including checking
"isProperAncestor" in an inefficient way.  It also recursed into
other "isolated from above" ops.  In the case of CIRCT, we get
three levels of isolated ops:

  mlir::ModuleOp
    firrtl::CircuitOp
       firrtl::FModuleOp

The verification for module would recurse into the circuits and
fmodules checking them.  The verifier hook for circuit would
recurse into all the modules reverifying them, fmoduleop would
then reverify them.  The same happens for mlir::ModuleOp and Func.

While here, fix an old design problem: IsolatedFromAbove checking
was implemented by a method on the Region class, which isn't
actually general and isn't used by anything else.  Move it over
to be a trait impl verifier method like the others and specialize
it for its task.

Differential Revision: https://reviews.llvm.org/D103345
mlir/include/mlir/IR/OpDefinition.h
mlir/include/mlir/IR/Region.h
mlir/lib/IR/Operation.cpp
mlir/lib/IR/Region.cpp