-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[mlir] Fix some cmake dependencies in LLVMIR Dialect #66956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
While looking into reducing needless interdependencies between upstream MLIR dialects and passes, I discovered that the ROCDL Dialect redundantely uses links in `VectorToLLVM` conversion pass when it actually requires just the LLVM Dialect. Furthermore, after a build failure, I ran `ninja -t missingdeps` which revealed that the NVVM Dialect depends on headers of the GPU dialect without stating so in CMake. This causes flaky builds as it is not guaranteed that the header exists prior to the dialect being compiled.
@llvm/pr-subscribers-mlir-llvm @llvm/pr-subscribers-mlir ChangesWhile looking into reducing needless interdependencies between upstream MLIR dialects and passes, I discovered that the ROCDL Dialect redundantely uses links in
This causes flaky builds as it is not guaranteed that the header exists prior to the dialect being compiled. Full diff: https://github.com/llvm/llvm-project/pull/66956.diff 1 Files Affected:
diff --git a/mlir/lib/Dialect/LLVMIR/CMakeLists.txt b/mlir/lib/Dialect/LLVMIR/CMakeLists.txt
index b5e6fbd4baf6ba7..b54a1e211d08c91 100644
--- a/mlir/lib/Dialect/LLVMIR/CMakeLists.txt
+++ b/mlir/lib/Dialect/LLVMIR/CMakeLists.txt
@@ -57,6 +57,7 @@ add_mlir_dialect_library(MLIRNVVMDialect
LINK_LIBS PUBLIC
MLIRIR
+ MLIRGPUDialect
MLIRLLVMDialect
MLIRSideEffectInterfaces
)
@@ -78,6 +79,6 @@ add_mlir_dialect_library(MLIRROCDLDialect
LINK_LIBS PUBLIC
MLIRIR
+ MLIRLLVMDialect
MLIRSideEffectInterfaces
- MLIRVectorToLLVM
)
|
Could you try changing the NVVM part to this:
NVVM & ROCDL don't require the full |
Done. I've also gone ahead and changed the "include"s in both files to only include the header for the compilation interface that is purely used for the promised interface as far as I can tell. |
Why is the dependency on the LLVM dialect needed? |
The ROCDL dialect uses the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right it's only needed for the promise, could you also remove #include "mlir/Dialect/GPU/IR/CompilationInterfaces.h"
from include/mlir/Dialect/LLVMIR/(NVVM|ROCDL)Dialect.h
so they don't inadvertently pollute other files. Thank you for catching these.
@joker-eph do you have any more concerns or is it okay to land? |
While looking into reducing needless interdependencies between upstream MLIR dialects and passes, I discovered that the ROCDL Dialect redundantely uses links in
VectorToLLVM
conversion pass when it actually requires just the LLVM Dialect. Furthermore, after a build failure, I ranninja -t missingdeps
which revealed that the NVVM Dialect depends on headers of the GPU dialect (llvm-project/mlir/include/mlir/Dialect/LLVMIR/NVVMDialect.h
Line 18 in 211c975
This causes flaky builds as it is not guaranteed that the header exists prior to the dialect being compiled.