[Mlir-commits] [mlir] [mlir] Reduce contention in parallel pass execution and timing (PR #232948)

Markus Böck llvmlistbot at llvm.org
Wed Oct 21 01:04:08 PDT 2026


================
@@ -1064,8 +1064,14 @@ PassInstrumentation instances may be registered directly with a
 Instrumentations added to the PassManager are run in a stack like fashion, i.e.
 the last instrumentation to execute a `runBefore*` hook will be the first to
 execute the respective `runAfter*` hook. The hooks of a `PassInstrumentation`
-class are guaranteed to be executed in a thread-safe fashion, so additional
-synchronization is not necessary. Below in an example instrumentation that
+class are serialized by default, so additional synchronization is not necessary.
+An instrumentation may override `isThreadSafe()` to return true if its callbacks
+support concurrent invocation on different threads. The instrumentor allows
+concurrent dispatch only when all registered instrumentations opt in; otherwise
+it preserves serialization of the entire callback sequence. Instrumentations
----------------
zero9178 wrote:

It might be worth mentioning here that corresponding `*Before*` and `*After*` callbacks are guaranteed to execute on the same thread 

https://github.com/llvm/llvm-project/pull/232948


More information about the Mlir-commits mailing list