[Mlir-commits] [mlir] [MLIR] Add missing MLIRGPUDialect dep to MLIRSPIRVDialect (PR #84554)

Markus Böck llvmlistbot at llvm.org
Sun Mar 10 07:16:26 PDT 2024


zero9178 wrote:

> What does the failure look like? `ninja clean && ninja lib/libMLIRSPIRVDialect.a` does not reproduce at HEAD for me right now.

I can reproduce this using `ninja clean && rm .ninja_deps && ninja lib/libMLIRSPIRVDialect.a`. One needs to delete `.ninja_deps` as it contains/records header dependencies found by the C++ compiler on successful compiles. Unless you have a fresh cmake generation directory then ninja likely already recorded the dependency. 

The compiler error looks as follows:
```
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /usr/bin/clang++ -DGTEST_HAS_RTTI=0 -DMLIR_CUDA_CONVERSIONS_ENABLED=0 -DMLIR_ROCM_CONVERSIONS_ENABLED=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/markus/CLionProjects/llvm-project/llvm/cmake-build-debug-clang/tools/mlir/lib/Dialect/SPIRV/IR -I/home/markus/CLionProjects/llvm-project/mlir/lib/Dialect/SPIRV/IR -I/home/markus/CLionProjects/llvm-project/llvm/cmake-build-debug-clang/include -I/home/markus/CLionProjects/llvm-project/llvm/include -I/home/markus/CLionProjects/llvm-project/mlir/include -I/home/markus/CLionProjects/llvm-project/llvm/cmake-build-debug-clang/tools/mlir/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -Werror=mismatched-tags -Werror=global-constructors -g -std=c++17 -fcolor-diagnostics  -fno-exceptions -funwind-tables -fno-rtti -MD -MT tools/mlir/lib/Dialect/SPIRV/IR/CMakeFiles/obj.MLIRSPIRVDialect.dir/SPIRVDialect.cpp.o -MF tools/mlir/lib/Dialect/SPIRV/IR/CMakeFiles/obj.MLIRSPIRVDialect.dir/SPIRVDialect.cpp.o.d -o tools/mlir/lib/Dialect/SPIRV/IR/CMakeFiles/obj.MLIRSPIRVDialect.dir/SPIRVDialect.cpp.o -c /home/markus/CLionProjects/llvm-project/mlir/lib/Dialect/SPIRV/IR/SPIRVDialect.cpp
In file included from /home/markus/CLionProjects/llvm-project/mlir/lib/Dialect/SPIRV/IR/SPIRVDialect.cpp:17:
/home/markus/CLionProjects/llvm-project/mlir/include/mlir/Dialect/GPU/IR/CompilationInterfaces.h:120:10: fatal error: 'mlir/Dialect/GPU/IR/CompilationAttrInterfaces.h.inc' file not found
  120 | #include "mlir/Dialect/GPU/IR/CompilationAttrInterfaces.h.inc"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
```

The SPIR-V dialect doesn't technically depend on the GPU Dialect but rather the interface header being generated by TableGen for the purpose of registering the promise here: https://github.com/llvm/llvm-project/blob/3ec1f25f3cf9346590892397ec9ddd859397d363/mlir/lib/Dialect/SPIRV/IR/SPIRVDialect.cpp#L138

https://github.com/llvm/llvm-project/pull/84554


More information about the Mlir-commits mailing list