Bazel build includes unused LLVM targets #16915
Labels
infrastructure
Relating to build systems, CI, or testing
quality of life 😊
Nice things are nice; let's have some
The upstream LLVM Bazel build has a list of LLVM targets that get unconditionally included in our builds: https://github.com/llvm/llvm-project/blob/009f88fc0e3a036be97ef7b222b90af342bae0b7/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel#L1857-L2189 . These dramatically inflate build times, as compiling these targets is one of the slowest parts of an LLVM source build.
I'm seeing those targets get built with
bazel build //tools:iree-opt
. Could run some queries to see how the targets are specifically getting pulled in.In our CMake build we conditionally enable targets based on configuration settings: https://github.com/openxla/iree/blob/d6357b4bbc55c9be36aa3bbe4c55f0fe1c2a010f/build_tools/cmake/iree_llvm.cmake#L128-L130
Bazel could either do the same with configs/selects, or it could at least be trimmed to just the set of targets that we use/support: https://github.com/openxla/iree/blob/d6357b4bbc55c9be36aa3bbe4c55f0fe1c2a010f/compiler/plugins/target/LLVMCPU/LLVMTargetOptions.cpp#L486-L494
The text was updated successfully, but these errors were encountered: