[all-commits] [llvm/llvm-project] ba43d6: Revert "[GreedPatternRewriter] Preprocess constant...

Mehdi Amini via All-commits all-commits at lists.llvm.org
Thu Mar 31 23:20:55 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ba43d6f85c339d8d4e8e5759103cd7dfb4a3361f
      https://github.com/llvm/llvm-project/commit/ba43d6f85c339d8d4e8e5759103cd7dfb4a3361f
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2022-04-01 (Fri, 01 Apr 2022)

  Changed paths:
    M flang/test/Lower/host-associated.f90
    M mlir/include/mlir/Transforms/FoldUtils.h
    M mlir/lib/Transforms/Utils/FoldUtils.cpp
    M mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
    M mlir/test/Conversion/VectorToSCF/vector-to-scf.mlir
    M mlir/test/Dialect/Async/async-parallel-for-num-worker-threads.mlir
    M mlir/test/Dialect/Linalg/detensorize_if.mlir
    M mlir/test/Dialect/Linalg/transform-patterns.mlir
    M mlir/test/Dialect/SparseTensor/dense.mlir
    M mlir/test/Dialect/SparseTensor/sparse_scalars.mlir
    M mlir/test/Dialect/Tensor/bufferize.mlir
    M mlir/test/Dialect/Tensor/split-padding.mlir
    M mlir/test/Transforms/test-operation-folder.mlir

  Log Message:
  -----------
  Revert "[GreedPatternRewriter] Preprocess constants while building worklist when not processing top down"

This reverts commit 59bbc7a0851b6e0054bb3ed47df0958822f08880.

This exposes an issue breaking the contract of
`applyPatternsAndFoldGreedily` where we "converge" without applying
remaining patterns.


  Commit: 43f0d5f934b0f9200f8c661fe7350c71bcabe285
      https://github.com/llvm/llvm-project/commit/43f0d5f934b0f9200f8c661fe7350c71bcabe285
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2022-04-01 (Fri, 01 Apr 2022)

  Changed paths:
    A mlir/test/Transforms/test-operation-folder-commutative.mlir
    M mlir/test/lib/Dialect/Test/TestOps.td
    M mlir/test/lib/Dialect/Test/TestPatterns.cpp

  Log Message:
  -----------
  Add a test case for `applyPatternsAndFoldGreedily` to support the revert of 59bbc7a08

This shows that pushing constant to the right in a commutative op leads
to `applyPatternsAndFoldGreedily` to converge without applying all the
patterns.

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


Compare: https://github.com/llvm/llvm-project/compare/ac6878b330f3...43f0d5f934b0


More information about the All-commits mailing list