[all-commits] [llvm/llvm-project] 225f11: [mlir] Partially revert removal of old `fold` method

zero9178 via All-commits all-commits at lists.llvm.org
Wed Feb 22 16:07:01 PST 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 225f11cff7fb1983cd849fbd253c459a804ce525
  Author: Markus Böck <markus.boeck02 at gmail.com>
  Date:   2023-02-23 (Thu, 23 Feb 2023)

  Changed paths:
    M mlir/include/mlir/IR/OpDefinition.h
    A mlir/test/IR/test-manual-cpp-fold.mlir
    M mlir/test/lib/Dialect/Test/TestDialect.cpp
    M mlir/test/lib/Dialect/Test/TestDialect.h

  Log Message:
  [mlir] Partially revert removal of old `fold` method

Mehdi noted in https://reviews.llvm.org/D144391 that given the low cost of keeping the old `fold` method signature working and the difficulty of writing a `FoldAdaptor` oneself, it'd be nice to keep the support for the sake of Ops written manually in C++.
This patch therefore partially reverts the removal of the old `fold` method by still allowing the old signature to be used. The active use of it is still discouraged and ODS will always generate the new method using `FoldAdaptor`s.

I'd also like to note that the previous ought to have broken some manually defined `fold` methods in-tree that are defined here: https://github.com/llvm/llvm-project/blob/23bcd6b86271f1c219a69183a5d90654faca64b8/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h#L245 It seems like these are not part of the regressions tests however...

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

More information about the All-commits mailing list