[all-commits] [llvm/llvm-project] bc8de5: [mlir][IR] Add Iterator template option to IR walkers

Matthias Springer via All-commits all-commits at lists.llvm.org
Fri Feb 24 01:25:10 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bc8de519ea6d47a6d1602508eb24594493e9912e
      https://github.com/llvm/llvm-project/commit/bc8de519ea6d47a6d1602508eb24594493e9912e
  Author: Matthias Springer <me at m-sp.org>
  Date:   2023-02-24 (Fri, 24 Feb 2023)

  Changed paths:
    M mlir/include/mlir/IR/Block.h
    M mlir/include/mlir/IR/OpDefinition.h
    M mlir/include/mlir/IR/Operation.h
    M mlir/include/mlir/IR/Region.h
    M mlir/include/mlir/IR/Visitors.h
    M mlir/lib/IR/Visitors.cpp

  Log Message:
  -----------
  [mlir][IR] Add Iterator template option to IR walkers

This allows users to specify a  top-down or bottom-up traversal of the IR, in addition to the already existing WalkOrder.

Certain transformations work better with a forward traversal. E.g., when cloning a piece of IR, operations should be cloned top-down so that all uses are defined when creating an op.

Certain transformations work better with a reverse traversal. E.g., when erasing a piece of IR, operations should be erased bottom-up to avoid erasing operations that still have users.

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




More information about the All-commits mailing list