[all-commits] [llvm/llvm-project] bd1ccf: [mlir] Add a new RewritePattern::hasBoundedRewrite...

River Riddle via All-commits all-commits at lists.llvm.org
Thu Apr 9 12:42:50 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: bd1ccfe6df24203c494685c82b83124303d99ce0
      https://github.com/llvm/llvm-project/commit/bd1ccfe6df24203c494685c82b83124303d99ce0
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-04-09 (Thu, 09 Apr 2020)

  Changed paths:
    M mlir/include/mlir/IR/PatternMatch.h
    M mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
    M mlir/lib/Transforms/DialectConversion.cpp
    M mlir/test/Transforms/test-legalizer.mlir
    M mlir/test/lib/Dialect/Test/TestOps.td
    M mlir/test/lib/Dialect/Test/TestPatterns.cpp

  Log Message:
  -----------
  [mlir] Add a new RewritePattern::hasBoundedRewriteRecursion hook.

Summary: Some pattern rewriters, like dialect conversion, prohibit the unbounded recursion(or reapplication) of patterns on generated IR. Most patterns are not written with recursive application in mind, so will generally explode the stack if uncaught. This revision adds a hook to RewritePattern, `hasBoundedRewriteRecursion`, to signal that the pattern can safely be applied to the generated IR of a previous application of the same pattern. This allows for establishing a contract between the pattern and rewriter that the pattern knows and can handle the potential recursive application.

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




More information about the All-commits mailing list