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)