[all-commits] [llvm/llvm-project] 7691b6: [mlir][cmake] Don't add dependencies on mlir-(gene...

Jeff Niu via All-commits all-commits at lists.llvm.org
Fri Sep 2 12:14:06 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7691b69d5b2f5e9d8b210add22926335b3541444
      https://github.com/llvm/llvm-project/commit/7691b69d5b2f5e9d8b210add22926335b3541444
  Author: Jeff Niu <jeff at modular.com>
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
    M mlir/cmake/modules/AddMLIR.cmake
    M mlir/lib/Analysis/CMakeLists.txt
    M mlir/lib/Dialect/Transform/IR/CMakeLists.txt
    M mlir/lib/Pass/CMakeLists.txt
    M mlir/lib/Rewrite/CMakeLists.txt

  Log Message:
  -----------
  [mlir][cmake] Don't add dependencies on mlir-(generic-)headers

Every dialect was dependent on `mlir-headers`, which was causing the
build of any single MLIR dialect to pull in a bunch of extra
dependencies that aren't needed. Now, MLIR dialects will need to
explicitly depend on `MLIR*IncGen` targets to pull in any needed
headers.

This does not impact the actual `mlir-header` target.

Consider the "simple" Arithmetic dialect. Before:

```
% ninja MLIRArithmeticDialect
[151/812] Building CXX object lib/TableGen/CMakeFiles/LLVMTableGen.dir/JSONBackend.cpp.o
```

After:

```
% ninja MLIRArithmeticDialect
[207/374] Building CXX object tools/mlir/lib/TableGen/CMakeFiles/MLIRTableGen.dir/GenInfo.cpp.o
```

(Both clean builds)

Reviewed By: rriddle, jpienaar

Differential Revision: https://reviews.llvm.org/D133132




More information about the All-commits mailing list