[all-commits] [llvm/llvm-project] 9b5ef2: [mlir][Interfaces] `LoopLikeOpInterface`: Support ...

Matthias Springer via All-commits all-commits at lists.llvm.org
Tue Sep 19 08:35:51 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9b5ef2bea8e3de8fd564ab74b8123b446883216f
      https://github.com/llvm/llvm-project/commit/9b5ef2bea8e3de8fd564ab74b8123b446883216f
  Author: Matthias Springer <me at m-sp.org>
  Date:   2023-09-19 (Tue, 19 Sep 2023)

  Changed paths:
    M flang/lib/Optimizer/Dialect/FIROps.cpp
    M mlir/include/mlir/Dialect/SCF/IR/SCFOps.td
    M mlir/include/mlir/Interfaces/LoopLikeInterface.td
    M mlir/include/mlir/Transforms/LoopInvariantCodeMotionUtils.h
    M mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRV.cpp
    M mlir/lib/Conversion/VectorToGPU/VectorToGPU.cpp
    M mlir/lib/Dialect/Affine/IR/AffineOps.cpp
    M mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp
    M mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp
    M mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp
    M mlir/lib/Dialect/Linalg/Transforms/Loops.cpp
    M mlir/lib/Dialect/Linalg/Transforms/SubsetHoisting.cpp
    M mlir/lib/Dialect/MemRef/Transforms/MultiBuffer.cpp
    M mlir/lib/Dialect/SCF/IR/SCF.cpp
    M mlir/lib/Dialect/SCF/IR/ValueBoundsOpInterfaceImpl.cpp
    M mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp
    M mlir/lib/Dialect/SCF/Transforms/StructuralTypeConversions.cpp
    M mlir/lib/Dialect/SCF/Utils/Utils.cpp
    M mlir/lib/Dialect/SparseTensor/Transforms/SparseGPUCodegen.cpp
    M mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
    M mlir/lib/Transforms/Utils/LoopInvariantCodeMotionUtils.cpp
    M mlir/test/Transforms/loop-invariant-code-motion.mlir
    M mlir/test/lib/Dialect/Test/TestOps.td

  Log Message:
  -----------
  [mlir][Interfaces] `LoopLikeOpInterface`: Support ops with multiple regions (#66754)

This commit implements `LoopLikeOpInterface` on `scf.while`. This
enables LICM (and potentially other transforms) on `scf.while`.

`LoopLikeOpInterface::getLoopBody()` is renamed to `getLoopRegions` and
can now return multiple regions.

Also fix a bug in the default implementation of
`LoopLikeOpInterface::isDefinedOutsideOfLoop()`, which returned "false"
for some values that are defined outside of the loop (in a nested op, in
such a way that the value does not dominate the loop). This interface is
currently only used for LICM and there is no way to trigger this bug, so
no test is added.




More information about the All-commits mailing list