[all-commits] [llvm/llvm-project] dd450f: [mlir][Interfaces][NFC] Move region loop detection...

Matthias Springer via All-commits all-commits at lists.llvm.org
Sun Jan 7 04:49:42 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dd450f08cfeb9da372cbe459058bc9ae9425f862
      https://github.com/llvm/llvm-project/commit/dd450f08cfeb9da372cbe459058bc9ae9425f862
  Author: Matthias Springer <me at m-sp.org>
  Date:   2024-01-07 (Sun, 07 Jan 2024)

  Changed paths:
    M mlir/include/mlir/Dialect/Bufferization/Transforms/BufferUtils.h
    M mlir/include/mlir/Interfaces/ControlFlowInterfaces.td
    M mlir/lib/Dialect/Bufferization/Transforms/BufferOptimizations.cpp
    M mlir/lib/Dialect/Bufferization/Transforms/BufferUtils.cpp
    M mlir/lib/Interfaces/ControlFlowInterfaces.cpp

  Log Message:
  -----------
  [mlir][Interfaces][NFC] Move region loop detection to `RegionBranchOpInterface` (#77090)

`BufferPlacementTransformationBase::isLoop` checks if there a loop in
the region branching graph of an operation. This algorithm is similar to
`isRegionReachable` in the `RegionBranchOpInterface`. To avoid duplicate
code, `isRegionReachable` is generalized, so that it can be used to
detect region loops. A helper function
`RegionBranchOpInterface::hasLoop` is added.

This change also turns a recursive implementation into an iterative one,
which is the preferred implementation strategy in LLVM.

Also move the `isLoop` to `BufferOptimizations.cpp`, so that we can
gradually retire `BufferPlacementTransformationBase`. (This is so that
proper error handling can be added to `BufferViewFlowAnalysis`.)




More information about the All-commits mailing list