There are folks around here who are bazel experts (I am not one of them), but I think I can answer this.
iree, there are a few bazel workspaces involved. Which ones you can access are dependent on where you are running
If you are running bazel from the root of the tree, you are in the
iree_core workspace, and unqualified targets (i.e.
//iree/tools:iree-opt) reference targets in
@iree_core. From here, you can also reference LLVM and MHLO targets via the workspace aliases
If you are running bazel under the IREE
integrations/tensorflow directory, then the
@org_tensorflow workspace will also be mapped in and you access the main IREE code via the workspace alias
So if running bazel under
integrations/tensorflow, I believe the following would get you what you want, give or take typos:
bazel run @org_tensorflow//tensorflow/compiler/mlir:tf-opt
bazel run @llvm-project//mlir:mlir-opt
bazel at the root of the IREE repo, only the second one would work (since IREE’s core/root workspace does not depend on TensorFlow).
Unlike TensorFlow, we pin all of these deps to submodules in
third_party (versus having sources fetched opaquely by bazel) and then do Bazel shenanigans to link it all together into one workspace graph.
If in doubt, look at
BUILD files in the tree you are in and you will see fully qualified targets like the above. Those can also be used from the command line so long as you are in a a sub-directory that roots on the same
If doing TensorFlow centric work in IREE, work out of the
iree/tensorflow directory. Otherwise, work out of the project root (much smaller dependency graph).