)]}'
{
  "commit": "96d959e01177e911ad3837e4799b530a7d931e16",
  "tree": "b182bfbe13c882d3e36ed5a2bccc214d7c82281c",
  "parents": [
    "1f3295a63837bb58c929cccd18f042708c21f68a"
  ],
  "author": {
    "name": "Stella Laurenzo",
    "email": "laurenzo@google.com",
    "time": "Sun Feb 19 11:58:14 2023 -0800"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Sun Feb 19 19:58:14 2023 +0000"
  },
  "message": "Add an option to disable use of bundled LLVM. (#12256)\n\n* Adds an option `IREE_BUILD_BUNDLED_LLVM` (default ON) which builds\r\nLLVM+tools from the in-repo submodule (`third_party/llvm-project`). When\r\ndisabled, CMake must be configured such that find_package for `LLVM`,\r\n`MLIR`, and `LLD` functions and are at commit levels appropriate.\r\n* Re-organizes the LLVM cmake setup to be better contained and\r\nnormalized vs in-tree/bundled and installed.\r\n* Switches MLIR sub-projects iree-dialects, mlir-hlo and torch-dialects\r\nto configure from the main IREE build so that they can be used on top of\r\na locally built or installed LLVM.\r\n* Updates mechanisms for locating lit so that it is consistent between\r\nthe two modes.\r\n* Moves the binary directory for `third_party/llvm-project/llvm` -\u003e\r\n`llvm-project`. This means that folks interacting with the bundled LLVM\r\nin the build directory will say things like `ninja llvm-project/all` or\r\n`./llvm-project/bin/mlir-opt`.\r\n* Moves the MLIR sub-projects from under\r\n`llvm-project/tools/{subproject}` -\u003e\r\n`llvm-external-projects/{subproject}` so that it is consistent between\r\nbundled and installed modes. Practically, this means that if invoking\r\n`iree-dialects-opt` from the command line, it is in a different place.\r\n* Fix to a transform dialect ODR issue which was latent and a namespace\r\nconflict with upstream. Not sure what triggered it but put it down to\r\nthe vagaries of linking.\r\n* Fix to the VMVX dependent dialects that came up when building IREE\r\nwith all backends disabled.\r\n\r\nWith this, I was able to install my own LLVM with these commands:\r\n\r\n```\r\ncd third_party/llvm-project\r\nmkdir build\r\ncd build\r\ncmake -G Ninja ../llvm \\\r\n   -DLLVM_ENABLE_PROJECTS\u003d\"mlir;lld\" \\\r\n   -DLLVM_BUILD_EXAMPLES\u003dOFF \\\r\n   -DLLVM_TARGETS_TO_BUILD\u003d\"\" \\\r\n   -DLLVM_INSTALL_UTILS\u003dON \\\r\n   -DCMAKE_BUILD_TYPE\u003dRelease \\\r\n   -DLLVM_ENABLE_ASSERTIONS\u003dON \\\r\n   -DCMAKE_C_COMPILER\u003dclang -DCMAKE_CXX_COMPILER\u003dclang++ -DLLVM_ENABLE_LLD\u003dON \\\r\n   -DLLVM_CCACHE_BUILD\u003dON\r\nninja\r\ncmake -DCMAKE_INSTALL_PREFIX\u003d$HOME/tmp/llvm -P cmake_install.cmake\r\n```\r\n\r\n```\r\ncmake -GNinja -B ../iree-build-inst/ -S . \\\r\n    -DIREE_TARGET_BACKEND_DEFAULTS\u003dOFF \\\r\n    -DIREE_HAL_DRIVER_DEFAULTS\u003dOFF \\\r\n    -DIREE_HAL_DRIVER_LOCAL_SYNC\u003dON \\\r\n    -DIREE_HAL_DRIVER_LOCAL_TASK\u003dON \\\r\n    -DIREE_BUILD_BUNDLED_LLVM\u003dOFF \\\r\n    -DLLVM_DIR\u003d$HOME/tmp/llvm/lib/cmake/llvm \\\r\n    -DMLIR_DIR\u003d$HOME/tmp/llvm/lib/cmake/mlir \\\r\n    -DLLD_DIR\u003d$HOME/tmp/llvm/lib/cmake/lld \\\r\n    -DCMAKE_BUILD_TYPE\u003dRelease\r\n```\r\n\r\n* Python builds have not yet been tested in the installed path and need\r\nsome ergonomic help.\r\n* Will follow-up with a script to build various configurations of\r\nLLVM/MLIR/LLD so that we can wire it up to CI.\r\n\r\nProgress on #12231",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "78107fb95d6de97e7feb223b260967053cb742bd",
      "old_mode": 33188,
      "old_path": "CMakeLists.txt",
      "new_id": "ea1f6008da68da0d00f349b49aa7037be7db2964",
      "new_mode": 33188,
      "new_path": "CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "641da4e3bf012312cdac073d556e494891b3a085",
      "old_mode": 33188,
      "old_path": "build_tools/cmake/iree_external_cmake_options.cmake",
      "new_id": "bc969c83111e08535a23fca0a0d5c406a334ef5a",
      "new_mode": 33188,
      "new_path": "build_tools/cmake/iree_external_cmake_options.cmake"
    },
    {
      "type": "modify",
      "old_id": "2d834707e6b791873e44cccfb21758f47743564d",
      "old_mode": 33188,
      "old_path": "build_tools/cmake/iree_lit_test.cmake",
      "new_id": "1cd6416fec6007e73f09d41eb95668057b1b92a7",
      "new_mode": 33188,
      "new_path": "build_tools/cmake/iree_lit_test.cmake"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "1e7ef7350948fad1764ec45a9e18801ee1bb79e4",
      "new_mode": 33188,
      "new_path": "build_tools/cmake/iree_llvm.cmake"
    },
    {
      "type": "modify",
      "old_id": "a117efa38c02598a89a49e7f84243c3b0f900ada",
      "old_mode": 33188,
      "old_path": "build_tools/third_party/mlir-hlo/CMakeLists.txt",
      "new_id": "a68af7ebb35fef5fb7e3d3a33c00290e7f833e2f",
      "new_mode": 33188,
      "new_path": "build_tools/third_party/mlir-hlo/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "d89e6d169f0790e93ff0c1c0b19fb17f4e3c6cdc",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Codegen/Common/TransformDialectInterpreterPass.cpp",
      "new_id": "39f86376fa81556c97c19c8496619d4ade96bed9",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Codegen/Common/TransformDialectInterpreterPass.cpp"
    },
    {
      "type": "modify",
      "old_id": "9f48d11ed0f5ee5257e1013027f1fc6ecc8cd492",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/Flow/Transforms/DispatchWithTransformDialect.cpp",
      "new_id": "93b8d7037fc118010a91303fb6e58912190b9ee4",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/Flow/Transforms/DispatchWithTransformDialect.cpp"
    },
    {
      "type": "modify",
      "old_id": "d84d26d5a22de1cb4f9d69a896eefd282dd37c5e",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/HAL/Target/LLVM/LinkerTool.cpp",
      "new_id": "aebda574108a6b9540ccc9f24586c44d70ef3458",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/HAL/Target/LLVM/LinkerTool.cpp"
    },
    {
      "type": "modify",
      "old_id": "fb9e904edfa10ae42ce8f6182b5c48133835ee14",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/HAL/Target/VMVX/BUILD",
      "new_id": "0d1effeef908d3ff27ba67d222cc3ccfdb1fb34a",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/HAL/Target/VMVX/BUILD"
    },
    {
      "type": "modify",
      "old_id": "c480bc211585863642070eba44061a196e5363cb",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/HAL/Target/VMVX/CMakeLists.txt",
      "new_id": "d60973b4e24b9bce2017e53f9bb7260b37ad3f84",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/HAL/Target/VMVX/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "d06f2af6b085faf2b46fd8440c65f74330d79fb5",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/HAL/Target/VMVX/VMVXTarget.cpp",
      "new_id": "031e7d4b80beecd9b4f2b73a82d0f93af89fe6ec",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/HAL/Target/VMVX/VMVXTarget.cpp"
    },
    {
      "type": "modify",
      "old_id": "777340757336253ade28fe003e69b8588996b24b",
      "old_mode": 33188,
      "old_path": "llvm-external-projects/iree-dialects/CMakeLists.txt",
      "new_id": "2d4d0db5f1a8b8bb79795325a4bd2c51f123db18",
      "new_mode": 33188,
      "new_path": "llvm-external-projects/iree-dialects/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "ec2365cad86fae082b11fe8142560524e6dade05",
      "old_mode": 33188,
      "old_path": "llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/LinalgTransform/TransformInterpreterPassBase.h",
      "new_id": "ae97eb44dd25fb1f2987f1ae162fa29c2b4efa12",
      "new_mode": 33188,
      "new_path": "llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/LinalgTransform/TransformInterpreterPassBase.h"
    },
    {
      "type": "modify",
      "old_id": "7d7d7a3638ad9a514325f5fbb00360ec2cfa7162",
      "old_mode": 33188,
      "old_path": "llvm-external-projects/iree-dialects/lib/Dialect/LinalgTransform/Passes/TransformInterpreter.cpp",
      "new_id": "33969d458bc6642f815290c4f8fe5a6c1bca5f5f",
      "new_mode": 33188,
      "new_path": "llvm-external-projects/iree-dialects/lib/Dialect/LinalgTransform/Passes/TransformInterpreter.cpp"
    },
    {
      "type": "modify",
      "old_id": "87d54578b3192b8ce1a510250ca83c26ad2df8e1",
      "old_mode": 33188,
      "old_path": "llvm-external-projects/iree-dialects/lib/Dialect/LinalgTransform/Passes/TransformInterpreterPassBase.cpp",
      "new_id": "53494a19550f0b089a8735378abd745b383ad822",
      "new_mode": 33188,
      "new_path": "llvm-external-projects/iree-dialects/lib/Dialect/LinalgTransform/Passes/TransformInterpreterPassBase.cpp"
    },
    {
      "type": "modify",
      "old_id": "802853bb6204540a165a2fa19cffc3b40010e3dc",
      "old_mode": 33188,
      "old_path": "llvm-external-projects/iree-dialects/test/lit.cfg.py",
      "new_id": "0a3fe29f3db38830746b7e6172d263bc87f631c1",
      "new_mode": 33188,
      "new_path": "llvm-external-projects/iree-dialects/test/lit.cfg.py"
    },
    {
      "type": "modify",
      "old_id": "9573f039f206842ed1f5a83d0b9daa7d36ac5cc9",
      "old_mode": 33188,
      "old_path": "llvm-external-projects/iree-dialects/test/lit.site.cfg.py.in",
      "new_id": "3f1cc111fb34ff9f20f73d672a5cf89a8e31373d",
      "new_mode": 33188,
      "new_path": "llvm-external-projects/iree-dialects/test/lit.site.cfg.py.in"
    },
    {
      "type": "modify",
      "old_id": "9b87ed523e570897038f6b00fd73041c8d875aa7",
      "old_mode": 33188,
      "old_path": "llvm-external-projects/iree-dialects/tools/iree-dialects-opt/CMakeLists.txt",
      "new_id": "65c0bf5b3af31077690ef2497efdcd2080cf21db",
      "new_mode": 33188,
      "new_path": "llvm-external-projects/iree-dialects/tools/iree-dialects-opt/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "de15dfdbf23ecb0e0604ead68b3428381355602f",
      "old_mode": 33261,
      "old_path": "runtime/src/iree/builtins/device/bin/build.sh",
      "new_id": "be9bc93e885ebd28785649fe41e513b692b4d680",
      "new_mode": 33261,
      "new_path": "runtime/src/iree/builtins/device/bin/build.sh"
    },
    {
      "type": "modify",
      "old_id": "944ec0b029ddbc409177f03b5071480c441101f4",
      "old_mode": 33261,
      "old_path": "runtime/src/iree/builtins/musl/bin/build.sh",
      "new_id": "af982d0906c33b6a31d934a03357ec9187905fdf",
      "new_mode": 33261,
      "new_path": "runtime/src/iree/builtins/musl/bin/build.sh"
    },
    {
      "type": "modify",
      "old_id": "b0a5f476625910551b8836494f5831efa892a1ee",
      "old_mode": 33188,
      "old_path": "third_party/torch-mlir-dialects/CMakeLists.txt",
      "new_id": "4fbad5f10cdff32eba5cc7a037bf919949fdede1",
      "new_mode": 33188,
      "new_path": "third_party/torch-mlir-dialects/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "8640bffd49ad20e0c0e0762d17de1fc5ecc20771",
      "old_mode": 33188,
      "old_path": "tools/CMakeLists.txt",
      "new_id": "007d9fd7819554a6006316ea587eb79d7ea996aa",
      "new_mode": 33188,
      "new_path": "tools/CMakeLists.txt"
    }
  ]
}
