This module contains the MLIR (Multi-Level Intermediate Representation) dialects and utilities for
See MLIR's website for complete documentation.
Building dialects and utilities here follow the standard approach using bazel
as the rest of TensorFlow.
To develop across MLIR core and TensorFlow, it is useful to override the repo to use a local version instead of fetching from head. This can be achieved as below but note, the BUILD files are not automatically generated from or CMake used, so if your change requires a BUILD file change (or you are using a different version of LLVM than set in tensorflow/workspace.bzl's LLVM_COMMIT) then manual BUILD file changes may be required.
LLVM_SRC=... # Create basic workspace file echo 'workspace(name = "llvm-project")' > $LLVM_SRC/WORKSPACE # and copy over the bazel BUILD files. cp third_party/llvm/llvm.autogenerated.BUILD $LLVM_SRC/llvm/BUILD cp third_party/mlir/BUILD $LLVM_SRC/mlir cp third_party/mlir/test.BUILD $LLVM_SRC/mlir/test/BUILD bazel build --override_repository=llvm-project=$LLVM_SRC \ -c opt tensorflow/compiler/mlir:tf-opt