[all-commits] [llvm/llvm-project] 1ba5ea: [mlir] Add a hook for initializing passes before e...

River Riddle via All-commits all-commits at lists.llvm.org
Fri Jan 8 13:42:15 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 1ba5ea67a30170053964a28f2f47aea4bb7f5ff1
      https://github.com/llvm/llvm-project/commit/1ba5ea67a30170053964a28f2f47aea4bb7f5ff1
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2021-01-08 (Fri, 08 Jan 2021)

  Changed paths:
    M mlir/docs/PassManagement.md
    M mlir/include/mlir/Pass/Pass.h
    M mlir/include/mlir/Pass/PassManager.h
    M mlir/lib/Pass/Pass.cpp
    M mlir/lib/Pass/PassDetail.h
    M mlir/lib/Transforms/Canonicalizer.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list