[all-commits] [llvm/llvm-project] dcee18: [mlir] Add function for checking if a block is ins...

Tom Eccles via All-commits all-commits at lists.llvm.org
Thu Feb 9 07:22:02 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dcee187522c6e2e1a56ffc9b58bfe11c6ac44662
      https://github.com/llvm/llvm-project/commit/dcee187522c6e2e1a56ffc9b58bfe11c6ac44662
  Author: Tom Eccles <tom.eccles at arm.com>
  Date:   2023-02-09 (Thu, 09 Feb 2023)

  Changed paths:
    M mlir/include/mlir/Interfaces/LoopLikeInterface.td
    M mlir/lib/Interfaces/LoopLikeInterface.cpp
    A mlir/test/Interfaces/LoopLikeInterface/test-block-loop.mlir
    M mlir/test/lib/Interfaces/CMakeLists.txt
    A mlir/test/lib/Interfaces/LoopLikeInterface/CMakeLists.txt
    A mlir/test/lib/Interfaces/LoopLikeInterface/TestBlockInLoop.cpp
    M mlir/tools/mlir-opt/CMakeLists.txt
    M mlir/tools/mlir-opt/mlir-opt.cpp

  Log Message:
  -----------
  [mlir] Add function for checking if a block is inside a loop

This function returns whether a block is nested inside of a loop. There
can be three kinds of loop:
  1) The block is nested inside of a LoopLikeOpInterface
  2) The block is nested inside another block which is in a loop
  3) There is a cycle in the control flow graph

This will be useful for Flang's stack arrays pass, which moves array
allocations from the heap to the stack. Special handling is needed when
allocations occur inside of loops to ensure additional stack space is
not allocated on each loop iteration.

Differential Revision: https://reviews.llvm.org/D141401




More information about the All-commits mailing list