This is an archive of the discontinued LLVM Phabricator instance.

[mlir:Transforms] Move NormalizeMemRefs to MemRef/Transforms/
ClosedPublic

Authored by rriddle on Jan 20 2022, 3:16 PM.

Details

Summary

Transforms/ should only contain transformations that are dialect-independent and
this pass interacts with MemRef operations (making it a better fit for living in that
dialect).

Diff Detail

Event Timeline

rriddle created this revision.Jan 20 2022, 3:16 PM
rriddle requested review of this revision.Jan 20 2022, 3:16 PM
mehdi_amini accepted this revision.Jan 20 2022, 3:31 PM

Makes sense, thanks!

This revision is now accepted and ready to land.Jan 20 2022, 3:31 PM
bondhugula requested changes to this revision.EditedJan 20 2022, 7:27 PM
bondhugula added a subscriber: bondhugula.

This will make MLIRMemrefTransforms depend on MLIRAffine -- although the library already depends on it, that's a spurious one and can be removed. (I'll clean it up.) Looks like the test cases haven't been moved:

test/Transforms/normalize-memrefs-ops-dynamic.mlir:// RUN: mlir-opt -normalize-memrefs %s -split-input-file| FileCheck %s
test/Transforms/normalize-memrefs-ops.mlir:// RUN: mlir-opt -normalize-memrefs %s | FileCheck %s
test/Transforms/normalize-memrefs.mlir:// RUN: mlir-opt -normalize-memrefs -allow-unregistered-dialect %s | FileCheck %s

This pass should perhaps move to AffineTransforms or to a new directory meant for cross-dialect transformations where there isn't a natural layering relationship between the involved dialects. MemRefTransforms should not depend on Affine. NormalizeMemRefs creates affine.apply ops and so will depend on the Affine dialect.

This revision now requires changes to proceed.Jan 20 2022, 7:27 PM
bondhugula added a comment.EditedJan 20 2022, 7:55 PM

This will make MLIRMemrefTransforms depend on MLIRAffine -- although the library already depends on it, that's a spurious one and can be removed. (I'll clean it up.) Looks like the test cases haven't been moved:

test/Transforms/normalize-memrefs-ops-dynamic.mlir:// RUN: mlir-opt -normalize-memrefs %s -split-input-file| FileCheck %s
test/Transforms/normalize-memrefs-ops.mlir:// RUN: mlir-opt -normalize-memrefs %s | FileCheck %s
test/Transforms/normalize-memrefs.mlir:// RUN: mlir-opt -normalize-memrefs -allow-unregistered-dialect %s | FileCheck %s

This pass should perhaps move to AffineTransforms or to a new directory meant for cross-dialect transformations where there isn't a natural layering relationship between the involved dialects. MemRef should not depend on Affine. NormalizeMemRefs creates affine.apply ops and so will depend on the Affine dialect.

Looks like FoldSubViewOps.cpp and ResolveShapedTypeResultDims.cpp would depend on the Affine dialect - so this move should be fine.

bondhugula accepted this revision.Jan 20 2022, 8:22 PM
This revision is now accepted and ready to land.Jan 20 2022, 8:22 PM