OSDN Git Service

[mlir] Add a hook for initializing passes before execution and use it in the Canonica...
authorRiver Riddle <riddleriver@gmail.com>
Fri, 8 Jan 2021 21:24:07 +0000 (13:24 -0800)
committerRiver Riddle <riddleriver@gmail.com>
Fri, 8 Jan 2021 21:36:12 +0000 (13:36 -0800)
commit1ba5ea67a30170053964a28f2f47aea4bb7f5ff1
treeeeb0a1d1c68ac65a9d47f56cc85dfbaeb67f650c
parentaa1943a2d167823e6d506895292477f79874dd20
[mlir] Add a hook for initializing passes before execution and use it in the Canonicalizer

This revision adds a new `initialize(MLIRContext *)` hook to passes that allows for them to initialize any heavy state before the first execution of the pass. A concrete use case of this is with patterns that rely on PDL, given that PDL is compiled at run time it is imperative that compilation results are cached as much as possible. The first use of this hook is in the Canonicalizer, which has the added benefit of reducing the number of expensive accesses to the context when collecting patterns.

Differential Revision: https://reviews.llvm.org/D93147
mlir/docs/PassManagement.md
mlir/include/mlir/Pass/Pass.h
mlir/include/mlir/Pass/PassManager.h
mlir/lib/Pass/Pass.cpp
mlir/lib/Pass/PassDetail.h
mlir/lib/Transforms/Canonicalizer.cpp