Adds ConstantFoldHook registry in MLIRContext
authorFeng Liu <fengliuai@google.com>
Tue, 20 Nov 2018 22:47:10 +0000 (14:47 -0800)
committerjpienaar <jpienaar@google.com>
Fri, 29 Mar 2019 21:04:34 +0000 (14:04 -0700)
commita9d3e5ee3807683caa2e7b7c7a4dcc9497c0ecf4
treee7150db8358b28b922d628a4f02f70b6e8b18e4e
parent5041e13c9653a9e18662132cc71790d477f1ecf0
Adds ConstantFoldHook registry in MLIRContext

This reverts the previous method which needs to create a new dialect with the
constant fold hook from TensorFlow. This new method uses a function object in
dialect to store the constant fold hook. Once a hook is registered to the
dialect, this function object will be assigned when the dialect is added to the
MLIRContext.

For the operations which are not registered, a new method getRegisteredDialects
is added to the MLIRContext to query the dialects which matches their op name
prefixes.

PiperOrigin-RevId: 222310149
mlir/include/mlir/IR/Dialect.h
mlir/include/mlir/IR/MLIRContext.h
mlir/lib/IR/Dialect.cpp
mlir/lib/IR/MLIRContext.cpp
mlir/lib/IR/Operation.cpp