[all-commits] [llvm/llvm-project] 7aabf4: [mlir][affine] Add pass --affine-raise-from-memref...

Clément Fournier via All-commits all-commits at lists.llvm.org
Tue May 6 00:17:18 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7aabf47522625e227433cc9603e0b6858c5dd66d
      https://github.com/llvm/llvm-project/commit/7aabf47522625e227433cc9603e0b6858c5dd66d
  Author: Clément Fournier <clement.fournier at tu-dresden.de>
  Date:   2025-05-06 (Tue, 06 May 2025)

  Changed paths:
    M mlir/include/mlir/Dialect/Affine/Passes.h
    M mlir/include/mlir/Dialect/Affine/Passes.td
    M mlir/lib/Dialect/Affine/IR/AffineOps.cpp
    M mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
    A mlir/lib/Dialect/Affine/Transforms/RaiseMemrefDialect.cpp
    A mlir/test/Dialect/Affine/raise-memref.mlir

  Log Message:
  -----------
  [mlir][affine] Add pass --affine-raise-from-memref (#138004)

This adds a pass that converts memref.load/store into affine.load/store.
This is useful as those memref operators are ignored by passes like
--affine-scalrep as they don't implement the
Affine[Read/Write]OpInterface. Doing this allows you to put as much of
your program in affine form before you apply affine optimization passes.

This also slightly changes the implementation of affine::isValidDim. The
previous implementation allowed values from the iter_args of affine
loops to be used as valid dims. I think this doesn't make sense and what
was meant is just the induction vars. In the real world, there is little
reason to find an index in the iter_args, but I wrote that in my tests
and found out it was treated as an affine dim, so corrected that.

Co-authored-by: Oleksandr "Alex" Zinenko <git at ozinenko.com>

Rebased from #114032.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list