[all-commits] [llvm/llvm-project] f2b94b: [mlir] check whether region and block visitors are...

Ashay Rane via All-commits all-commits at lists.llvm.org
Fri Jul 15 14:51:47 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f2b94bd7eaa83d853dc7568fac87b1f8bf4ddec6
      https://github.com/llvm/llvm-project/commit/f2b94bd7eaa83d853dc7568fac87b1f8bf4ddec6
  Author: Ashay Rane <ashay at users.noreply.github.com>
  Date:   2022-07-15 (Fri, 15 Jul 2022)

  Changed paths:
    M mlir/lib/IR/Visitors.cpp
    A mlir/test/IR/generic-block-visitors-interrupt.mlir
    A mlir/test/IR/generic-region-visitors-interrupt.mlir
    M mlir/test/lib/IR/TestVisitorsGeneric.cpp

  Log Message:
  -----------
  [mlir] check whether region and block visitors are interrupted

The visitor functions for `Region` and `Block` types did not always
check the value returned by recursive calls.  This caused the top-level
visitor invocation to return `WalkResult::advance()` even if one or more
recursive invocations returned `WalkResult::interrupt()`.  This patch
fixes the problem by check if any recursive call is interrupted, and if
so, return `WalkResult::interrupt()`.

Reviewed By: dcaballe

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




More information about the All-commits mailing list