Add a printer flag to use local scope when printing IR.
authorRiver Riddle <riverriddle@google.com>
Tue, 12 Nov 2019 17:36:40 +0000 (09:36 -0800)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Tue, 12 Nov 2019 17:37:11 +0000 (09:37 -0800)
commitc4a0883a9253336533dcaedc4b0f6201b6448666
tree932bb321a5ab5eb81c26d043c7f162e9ba4abdf0
parenta6fac0aa29a9bb9ca1b903599767e1b75aa951ad
Add a printer flag to use local scope when printing IR.

This causes the AsmPrinter to use a local value numbering when printing the IR, allowing for the printer to be used safely in a local context, e.g. to ensure thread-safety when printing the IR. This means that the IR printing instrumentation can also be used during multi-threading when module-scope is disabled. Operation::dump and DiagnosticArgument(Operation*) are also updated to always print local scope, as this is the most common use case when debugging.

PiperOrigin-RevId: 279988203
mlir/g3doc/WritingAPass.md
mlir/include/mlir/IR/OperationSupport.h
mlir/lib/IR/AsmPrinter.cpp
mlir/lib/IR/Diagnostics.cpp
mlir/lib/Pass/IRPrinting.cpp