[mlir] Add a new context flag for disabling/enabling multi-threading
authorRiver Riddle <riddleriver@gmail.com>
Sat, 2 May 2020 19:28:57 +0000 (12:28 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Sat, 2 May 2020 19:32:25 +0000 (12:32 -0700)
commitcb9ae0025c4ed966a3a9b5539a9ff6b6e865516f
tree76d74bf5395ea5e8fab1209a150d3c58aa7c793f
parenta09a3c6d3e0fe76c4b7e6298f22f4dea2825f35a
[mlir] Add a new context flag for disabling/enabling multi-threading

This is useful for several reasons:
* In some situations the user can guarantee that thread-safety isn't necessary and don't want to pay the cost of synchronization, e.g., when parsing a very large module.

* For things like logging threading is not desirable as the output is not guaranteed to be in stable order.

This flag also subsumes the pass manager flag for multi-threading.

Differential Revision: https://reviews.llvm.org/D79266
15 files changed:
mlir/docs/PassManagement.md
mlir/include/mlir/IR/MLIRContext.h
mlir/include/mlir/Pass/PassManager.h
mlir/include/mlir/Support/StorageUniquer.h
mlir/lib/IR/MLIRContext.cpp
mlir/lib/Pass/IRPrinting.cpp
mlir/lib/Pass/Pass.cpp
mlir/lib/Pass/PassManagerOptions.cpp
mlir/lib/Support/StorageUniquer.cpp
mlir/lib/Transforms/Inliner.cpp
mlir/test/Dialect/SPIRV/availability.mlir
mlir/test/Dialect/SPIRV/target-env.mlir
mlir/test/IR/test-matchers.mlir
mlir/test/Pass/ir-printing.mlir
mlir/test/Pass/pass-timing.mlir