[all-commits] [llvm/llvm-project] 0c4eab: [MLIR] Make printing Value to a stream thread-safe...

Jacenty Andruszkiewicz via All-commits all-commits at lists.llvm.org
Thu Mar 12 02:38:18 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0c4eaba2f9d2dc94c153af16aec572c879cdc9ce
      https://github.com/llvm/llvm-project/commit/0c4eaba2f9d2dc94c153af16aec572c879cdc9ce
  Author: Jacenty Andruszkiewicz <jacenty.andruszkiewicz at intel.com>
  Date:   2026-03-12 (Thu, 12 Mar 2026)

  Changed paths:
    M mlir/include/mlir/IR/Value.h
    M mlir/lib/IR/AsmPrinter.cpp

  Log Message:
  -----------
  [MLIR] Make printing Value to a stream thread-safe (#185762)

Adjust `mlir::Value`'s `operator<<` and `dump()` function so that it can
be safely used with multithreading enabled.

Similar to `mlir::Operation` which uses `OpPrintingFlags` with
`localScope` enabled in printing methods.

Using `Value::print(raw_ostream &os)` creates default `OpPrintingFlags`
and with these flags print method is called on `getDefiningOp()`. With
`localScope` disabled by default, `findParent()` could go all the way up
to the `ModuleOp` which can be outside of the pass scope.

We had an instance of it in our project when multiple OperationPasses
were ran concurrently. Trying to print or dump `mlir::Value` in one of
the passes resulted in crash due to failed verifiers that got triggered
on parent op before the print.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list