[Mlir-commits] [mlir] Reapply "[mlir] NFC: fix dependence of (Tensor|Linalg|MemRef|Complex) dialects on LLVM Dialect and LLVM Core in CMake build (#104832)" (PR #105703)
Christopher Bate
llvmlistbot at llvm.org
Wed Aug 28 14:19:36 PDT 2024
================
@@ -379,8 +378,8 @@ LogicalResult ForLowering::matchAndRewrite(ForOp forOp,
// llvm.loop_annotation attribute.
SmallVector<NamedAttribute> llvmAttrs;
llvm::copy_if(forOp->getAttrs(), std::back_inserter(llvmAttrs),
- [](auto attr) {
- return isa<LLVM::LLVMDialect>(attr.getValue().getDialect());
+ [](NamedAttribute attr) {
+ return attr.getValue().getDialect().getNamespace() == "llvm";
----------------
christopherbate wrote:
> Why is this needed? Can MLIRSCFToControlFlow depend on the LLVM dialect?
Well downstream users that don't use LLVM IR or LLVM MLIR Dialect may want to use this pass. If downstream users are sensitive to the build/binary cost then they will have to duplicate this pass to eliminate the dependency.
I guess it's not a huge deal to solve; we can expose the patterns as a separate function and have a callback to customize how attributes are propagated. The current behavior can remain the default and downstream user can then instantiate a different pass without the LLVM dependency.
https://github.com/llvm/llvm-project/pull/105703
More information about the Mlir-commits
mailing list