[all-commits] [llvm/llvm-project] b72e13: [MLIR] Deduplicate dialect registration by ClassID

Geoffrey Martin-Noble via All-commits all-commits at lists.llvm.org
Wed Mar 18 19:56:35 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b72e13c242d9bbe1a4c7e471da98718bde85fa78
      https://github.com/llvm/llvm-project/commit/b72e13c242d9bbe1a4c7e471da98718bde85fa78
  Author: Geoffrey Martin-Noble <gcmn at google.com>
  Date:   2020-03-18 (Wed, 18 Mar 2020)

  Changed paths:
    M mlir/include/mlir/IR/Dialect.h
    M mlir/include/mlir/IR/DialectHooks.h
    M mlir/lib/IR/Dialect.cpp

  Log Message:
  -----------
  [MLIR] Deduplicate dialect registration by ClassID

Summary:
With the move towards dialect registration that does not depend only use
static initialization, we are running into more cases where the dialects
are registered by different methods. For example, TensorFlow still uses
static initialization to register all MLIR core dialects, which prevents
explicit registration of any of them when linking it in. We ran into this
issue in https://github.com/google/iree/pull/982.

To address potential issues with conflicts from non-standard
allocators passed to registerDialectAllocator, made this method
private. Now all dialects can only be registered with their
constructor.

Similarly deduplicates DialectHooks for consistency and makes their
registration follow the same pattern.

Differential Revision: https://reviews.llvm.org/D76329




More information about the All-commits mailing list