[mlir][PassManager] Only reinitialize the pass manager if the context registry changes
authorRiver Riddle <riddleriver@gmail.com>
Wed, 27 Jan 2021 00:54:25 +0000 (16:54 -0800)
committerRiver Riddle <riddleriver@gmail.com>
Thu, 28 Jan 2021 01:41:51 +0000 (17:41 -0800)
commit02bc4c95f0729cc819776f73ec94a25405579183
tree0dcf06cc93657a56ddadc6b81e4bf0486d55a72f
parentc3df9d58c75e0f89ca95e947804d65e79a491adc
[mlir][PassManager] Only reinitialize the pass manager if the context registry changes

This prevents needless reinitialization for clients that want to reuse a pass manager multiple times. A new `getRegisryHash` function is exposed by the context to give a rough indicator of when the context registry has changed.

Differential Revision: https://reviews.llvm.org/D95493
mlir/include/mlir/IR/MLIRContext.h
mlir/include/mlir/Pass/PassManager.h
mlir/lib/IR/MLIRContext.cpp
mlir/lib/Pass/Pass.cpp