diff --git a/mlir/include/mlir/Conversion/Passes.td b/mlir/include/mlir/Conversion/Passes.td --- a/mlir/include/mlir/Conversion/Passes.td +++ b/mlir/include/mlir/Conversion/Passes.td @@ -67,6 +67,7 @@ }]; let constructor = "mlir::createLowerAffinePass()"; let dependentDialects = [ + "memref::MemRefDialect", "scf::SCFDialect", "StandardOpsDialect", "vector::VectorDialect" diff --git a/mlir/test/Conversion/AffineToStandard/no-memref.mlir b/mlir/test/Conversion/AffineToStandard/no-memref.mlir new file mode 100644 --- /dev/null +++ b/mlir/test/Conversion/AffineToStandard/no-memref.mlir @@ -0,0 +1,11 @@ +// RUN: mlir-opt -lower-affine %s | FileCheck %s + +// Regression test checking that the memref dialect is loaded as dependency by +// the lowering pass. We shouldn't fail trying to create memref.load here. + +// CHECK-LABEL: @no_memref_op +func @no_memref_op(%arg0: memref) { + // CHECK: memref.load + affine.load %arg0[] : memref + return +}