Skip to content

[mlir][func] Remove func-bufferize pass #114152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

matthias-springer
Copy link
Member

The dialect conversion-based bufferization passes have been migrated to One-Shot Bufferize about two years ago. To clean up the code base, this commit removes the func-bufferize pass, one of the few remaining parts of the old infrastructure. Most bufferization passes have already been removed.

Note for LLVM integration: If you depend on this pass, migrate to One-Shot Bufferize or copy the pass to your codebase.

Depends on #114017.

@llvmbot
Copy link
Member

llvmbot commented Oct 29, 2024

@llvm/pr-subscribers-mlir

Author: Matthias Springer (matthias-springer)

Changes

The dialect conversion-based bufferization passes have been migrated to One-Shot Bufferize about two years ago. To clean up the code base, this commit removes the func-bufferize pass, one of the few remaining parts of the old infrastructure. Most bufferization passes have already been removed.

Note for LLVM integration: If you depend on this pass, migrate to One-Shot Bufferize or copy the pass to your codebase.

Depends on #114017.


Patch is 26.80 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/114152.diff

8 Files Affected:

  • (modified) mlir/docs/Bufferization.md (+2-268)
  • (modified) mlir/include/mlir/Dialect/Func/Transforms/Passes.h (-3)
  • (modified) mlir/include/mlir/Dialect/Func/Transforms/Passes.td (-29)
  • (modified) mlir/lib/Dialect/Func/Transforms/CMakeLists.txt (-3)
  • (removed) mlir/lib/Dialect/Func/Transforms/FuncBufferize.cpp (-71)
  • (removed) mlir/test/Dialect/Func/func-bufferize.mlir (-83)
  • (modified) mlir/test/Dialect/Transform/test-pass-application.mlir (+2-2)
  • (modified) mlir/test/Integration/Dialect/MemRef/verify-memref.mlir (+1-1)
diff --git a/mlir/docs/Bufferization.md b/mlir/docs/Bufferization.md
index 7d38ebb38535c7..e16fe91212a1a5 100644
--- a/mlir/docs/Bufferization.md
+++ b/mlir/docs/Bufferization.md
@@ -23,11 +23,6 @@ the resulting `memref` IR has no memory leaks.
 
 ## Deprecated Passes
 
-The old dialect conversion-based bufferization passes have been deprecated and
-should not be used anymore. Most of those passes have already been removed from
-MLIR. One-Shot Bufferize produces in better bufferization results with fewer
-memory allocations and buffer copies.
-
 The buffer deallocation pass has been deprecated in favor of the ownership-based
 buffer deallocation pipeline. The deprecated pass has some limitations that may
 cause memory leaks in the resulting IR.
@@ -276,18 +271,13 @@ semantics (i.e., tensor result or tensor operand) that is not bufferizable
 `to_memref`/`to_tensor` ops around the bufferization boundary.
 
 One-Shot Bufferize can be configured to bufferize only ops from a set of
-dialects with `dialect-filter`. This can be useful for gradually migrating from
-dialect conversion-based bufferization to One-Shot Bufferize. One-Shot Bufferize
-must run first in such a case, because dialect conversion-based bufferization
-generates `to_tensor` ops without the `restrict` unit attribute, which One-Shot
-Bufferize cannot analyze.
+dialects with `dialect-filter`.
 
 One-Shot Bufferize can also be called programmatically with
 [`bufferization::runOneShotBufferize`](https://github.com/llvm/llvm-project/blob/ae2764e835a26bad9774803eca0a6530df2a3e2d/mlir/include/mlir/Dialect/Bufferization/Transforms/OneShotAnalysis.h#L167).
 Alternatively,
 [`bufferization::bufferizeOp`](https://github.com/llvm/llvm-project/blob/ae2764e835a26bad9774803eca0a6530df2a3e2d/mlir/include/mlir/Dialect/Bufferization/Transforms/Bufferize.h#L78)
-skips the analysis and inserts a copy on every buffer write, just like the
-dialect conversion-based bufferization.
+skips the analysis and inserts a copy on every buffer write.
 
 By default, function boundaries are not bufferized. This is because there are
 currently limitations around function graph bufferization: recursive
@@ -484,259 +474,3 @@ conflict detection algorithm, interested users may want to refer to:
 * [Original design document](https://discourse.llvm.org/uploads/short-url/5kckJ3DftYwQokG252teFgw3sYa.pdf)
 * [ODM talk](https://youtu.be/TXEo59CYS9A), ([slides](https://mlir.llvm.org/OpenMeetings/2022-01-13-One-Shot-Bufferization.pdf)).
 * [LLVM Dev Meeting 2023 tutorial slides](https://m-sp.org/downloads/llvm_dev_2023.pdf)
-
-## Migrating from Dialect Conversion-based Bufferization
-
-Both dialect conversion-based bufferization and One-Shot Bufferize generate
-`to_tensor`/`to_memref` ops at the bufferization boundary (when run with
-`allow-unknown-ops`). They can be combined and run in sequence. However,
-One-Shot Bufferize must run first because it cannot analyze those boundary ops.
-To update existing code step-by-step, it may be useful to specify a dialect
-filter for One-Shot Bufferize, so that dialects can be switched over one-by-one.
-
-## Dialect Conversion-based Bufferization
-
-Disclaimer: Most dialect conversion-based bufferization has been migrated to
-One-Shot Bufferize. New users should use One-Shot Bufferize (with or without
-analysis). The following documentation is only for existing users of dialect
-conversion-based bufferization.
-
-This system is a simple application of MLIR's dialect conversion infrastructure.
-The bulk of the code related to bufferization is a set of ordinary
-`ConversionPattern`'s that dialect authors write for converting ops that operate
-on `tensor`'s to ops that operate on `memref`'s. A set of conventions and best
-practices are followed that allow these patterns to be run across multiple
-independent passes (rather than requiring a single huge atomic conversion pass),
-which makes the compilation pipelines scalable, robust, and easy to debug.
-
-This document is targeted at people looking to utilize MLIR's bufferization
-functionality, along with people who want to extend it to cover their own ops.
-
-<a name="the-talk">**NOTE:**</a> Before reading this document, please watch the
-talk "Type Conversions the Not-So-Hard-Way: MLIR's New Bufferization
-Infrastructure"
-([slides](https://drive.google.com/file/d/1FVbzCXxZzS9LBLuvpPNLWJD-XDkt54ky/view?usp=sharing),
-[recording](https://drive.google.com/file/d/1VfVajitgf8ZPnd-HRkJvaJiFLhBsluXN/view?usp=sharing)).
-That talk gives a high-level overview of the bufferization infrastructure and
-important conceptual details related to using the MLIR dialect conversion
-infrastructure.
-
-### Bufferization's place in a compilation pipeline
-
-Bufferization itself does not free any of the buffers that have been allocated,
-nor does it do anything particularly intelligent with the placement of buffers
-w.r.t. control flow. Thus, a realistic compilation pipeline will usually consist
-of:
-
-1.  Bufferization
-1.  Buffer optimizations such as `buffer-hoisting`, `buffer-loop-hoisting`, and
-    `promote-buffers-to-stack`, which do optimizations that are only exposed
-    after bufferization.
-1.  Finally, running the [ownership-based buffer deallocation](OwnershipBasedBufferDeallocation.md)
-    pass.
-
-After buffer deallocation has been completed, the program will be quite
-difficult to transform due to the presence of the deallocation ops. Thus, other
-optimizations such as linalg fusion on memrefs should be done before that stage.
-
-### General structure of the bufferization process
-
-Bufferization consists of running multiple *partial* bufferization passes,
-followed by one *finalizing* bufferization pass.
-
-There is typically one partial bufferization pass per dialect (though other
-subdivisions are possible). For example, for a dialect `X` there will typically
-be a pass `X-bufferize` that knows how to bufferize all the ops in that dialect.
-By running pass `X-bufferize` for each dialect `X` in the program, all the ops
-in the program are incrementally bufferized.
-
-Partial bufferization passes create programs where only some ops have been
-bufferized. These passes will create *materializations* (also sometimes called
-"casts") that convert between the `tensor` and `memref` type, which allows
-bridging between ops that have been bufferized and ops that have not yet been
-bufferized.
-
-Finalizing bufferizations complete the bufferization process, and guarantee that
-there are no tensors remaining in the program. This involves eliminating the
-materializations. The pass `finalizing-bufferize` provides a minimal pass that
-only eliminates materializations and issues an error if any unbufferized ops
-exist in the program.
-
-However, it is possible for a finalizing bufferization to do more than just
-eliminate materializations. By adding patterns (just as a partial bufferization
-would), it is possible for a finalizing bufferization pass to simultaneously
-bufferize ops and eliminate materializations. This has a number of disadvantages
-discussed in the talk and should generally be avoided.
-
-### Example
-
-As a concrete example, we will look at the bufferization pipeline from the
-`mlir-npcomp` reference backend
-([code](https://github.com/llvm/mlir-npcomp/blob/97d6d04d41216e73d40b89ffd79620973fc14ce3/lib/RefBackend/RefBackend.cpp#L232)).
-The code, slightly simplified and annotated, is reproduced here:
-
-```c++
-  // Partial bufferization passes.
-  pm.addPass(createTensorConstantBufferizePass());
-  pm.addNestedPass<func::FuncOp>(createTCPBufferizePass()); // Bufferizes the downstream `tcp` dialect.
-  pm.addNestedPass<func::FuncOp>(createLinalgBufferizePass());
-  pm.addNestedPass<func::FuncOp>(createTensorBufferizePass());
-  pm.addPass(createFuncBufferizePass());
-
-  // Finalizing bufferization pass.
-  pm.addNestedPass<func::FuncOp>(createFinalizingBufferizePass());
-```
-
-Looking first at the partial bufferization passes, we see that there are a
-sequence of `FuncOp` passes (which run in parallel on functions). These function
-passes are bracketed by `arith-bufferize` and `func-bufferize`, which are module
-passes (and thus serialize the parallel compilation process). These two passes
-must be module passes because they make changes to the top-level module.
-
-The bulk of the bufferization work is done by the function passes. Most of these
-passes are provided as part of the upstream MLIR distribution and bufferize
-their respective dialects (e.g. `abc-bufferize` bufferizes the `abc` dialect).
-The `tcp-bufferize` pass is an exception -- it is a partial bufferization pass
-used to bufferize the downstream `tcp` dialect, and fits in perfectly with all
-the other passes provided upstream.
-
-The last pass is the finalizing bufferization pass. The `mlir-npcomp` reference
-backend has arranged that all ops are bufferized by partial bufferizations, so
-that the upstream `finalizing-bufferize` pass can be used as the finalizing
-bufferization pass. This gives excellent diagnostics when something goes wrong
-with the bufferization process, such as due to an op that wasn't handled by any
-pattern.
-
-### How to write a partial bufferization pass
-
-The contract of a partial bufferization pass is that a subset of ops (or kinds
-of ops, customizable by a ConversionTarget) get bufferized.
-
-A partial bufferization pass is just a pass that uses the
-[dialect conversion](DialectConversion.md) framework to apply
-`ConversionPattern`s with a `tensor` to `memref` type conversion.
-
-To describe how to write such a pass, we will walk through an example, the
-`tensor-bufferize` pass
-([code](https://github.com/llvm/llvm-project/blob/bc8acf2ce8ad6e8c9b1d97b2e02d3f4ad26e1d9d/mlir/lib/Dialect/Tensor/Transforms/Bufferize.cpp#L23),
-[test](https://github.com/llvm/llvm-project/blob/bc8acf2ce8ad6e8c9b1d97b2e02d3f4ad26e1d9d/mlir/test/Dialect/Tensor/bufferize.mlir#L1))
-that bufferizes the `tensor` dialect. Note that these passes have been replaced
-with a `BufferizableOpInterface`-based implementation in the meantime, so we
-have to take a looker at an older version of the code.
-
-The bulk of the code in the pass will be a set of conversion patterns, with a
-simple example being
-[BufferizeCastOp](https://github.com/llvm/llvm-project/blob/2bf6e443e54604c7818c4d1a1837f3d091023270/mlir/lib/Dialect/Tensor/Transforms/Bufferize.cpp#L23)).
-
-```
-class BufferizeCastOp : public OpConversionPattern<tensor::CastOp> {
-public:
-  using OpConversionPattern::OpConversionPattern;
-  LogicalResult
-  matchAndRewrite(tensor::CastOp op, OpAdaptor adaptor,
-                  ConversionPatternRewriter &rewriter) const override {
-    auto resultType = getTypeConverter()->convertType(op.getType());
-    rewriter.replaceOpWithNewOp<MemRefCastOp>(op, resultType, adaptor.source());
-    return success();
-  }
-};
-```
-
-See [the talk](#the-talk) for more details on how to write these patterns.
-
-The
-[pass itself](https://github.com/llvm/llvm-project/blob/bc8acf2ce8ad6e8c9b1d97b2e02d3f4ad26e1d9d/mlir/lib/Dialect/Tensor/Transforms/Bufferize.cpp#L57)
-is very small, and follows the basic pattern of any dialect conversion pass.
-
-```
-void mlir::populateTensorBufferizePatterns(
-    const BufferizeTypeConverter &typeConverter, RewritePatternSet &patterns) {
-  patterns.add<BufferizeCastOp, BufferizeExtractOp>(typeConverter,
-                                                    patterns.getContext());
-}
-
-struct TensorBufferizePass : public TensorBufferizeBase<TensorBufferizePass> {
-  void runOnOperation() override {
-    auto *context = &getContext();
-    BufferizeTypeConverter typeConverter;
-    RewritePatternSet patterns(context);
-    ConversionTarget target(*context);
-
-    populateTensorBufferizePatterns(typeConverter, patterns);
-    target.addIllegalOp<tensor::CastOp, tensor::ExtractOp>();
-    target.addLegalDialect<func::FuncDialect>();
-
-    if (failed(
-            applyPartialConversion(getOperation(), target, std::move(patterns))))
-      signalPassFailure();
-  }
-};
-```
-
-The pass has all the hallmarks of a dialect conversion pass that does type
-conversions: a `TypeConverter`, a `RewritePatternSet`, and a `ConversionTarget`,
-and a call to `applyPartialConversion`. Note that a function
-`populateTensorBufferizePatterns` is separated, so that power users can use the
-patterns independently, if necessary (such as to combine multiple sets of
-conversion patterns into a single conversion call, for performance).
-
-One convenient utility provided by the MLIR bufferization infrastructure is the
-`BufferizeTypeConverter`, which comes pre-loaded with the necessary conversions
-and materializations between `tensor` and `memref`.
-
-In this case, the `BufferizationOpsDialect` is marked as legal, so the
-`bufferization.to_tensor` and `bufferization.to_memref` ops, which are inserted
-automatically by the dialect conversion framework as materializations, are
-legal. There is a helper `populateBufferizeMaterializationLegality`
-([code](https://github.com/llvm/llvm-project/blob/a0b65a7bcd6065688189b3d678c42ed6af9603db/mlir/include/mlir/Transforms/Bufferize.h#L53))
-which helps with this in general.
-
-### Other partial bufferization examples
-
--   `func-bufferize`
-    ([code](https://github.com/llvm/llvm-project/blob/2f5715dc78328215d51d5664c72c632a6dac1046/mlir/lib/Dialect/Func/Transforms/FuncBufferize.cpp#L1),
-    [test](https://github.com/llvm/llvm-project/blob/2f5715dc78328215d51d5664c72c632a6dac1046/mlir/test/Dialect/Func/func-bufferize.mlir#L1))
-
-    -   Bufferizes `func`, `call`, and `BranchOpInterface` ops.
-    -   This is an example of how to bufferize ops that have multi-block
-        regions.
-    -   This is an example of a pass that is not split along dialect
-        subdivisions.
-
-### How to write a finalizing bufferization pass
-
-The contract of a finalizing bufferization pass is that all tensors are gone
-from the program.
-
-The easiest way to write a finalizing bufferize pass is to not write one at all!
-MLIR provides a pass `finalizing-bufferize` which eliminates the
-`bufferization.to_tensor` / `bufferization.to_memref` materialization ops
-inserted by partial bufferization passes and emits an error if that is not
-sufficient to remove all tensors from the program.
-
-This pass is sufficient when partial bufferization passes have bufferized all
-the ops in the program, leaving behind only the materializations. When possible,
-it is recommended to structure your pass pipeline this way, as this has the
-significant advantage that if an op does not get bufferized (due to a missing
-pattern, bug in the code, etc.), `finalizing-bufferize` will emit a nice clean
-error, and the IR seen by `finalizing-bufferize` will only contain only one
-unbufferized op.
-
-However, before the current bufferization infrastructure was put in place,
-bufferization could only be done as a single finalizing bufferization mega-pass
-that used the `populate*BufferizePatterns` functions from multiple dialects to
-simultaneously bufferize everything at once. Thus, one might see code in
-downstream projects structured this way. This structure is not recommended in
-new code. A helper, `populateEliminateBufferizeMaterializationsPatterns`
-([code](https://github.com/llvm/llvm-project/blob/a0b65a7bcd6065688189b3d678c42ed6af9603db/mlir/include/mlir/Transforms/Bufferize.h#L58))
-is available for such passes to provide patterns that eliminate
-`bufferization.to_tensor` and `bufferization.to_memref`.
-
-### Changes since [the talk](#the-talk)
-
--   `func-bufferize` was changed to be a partial conversion pass, and there is a
-    new `finalizing-bufferize` which serves as a general finalizing
-    bufferization pass.
--   Most partial bufferization passes have been reimplemented in terms of
-    `BufferizableOpInterface`. New users should use One-Shot Bufferize instead
-    of dialect conversion-based bufferization.
diff --git a/mlir/include/mlir/Dialect/Func/Transforms/Passes.h b/mlir/include/mlir/Dialect/Func/Transforms/Passes.h
index 011ad3e3d0be4d..02fc9e1d934390 100644
--- a/mlir/include/mlir/Dialect/Func/Transforms/Passes.h
+++ b/mlir/include/mlir/Dialect/Func/Transforms/Passes.h
@@ -29,9 +29,6 @@ namespace func {
 #define GEN_PASS_DECL
 #include "mlir/Dialect/Func/Transforms/Passes.h.inc"
 
-/// Creates an instance of func bufferization pass.
-std::unique_ptr<Pass> createFuncBufferizePass();
-
 /// Pass to deduplicate functions.
 std::unique_ptr<Pass> createDuplicateFunctionEliminationPass();
 
diff --git a/mlir/include/mlir/Dialect/Func/Transforms/Passes.td b/mlir/include/mlir/Dialect/Func/Transforms/Passes.td
index 8f6dbcb1ee653a..c3caf120d052e2 100644
--- a/mlir/include/mlir/Dialect/Func/Transforms/Passes.td
+++ b/mlir/include/mlir/Dialect/Func/Transforms/Passes.td
@@ -11,35 +11,6 @@
 
 include "mlir/Pass/PassBase.td"
 
-def FuncBufferize : Pass<"func-bufferize", "ModuleOp"> {
-  let summary = "Bufferize func/call/return ops";
-  let description = [{
-    A bufferize pass that bufferizes func.func and func.call ops.
-
-    Because this pass updates func.func ops, it must be a module pass. It is
-    useful to keep this pass separate from other bufferizations so that the
-    other ones can be run at function-level in parallel.
-
-    This pass must be done atomically because it changes func op signatures,
-    which requires atomically updating calls as well throughout the entire
-    module.
-
-    This pass also changes the type of block arguments, which requires that all
-    successor arguments of predecessors be converted. This is achieved by
-    rewriting terminators based on the information provided by the
-    `BranchOpInterface`.
-    As this pass rewrites function operations, it also rewrites the
-    corresponding return operations. Other return-like operations that
-    implement the `ReturnLike` trait are not rewritten in general, as they
-    require that the corresponding parent operation is also rewritten.
-    Finally, this pass fails for unknown terminators, as we cannot decide
-    whether they need rewriting.
-  }];
-  let constructor = "mlir::func::createFuncBufferizePass()";
-  let dependentDialects = ["bufferization::BufferizationDialect",
-                           "memref::MemRefDialect"];
-}
-
 def DuplicateFunctionEliminationPass : Pass<"duplicate-function-elimination",
     "ModuleOp"> {
   let summary = "Deduplicate functions";
diff --git a/mlir/lib/Dialect/Func/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Func/Transforms/CMakeLists.txt
index 172019907c3a8a..f8fb1f436a95b1 100644
--- a/mlir/lib/Dialect/Func/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Func/Transforms/CMakeLists.txt
@@ -1,7 +1,6 @@
 add_mlir_dialect_library(MLIRFuncTransforms
   DecomposeCallGraphTypes.cpp
   DuplicateFunctionElimination.cpp
-  FuncBufferize.cpp
   FuncConversions.cpp
   OneToNFuncConversions.cpp
 
@@ -12,8 +11,6 @@ add_mlir_dialect_library(MLIRFuncTransforms
   MLIRFuncTransformsIncGen
 
   LINK_LIBS PUBLIC
-  MLIRBufferizationDialect
-  MLIRBufferizationTransforms
   MLIRFuncDialect
   MLIRIR
   MLIRMemRefDialect
diff --git a/mlir/lib/Dialect/Func/Transforms/FuncBufferize.cpp b/mlir/lib/Dialect/Func/Transforms/FuncBufferize.cpp
deleted file mode 100644
index 5f4fed8e4d491b..00000000000000
--- a/mlir/lib/Dialect/Func/Transforms/FuncBufferize.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-//===- Bufferize.cpp - Bufferization for func ops -------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements bufferization of func.func's and func.call's.
-//
-//===----------------------------------------------------------------------===//
-
-#include "mlir/Dialect/Func/Transforms/Passes.h"
-
-#include "mlir/Dialect/Bufferization/IR/Bufferization.h"
-#include "mlir/Dialect/Bufferization/Transforms/Bufferize.h"
-#include "mlir/Dialect/Func/IR/FuncOps.h"
-#include "mlir/Dialect/Func/Transforms/FuncConversions.h"
-#include "mlir/Dialect/MemRef/IR/MemRef.h"
-#include "mlir/Transforms/DialectConversion.h"
-
-namespace mlir {
-#define GEN_PASS_DEF_FUNCBUFFERIZE
-#include "mlir/Dialect/Func/Transforms/Passes.h.inc"
-} // namespace...
[truncated]

@llvmbot
Copy link
Member

llvmbot commented Oct 29, 2024

@llvm/pr-subscribers-mlir-memref

Author: Matthias Springer (matthias-springer)

Changes

The dialect conversion-based bufferization passes have been migrated to One-Shot Bufferize about two years ago. To clean up the code base, this commit removes the func-bufferize pass, one of the few remaining parts of the old infrastructure. Most bufferization passes have already been removed.

Note for LLVM integration: If you depend on this pass, migrate to One-Shot Bufferize or copy the pass to your codebase.

Depends on #114017.


Patch is 26.80 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/114152.diff

8 Files Affected:

  • (modified) mlir/docs/Bufferization.md (+2-268)
  • (modified) mlir/include/mlir/Dialect/Func/Transforms/Passes.h (-3)
  • (modified) mlir/include/mlir/Dialect/Func/Transforms/Passes.td (-29)
  • (modified) mlir/lib/Dialect/Func/Transforms/CMakeLists.txt (-3)
  • (removed) mlir/lib/Dialect/Func/Transforms/FuncBufferize.cpp (-71)
  • (removed) mlir/test/Dialect/Func/func-bufferize.mlir (-83)
  • (modified) mlir/test/Dialect/Transform/test-pass-application.mlir (+2-2)
  • (modified) mlir/test/Integration/Dialect/MemRef/verify-memref.mlir (+1-1)
diff --git a/mlir/docs/Bufferization.md b/mlir/docs/Bufferization.md
index 7d38ebb38535c7..e16fe91212a1a5 100644
--- a/mlir/docs/Bufferization.md
+++ b/mlir/docs/Bufferization.md
@@ -23,11 +23,6 @@ the resulting `memref` IR has no memory leaks.
 
 ## Deprecated Passes
 
-The old dialect conversion-based bufferization passes have been deprecated and
-should not be used anymore. Most of those passes have already been removed from
-MLIR. One-Shot Bufferize produces in better bufferization results with fewer
-memory allocations and buffer copies.
-
 The buffer deallocation pass has been deprecated in favor of the ownership-based
 buffer deallocation pipeline. The deprecated pass has some limitations that may
 cause memory leaks in the resulting IR.
@@ -276,18 +271,13 @@ semantics (i.e., tensor result or tensor operand) that is not bufferizable
 `to_memref`/`to_tensor` ops around the bufferization boundary.
 
 One-Shot Bufferize can be configured to bufferize only ops from a set of
-dialects with `dialect-filter`. This can be useful for gradually migrating from
-dialect conversion-based bufferization to One-Shot Bufferize. One-Shot Bufferize
-must run first in such a case, because dialect conversion-based bufferization
-generates `to_tensor` ops without the `restrict` unit attribute, which One-Shot
-Bufferize cannot analyze.
+dialects with `dialect-filter`.
 
 One-Shot Bufferize can also be called programmatically with
 [`bufferization::runOneShotBufferize`](https://github.com/llvm/llvm-project/blob/ae2764e835a26bad9774803eca0a6530df2a3e2d/mlir/include/mlir/Dialect/Bufferization/Transforms/OneShotAnalysis.h#L167).
 Alternatively,
 [`bufferization::bufferizeOp`](https://github.com/llvm/llvm-project/blob/ae2764e835a26bad9774803eca0a6530df2a3e2d/mlir/include/mlir/Dialect/Bufferization/Transforms/Bufferize.h#L78)
-skips the analysis and inserts a copy on every buffer write, just like the
-dialect conversion-based bufferization.
+skips the analysis and inserts a copy on every buffer write.
 
 By default, function boundaries are not bufferized. This is because there are
 currently limitations around function graph bufferization: recursive
@@ -484,259 +474,3 @@ conflict detection algorithm, interested users may want to refer to:
 * [Original design document](https://discourse.llvm.org/uploads/short-url/5kckJ3DftYwQokG252teFgw3sYa.pdf)
 * [ODM talk](https://youtu.be/TXEo59CYS9A), ([slides](https://mlir.llvm.org/OpenMeetings/2022-01-13-One-Shot-Bufferization.pdf)).
 * [LLVM Dev Meeting 2023 tutorial slides](https://m-sp.org/downloads/llvm_dev_2023.pdf)
-
-## Migrating from Dialect Conversion-based Bufferization
-
-Both dialect conversion-based bufferization and One-Shot Bufferize generate
-`to_tensor`/`to_memref` ops at the bufferization boundary (when run with
-`allow-unknown-ops`). They can be combined and run in sequence. However,
-One-Shot Bufferize must run first because it cannot analyze those boundary ops.
-To update existing code step-by-step, it may be useful to specify a dialect
-filter for One-Shot Bufferize, so that dialects can be switched over one-by-one.
-
-## Dialect Conversion-based Bufferization
-
-Disclaimer: Most dialect conversion-based bufferization has been migrated to
-One-Shot Bufferize. New users should use One-Shot Bufferize (with or without
-analysis). The following documentation is only for existing users of dialect
-conversion-based bufferization.
-
-This system is a simple application of MLIR's dialect conversion infrastructure.
-The bulk of the code related to bufferization is a set of ordinary
-`ConversionPattern`'s that dialect authors write for converting ops that operate
-on `tensor`'s to ops that operate on `memref`'s. A set of conventions and best
-practices are followed that allow these patterns to be run across multiple
-independent passes (rather than requiring a single huge atomic conversion pass),
-which makes the compilation pipelines scalable, robust, and easy to debug.
-
-This document is targeted at people looking to utilize MLIR's bufferization
-functionality, along with people who want to extend it to cover their own ops.
-
-<a name="the-talk">**NOTE:**</a> Before reading this document, please watch the
-talk "Type Conversions the Not-So-Hard-Way: MLIR's New Bufferization
-Infrastructure"
-([slides](https://drive.google.com/file/d/1FVbzCXxZzS9LBLuvpPNLWJD-XDkt54ky/view?usp=sharing),
-[recording](https://drive.google.com/file/d/1VfVajitgf8ZPnd-HRkJvaJiFLhBsluXN/view?usp=sharing)).
-That talk gives a high-level overview of the bufferization infrastructure and
-important conceptual details related to using the MLIR dialect conversion
-infrastructure.
-
-### Bufferization's place in a compilation pipeline
-
-Bufferization itself does not free any of the buffers that have been allocated,
-nor does it do anything particularly intelligent with the placement of buffers
-w.r.t. control flow. Thus, a realistic compilation pipeline will usually consist
-of:
-
-1.  Bufferization
-1.  Buffer optimizations such as `buffer-hoisting`, `buffer-loop-hoisting`, and
-    `promote-buffers-to-stack`, which do optimizations that are only exposed
-    after bufferization.
-1.  Finally, running the [ownership-based buffer deallocation](OwnershipBasedBufferDeallocation.md)
-    pass.
-
-After buffer deallocation has been completed, the program will be quite
-difficult to transform due to the presence of the deallocation ops. Thus, other
-optimizations such as linalg fusion on memrefs should be done before that stage.
-
-### General structure of the bufferization process
-
-Bufferization consists of running multiple *partial* bufferization passes,
-followed by one *finalizing* bufferization pass.
-
-There is typically one partial bufferization pass per dialect (though other
-subdivisions are possible). For example, for a dialect `X` there will typically
-be a pass `X-bufferize` that knows how to bufferize all the ops in that dialect.
-By running pass `X-bufferize` for each dialect `X` in the program, all the ops
-in the program are incrementally bufferized.
-
-Partial bufferization passes create programs where only some ops have been
-bufferized. These passes will create *materializations* (also sometimes called
-"casts") that convert between the `tensor` and `memref` type, which allows
-bridging between ops that have been bufferized and ops that have not yet been
-bufferized.
-
-Finalizing bufferizations complete the bufferization process, and guarantee that
-there are no tensors remaining in the program. This involves eliminating the
-materializations. The pass `finalizing-bufferize` provides a minimal pass that
-only eliminates materializations and issues an error if any unbufferized ops
-exist in the program.
-
-However, it is possible for a finalizing bufferization to do more than just
-eliminate materializations. By adding patterns (just as a partial bufferization
-would), it is possible for a finalizing bufferization pass to simultaneously
-bufferize ops and eliminate materializations. This has a number of disadvantages
-discussed in the talk and should generally be avoided.
-
-### Example
-
-As a concrete example, we will look at the bufferization pipeline from the
-`mlir-npcomp` reference backend
-([code](https://github.com/llvm/mlir-npcomp/blob/97d6d04d41216e73d40b89ffd79620973fc14ce3/lib/RefBackend/RefBackend.cpp#L232)).
-The code, slightly simplified and annotated, is reproduced here:
-
-```c++
-  // Partial bufferization passes.
-  pm.addPass(createTensorConstantBufferizePass());
-  pm.addNestedPass<func::FuncOp>(createTCPBufferizePass()); // Bufferizes the downstream `tcp` dialect.
-  pm.addNestedPass<func::FuncOp>(createLinalgBufferizePass());
-  pm.addNestedPass<func::FuncOp>(createTensorBufferizePass());
-  pm.addPass(createFuncBufferizePass());
-
-  // Finalizing bufferization pass.
-  pm.addNestedPass<func::FuncOp>(createFinalizingBufferizePass());
-```
-
-Looking first at the partial bufferization passes, we see that there are a
-sequence of `FuncOp` passes (which run in parallel on functions). These function
-passes are bracketed by `arith-bufferize` and `func-bufferize`, which are module
-passes (and thus serialize the parallel compilation process). These two passes
-must be module passes because they make changes to the top-level module.
-
-The bulk of the bufferization work is done by the function passes. Most of these
-passes are provided as part of the upstream MLIR distribution and bufferize
-their respective dialects (e.g. `abc-bufferize` bufferizes the `abc` dialect).
-The `tcp-bufferize` pass is an exception -- it is a partial bufferization pass
-used to bufferize the downstream `tcp` dialect, and fits in perfectly with all
-the other passes provided upstream.
-
-The last pass is the finalizing bufferization pass. The `mlir-npcomp` reference
-backend has arranged that all ops are bufferized by partial bufferizations, so
-that the upstream `finalizing-bufferize` pass can be used as the finalizing
-bufferization pass. This gives excellent diagnostics when something goes wrong
-with the bufferization process, such as due to an op that wasn't handled by any
-pattern.
-
-### How to write a partial bufferization pass
-
-The contract of a partial bufferization pass is that a subset of ops (or kinds
-of ops, customizable by a ConversionTarget) get bufferized.
-
-A partial bufferization pass is just a pass that uses the
-[dialect conversion](DialectConversion.md) framework to apply
-`ConversionPattern`s with a `tensor` to `memref` type conversion.
-
-To describe how to write such a pass, we will walk through an example, the
-`tensor-bufferize` pass
-([code](https://github.com/llvm/llvm-project/blob/bc8acf2ce8ad6e8c9b1d97b2e02d3f4ad26e1d9d/mlir/lib/Dialect/Tensor/Transforms/Bufferize.cpp#L23),
-[test](https://github.com/llvm/llvm-project/blob/bc8acf2ce8ad6e8c9b1d97b2e02d3f4ad26e1d9d/mlir/test/Dialect/Tensor/bufferize.mlir#L1))
-that bufferizes the `tensor` dialect. Note that these passes have been replaced
-with a `BufferizableOpInterface`-based implementation in the meantime, so we
-have to take a looker at an older version of the code.
-
-The bulk of the code in the pass will be a set of conversion patterns, with a
-simple example being
-[BufferizeCastOp](https://github.com/llvm/llvm-project/blob/2bf6e443e54604c7818c4d1a1837f3d091023270/mlir/lib/Dialect/Tensor/Transforms/Bufferize.cpp#L23)).
-
-```
-class BufferizeCastOp : public OpConversionPattern<tensor::CastOp> {
-public:
-  using OpConversionPattern::OpConversionPattern;
-  LogicalResult
-  matchAndRewrite(tensor::CastOp op, OpAdaptor adaptor,
-                  ConversionPatternRewriter &rewriter) const override {
-    auto resultType = getTypeConverter()->convertType(op.getType());
-    rewriter.replaceOpWithNewOp<MemRefCastOp>(op, resultType, adaptor.source());
-    return success();
-  }
-};
-```
-
-See [the talk](#the-talk) for more details on how to write these patterns.
-
-The
-[pass itself](https://github.com/llvm/llvm-project/blob/bc8acf2ce8ad6e8c9b1d97b2e02d3f4ad26e1d9d/mlir/lib/Dialect/Tensor/Transforms/Bufferize.cpp#L57)
-is very small, and follows the basic pattern of any dialect conversion pass.
-
-```
-void mlir::populateTensorBufferizePatterns(
-    const BufferizeTypeConverter &typeConverter, RewritePatternSet &patterns) {
-  patterns.add<BufferizeCastOp, BufferizeExtractOp>(typeConverter,
-                                                    patterns.getContext());
-}
-
-struct TensorBufferizePass : public TensorBufferizeBase<TensorBufferizePass> {
-  void runOnOperation() override {
-    auto *context = &getContext();
-    BufferizeTypeConverter typeConverter;
-    RewritePatternSet patterns(context);
-    ConversionTarget target(*context);
-
-    populateTensorBufferizePatterns(typeConverter, patterns);
-    target.addIllegalOp<tensor::CastOp, tensor::ExtractOp>();
-    target.addLegalDialect<func::FuncDialect>();
-
-    if (failed(
-            applyPartialConversion(getOperation(), target, std::move(patterns))))
-      signalPassFailure();
-  }
-};
-```
-
-The pass has all the hallmarks of a dialect conversion pass that does type
-conversions: a `TypeConverter`, a `RewritePatternSet`, and a `ConversionTarget`,
-and a call to `applyPartialConversion`. Note that a function
-`populateTensorBufferizePatterns` is separated, so that power users can use the
-patterns independently, if necessary (such as to combine multiple sets of
-conversion patterns into a single conversion call, for performance).
-
-One convenient utility provided by the MLIR bufferization infrastructure is the
-`BufferizeTypeConverter`, which comes pre-loaded with the necessary conversions
-and materializations between `tensor` and `memref`.
-
-In this case, the `BufferizationOpsDialect` is marked as legal, so the
-`bufferization.to_tensor` and `bufferization.to_memref` ops, which are inserted
-automatically by the dialect conversion framework as materializations, are
-legal. There is a helper `populateBufferizeMaterializationLegality`
-([code](https://github.com/llvm/llvm-project/blob/a0b65a7bcd6065688189b3d678c42ed6af9603db/mlir/include/mlir/Transforms/Bufferize.h#L53))
-which helps with this in general.
-
-### Other partial bufferization examples
-
--   `func-bufferize`
-    ([code](https://github.com/llvm/llvm-project/blob/2f5715dc78328215d51d5664c72c632a6dac1046/mlir/lib/Dialect/Func/Transforms/FuncBufferize.cpp#L1),
-    [test](https://github.com/llvm/llvm-project/blob/2f5715dc78328215d51d5664c72c632a6dac1046/mlir/test/Dialect/Func/func-bufferize.mlir#L1))
-
-    -   Bufferizes `func`, `call`, and `BranchOpInterface` ops.
-    -   This is an example of how to bufferize ops that have multi-block
-        regions.
-    -   This is an example of a pass that is not split along dialect
-        subdivisions.
-
-### How to write a finalizing bufferization pass
-
-The contract of a finalizing bufferization pass is that all tensors are gone
-from the program.
-
-The easiest way to write a finalizing bufferize pass is to not write one at all!
-MLIR provides a pass `finalizing-bufferize` which eliminates the
-`bufferization.to_tensor` / `bufferization.to_memref` materialization ops
-inserted by partial bufferization passes and emits an error if that is not
-sufficient to remove all tensors from the program.
-
-This pass is sufficient when partial bufferization passes have bufferized all
-the ops in the program, leaving behind only the materializations. When possible,
-it is recommended to structure your pass pipeline this way, as this has the
-significant advantage that if an op does not get bufferized (due to a missing
-pattern, bug in the code, etc.), `finalizing-bufferize` will emit a nice clean
-error, and the IR seen by `finalizing-bufferize` will only contain only one
-unbufferized op.
-
-However, before the current bufferization infrastructure was put in place,
-bufferization could only be done as a single finalizing bufferization mega-pass
-that used the `populate*BufferizePatterns` functions from multiple dialects to
-simultaneously bufferize everything at once. Thus, one might see code in
-downstream projects structured this way. This structure is not recommended in
-new code. A helper, `populateEliminateBufferizeMaterializationsPatterns`
-([code](https://github.com/llvm/llvm-project/blob/a0b65a7bcd6065688189b3d678c42ed6af9603db/mlir/include/mlir/Transforms/Bufferize.h#L58))
-is available for such passes to provide patterns that eliminate
-`bufferization.to_tensor` and `bufferization.to_memref`.
-
-### Changes since [the talk](#the-talk)
-
--   `func-bufferize` was changed to be a partial conversion pass, and there is a
-    new `finalizing-bufferize` which serves as a general finalizing
-    bufferization pass.
--   Most partial bufferization passes have been reimplemented in terms of
-    `BufferizableOpInterface`. New users should use One-Shot Bufferize instead
-    of dialect conversion-based bufferization.
diff --git a/mlir/include/mlir/Dialect/Func/Transforms/Passes.h b/mlir/include/mlir/Dialect/Func/Transforms/Passes.h
index 011ad3e3d0be4d..02fc9e1d934390 100644
--- a/mlir/include/mlir/Dialect/Func/Transforms/Passes.h
+++ b/mlir/include/mlir/Dialect/Func/Transforms/Passes.h
@@ -29,9 +29,6 @@ namespace func {
 #define GEN_PASS_DECL
 #include "mlir/Dialect/Func/Transforms/Passes.h.inc"
 
-/// Creates an instance of func bufferization pass.
-std::unique_ptr<Pass> createFuncBufferizePass();
-
 /// Pass to deduplicate functions.
 std::unique_ptr<Pass> createDuplicateFunctionEliminationPass();
 
diff --git a/mlir/include/mlir/Dialect/Func/Transforms/Passes.td b/mlir/include/mlir/Dialect/Func/Transforms/Passes.td
index 8f6dbcb1ee653a..c3caf120d052e2 100644
--- a/mlir/include/mlir/Dialect/Func/Transforms/Passes.td
+++ b/mlir/include/mlir/Dialect/Func/Transforms/Passes.td
@@ -11,35 +11,6 @@
 
 include "mlir/Pass/PassBase.td"
 
-def FuncBufferize : Pass<"func-bufferize", "ModuleOp"> {
-  let summary = "Bufferize func/call/return ops";
-  let description = [{
-    A bufferize pass that bufferizes func.func and func.call ops.
-
-    Because this pass updates func.func ops, it must be a module pass. It is
-    useful to keep this pass separate from other bufferizations so that the
-    other ones can be run at function-level in parallel.
-
-    This pass must be done atomically because it changes func op signatures,
-    which requires atomically updating calls as well throughout the entire
-    module.
-
-    This pass also changes the type of block arguments, which requires that all
-    successor arguments of predecessors be converted. This is achieved by
-    rewriting terminators based on the information provided by the
-    `BranchOpInterface`.
-    As this pass rewrites function operations, it also rewrites the
-    corresponding return operations. Other return-like operations that
-    implement the `ReturnLike` trait are not rewritten in general, as they
-    require that the corresponding parent operation is also rewritten.
-    Finally, this pass fails for unknown terminators, as we cannot decide
-    whether they need rewriting.
-  }];
-  let constructor = "mlir::func::createFuncBufferizePass()";
-  let dependentDialects = ["bufferization::BufferizationDialect",
-                           "memref::MemRefDialect"];
-}
-
 def DuplicateFunctionEliminationPass : Pass<"duplicate-function-elimination",
     "ModuleOp"> {
   let summary = "Deduplicate functions";
diff --git a/mlir/lib/Dialect/Func/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Func/Transforms/CMakeLists.txt
index 172019907c3a8a..f8fb1f436a95b1 100644
--- a/mlir/lib/Dialect/Func/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Func/Transforms/CMakeLists.txt
@@ -1,7 +1,6 @@
 add_mlir_dialect_library(MLIRFuncTransforms
   DecomposeCallGraphTypes.cpp
   DuplicateFunctionElimination.cpp
-  FuncBufferize.cpp
   FuncConversions.cpp
   OneToNFuncConversions.cpp
 
@@ -12,8 +11,6 @@ add_mlir_dialect_library(MLIRFuncTransforms
   MLIRFuncTransformsIncGen
 
   LINK_LIBS PUBLIC
-  MLIRBufferizationDialect
-  MLIRBufferizationTransforms
   MLIRFuncDialect
   MLIRIR
   MLIRMemRefDialect
diff --git a/mlir/lib/Dialect/Func/Transforms/FuncBufferize.cpp b/mlir/lib/Dialect/Func/Transforms/FuncBufferize.cpp
deleted file mode 100644
index 5f4fed8e4d491b..00000000000000
--- a/mlir/lib/Dialect/Func/Transforms/FuncBufferize.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-//===- Bufferize.cpp - Bufferization for func ops -------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements bufferization of func.func's and func.call's.
-//
-//===----------------------------------------------------------------------===//
-
-#include "mlir/Dialect/Func/Transforms/Passes.h"
-
-#include "mlir/Dialect/Bufferization/IR/Bufferization.h"
-#include "mlir/Dialect/Bufferization/Transforms/Bufferize.h"
-#include "mlir/Dialect/Func/IR/FuncOps.h"
-#include "mlir/Dialect/Func/Transforms/FuncConversions.h"
-#include "mlir/Dialect/MemRef/IR/MemRef.h"
-#include "mlir/Transforms/DialectConversion.h"
-
-namespace mlir {
-#define GEN_PASS_DEF_FUNCBUFFERIZE
-#include "mlir/Dialect/Func/Transforms/Passes.h.inc"
-} // namespace...
[truncated]

@llvmbot
Copy link
Member

llvmbot commented Oct 29, 2024

@llvm/pr-subscribers-mlir-func

Author: Matthias Springer (matthias-springer)

Changes

The dialect conversion-based bufferization passes have been migrated to One-Shot Bufferize about two years ago. To clean up the code base, this commit removes the func-bufferize pass, one of the few remaining parts of the old infrastructure. Most bufferization passes have already been removed.

Note for LLVM integration: If you depend on this pass, migrate to One-Shot Bufferize or copy the pass to your codebase.

Depends on #114017.


Patch is 26.80 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/114152.diff

8 Files Affected:

  • (modified) mlir/docs/Bufferization.md (+2-268)
  • (modified) mlir/include/mlir/Dialect/Func/Transforms/Passes.h (-3)
  • (modified) mlir/include/mlir/Dialect/Func/Transforms/Passes.td (-29)
  • (modified) mlir/lib/Dialect/Func/Transforms/CMakeLists.txt (-3)
  • (removed) mlir/lib/Dialect/Func/Transforms/FuncBufferize.cpp (-71)
  • (removed) mlir/test/Dialect/Func/func-bufferize.mlir (-83)
  • (modified) mlir/test/Dialect/Transform/test-pass-application.mlir (+2-2)
  • (modified) mlir/test/Integration/Dialect/MemRef/verify-memref.mlir (+1-1)
diff --git a/mlir/docs/Bufferization.md b/mlir/docs/Bufferization.md
index 7d38ebb38535c7..e16fe91212a1a5 100644
--- a/mlir/docs/Bufferization.md
+++ b/mlir/docs/Bufferization.md
@@ -23,11 +23,6 @@ the resulting `memref` IR has no memory leaks.
 
 ## Deprecated Passes
 
-The old dialect conversion-based bufferization passes have been deprecated and
-should not be used anymore. Most of those passes have already been removed from
-MLIR. One-Shot Bufferize produces in better bufferization results with fewer
-memory allocations and buffer copies.
-
 The buffer deallocation pass has been deprecated in favor of the ownership-based
 buffer deallocation pipeline. The deprecated pass has some limitations that may
 cause memory leaks in the resulting IR.
@@ -276,18 +271,13 @@ semantics (i.e., tensor result or tensor operand) that is not bufferizable
 `to_memref`/`to_tensor` ops around the bufferization boundary.
 
 One-Shot Bufferize can be configured to bufferize only ops from a set of
-dialects with `dialect-filter`. This can be useful for gradually migrating from
-dialect conversion-based bufferization to One-Shot Bufferize. One-Shot Bufferize
-must run first in such a case, because dialect conversion-based bufferization
-generates `to_tensor` ops without the `restrict` unit attribute, which One-Shot
-Bufferize cannot analyze.
+dialects with `dialect-filter`.
 
 One-Shot Bufferize can also be called programmatically with
 [`bufferization::runOneShotBufferize`](https://github.com/llvm/llvm-project/blob/ae2764e835a26bad9774803eca0a6530df2a3e2d/mlir/include/mlir/Dialect/Bufferization/Transforms/OneShotAnalysis.h#L167).
 Alternatively,
 [`bufferization::bufferizeOp`](https://github.com/llvm/llvm-project/blob/ae2764e835a26bad9774803eca0a6530df2a3e2d/mlir/include/mlir/Dialect/Bufferization/Transforms/Bufferize.h#L78)
-skips the analysis and inserts a copy on every buffer write, just like the
-dialect conversion-based bufferization.
+skips the analysis and inserts a copy on every buffer write.
 
 By default, function boundaries are not bufferized. This is because there are
 currently limitations around function graph bufferization: recursive
@@ -484,259 +474,3 @@ conflict detection algorithm, interested users may want to refer to:
 * [Original design document](https://discourse.llvm.org/uploads/short-url/5kckJ3DftYwQokG252teFgw3sYa.pdf)
 * [ODM talk](https://youtu.be/TXEo59CYS9A), ([slides](https://mlir.llvm.org/OpenMeetings/2022-01-13-One-Shot-Bufferization.pdf)).
 * [LLVM Dev Meeting 2023 tutorial slides](https://m-sp.org/downloads/llvm_dev_2023.pdf)
-
-## Migrating from Dialect Conversion-based Bufferization
-
-Both dialect conversion-based bufferization and One-Shot Bufferize generate
-`to_tensor`/`to_memref` ops at the bufferization boundary (when run with
-`allow-unknown-ops`). They can be combined and run in sequence. However,
-One-Shot Bufferize must run first because it cannot analyze those boundary ops.
-To update existing code step-by-step, it may be useful to specify a dialect
-filter for One-Shot Bufferize, so that dialects can be switched over one-by-one.
-
-## Dialect Conversion-based Bufferization
-
-Disclaimer: Most dialect conversion-based bufferization has been migrated to
-One-Shot Bufferize. New users should use One-Shot Bufferize (with or without
-analysis). The following documentation is only for existing users of dialect
-conversion-based bufferization.
-
-This system is a simple application of MLIR's dialect conversion infrastructure.
-The bulk of the code related to bufferization is a set of ordinary
-`ConversionPattern`'s that dialect authors write for converting ops that operate
-on `tensor`'s to ops that operate on `memref`'s. A set of conventions and best
-practices are followed that allow these patterns to be run across multiple
-independent passes (rather than requiring a single huge atomic conversion pass),
-which makes the compilation pipelines scalable, robust, and easy to debug.
-
-This document is targeted at people looking to utilize MLIR's bufferization
-functionality, along with people who want to extend it to cover their own ops.
-
-<a name="the-talk">**NOTE:**</a> Before reading this document, please watch the
-talk "Type Conversions the Not-So-Hard-Way: MLIR's New Bufferization
-Infrastructure"
-([slides](https://drive.google.com/file/d/1FVbzCXxZzS9LBLuvpPNLWJD-XDkt54ky/view?usp=sharing),
-[recording](https://drive.google.com/file/d/1VfVajitgf8ZPnd-HRkJvaJiFLhBsluXN/view?usp=sharing)).
-That talk gives a high-level overview of the bufferization infrastructure and
-important conceptual details related to using the MLIR dialect conversion
-infrastructure.
-
-### Bufferization's place in a compilation pipeline
-
-Bufferization itself does not free any of the buffers that have been allocated,
-nor does it do anything particularly intelligent with the placement of buffers
-w.r.t. control flow. Thus, a realistic compilation pipeline will usually consist
-of:
-
-1.  Bufferization
-1.  Buffer optimizations such as `buffer-hoisting`, `buffer-loop-hoisting`, and
-    `promote-buffers-to-stack`, which do optimizations that are only exposed
-    after bufferization.
-1.  Finally, running the [ownership-based buffer deallocation](OwnershipBasedBufferDeallocation.md)
-    pass.
-
-After buffer deallocation has been completed, the program will be quite
-difficult to transform due to the presence of the deallocation ops. Thus, other
-optimizations such as linalg fusion on memrefs should be done before that stage.
-
-### General structure of the bufferization process
-
-Bufferization consists of running multiple *partial* bufferization passes,
-followed by one *finalizing* bufferization pass.
-
-There is typically one partial bufferization pass per dialect (though other
-subdivisions are possible). For example, for a dialect `X` there will typically
-be a pass `X-bufferize` that knows how to bufferize all the ops in that dialect.
-By running pass `X-bufferize` for each dialect `X` in the program, all the ops
-in the program are incrementally bufferized.
-
-Partial bufferization passes create programs where only some ops have been
-bufferized. These passes will create *materializations* (also sometimes called
-"casts") that convert between the `tensor` and `memref` type, which allows
-bridging between ops that have been bufferized and ops that have not yet been
-bufferized.
-
-Finalizing bufferizations complete the bufferization process, and guarantee that
-there are no tensors remaining in the program. This involves eliminating the
-materializations. The pass `finalizing-bufferize` provides a minimal pass that
-only eliminates materializations and issues an error if any unbufferized ops
-exist in the program.
-
-However, it is possible for a finalizing bufferization to do more than just
-eliminate materializations. By adding patterns (just as a partial bufferization
-would), it is possible for a finalizing bufferization pass to simultaneously
-bufferize ops and eliminate materializations. This has a number of disadvantages
-discussed in the talk and should generally be avoided.
-
-### Example
-
-As a concrete example, we will look at the bufferization pipeline from the
-`mlir-npcomp` reference backend
-([code](https://github.com/llvm/mlir-npcomp/blob/97d6d04d41216e73d40b89ffd79620973fc14ce3/lib/RefBackend/RefBackend.cpp#L232)).
-The code, slightly simplified and annotated, is reproduced here:
-
-```c++
-  // Partial bufferization passes.
-  pm.addPass(createTensorConstantBufferizePass());
-  pm.addNestedPass<func::FuncOp>(createTCPBufferizePass()); // Bufferizes the downstream `tcp` dialect.
-  pm.addNestedPass<func::FuncOp>(createLinalgBufferizePass());
-  pm.addNestedPass<func::FuncOp>(createTensorBufferizePass());
-  pm.addPass(createFuncBufferizePass());
-
-  // Finalizing bufferization pass.
-  pm.addNestedPass<func::FuncOp>(createFinalizingBufferizePass());
-```
-
-Looking first at the partial bufferization passes, we see that there are a
-sequence of `FuncOp` passes (which run in parallel on functions). These function
-passes are bracketed by `arith-bufferize` and `func-bufferize`, which are module
-passes (and thus serialize the parallel compilation process). These two passes
-must be module passes because they make changes to the top-level module.
-
-The bulk of the bufferization work is done by the function passes. Most of these
-passes are provided as part of the upstream MLIR distribution and bufferize
-their respective dialects (e.g. `abc-bufferize` bufferizes the `abc` dialect).
-The `tcp-bufferize` pass is an exception -- it is a partial bufferization pass
-used to bufferize the downstream `tcp` dialect, and fits in perfectly with all
-the other passes provided upstream.
-
-The last pass is the finalizing bufferization pass. The `mlir-npcomp` reference
-backend has arranged that all ops are bufferized by partial bufferizations, so
-that the upstream `finalizing-bufferize` pass can be used as the finalizing
-bufferization pass. This gives excellent diagnostics when something goes wrong
-with the bufferization process, such as due to an op that wasn't handled by any
-pattern.
-
-### How to write a partial bufferization pass
-
-The contract of a partial bufferization pass is that a subset of ops (or kinds
-of ops, customizable by a ConversionTarget) get bufferized.
-
-A partial bufferization pass is just a pass that uses the
-[dialect conversion](DialectConversion.md) framework to apply
-`ConversionPattern`s with a `tensor` to `memref` type conversion.
-
-To describe how to write such a pass, we will walk through an example, the
-`tensor-bufferize` pass
-([code](https://github.com/llvm/llvm-project/blob/bc8acf2ce8ad6e8c9b1d97b2e02d3f4ad26e1d9d/mlir/lib/Dialect/Tensor/Transforms/Bufferize.cpp#L23),
-[test](https://github.com/llvm/llvm-project/blob/bc8acf2ce8ad6e8c9b1d97b2e02d3f4ad26e1d9d/mlir/test/Dialect/Tensor/bufferize.mlir#L1))
-that bufferizes the `tensor` dialect. Note that these passes have been replaced
-with a `BufferizableOpInterface`-based implementation in the meantime, so we
-have to take a looker at an older version of the code.
-
-The bulk of the code in the pass will be a set of conversion patterns, with a
-simple example being
-[BufferizeCastOp](https://github.com/llvm/llvm-project/blob/2bf6e443e54604c7818c4d1a1837f3d091023270/mlir/lib/Dialect/Tensor/Transforms/Bufferize.cpp#L23)).
-
-```
-class BufferizeCastOp : public OpConversionPattern<tensor::CastOp> {
-public:
-  using OpConversionPattern::OpConversionPattern;
-  LogicalResult
-  matchAndRewrite(tensor::CastOp op, OpAdaptor adaptor,
-                  ConversionPatternRewriter &rewriter) const override {
-    auto resultType = getTypeConverter()->convertType(op.getType());
-    rewriter.replaceOpWithNewOp<MemRefCastOp>(op, resultType, adaptor.source());
-    return success();
-  }
-};
-```
-
-See [the talk](#the-talk) for more details on how to write these patterns.
-
-The
-[pass itself](https://github.com/llvm/llvm-project/blob/bc8acf2ce8ad6e8c9b1d97b2e02d3f4ad26e1d9d/mlir/lib/Dialect/Tensor/Transforms/Bufferize.cpp#L57)
-is very small, and follows the basic pattern of any dialect conversion pass.
-
-```
-void mlir::populateTensorBufferizePatterns(
-    const BufferizeTypeConverter &typeConverter, RewritePatternSet &patterns) {
-  patterns.add<BufferizeCastOp, BufferizeExtractOp>(typeConverter,
-                                                    patterns.getContext());
-}
-
-struct TensorBufferizePass : public TensorBufferizeBase<TensorBufferizePass> {
-  void runOnOperation() override {
-    auto *context = &getContext();
-    BufferizeTypeConverter typeConverter;
-    RewritePatternSet patterns(context);
-    ConversionTarget target(*context);
-
-    populateTensorBufferizePatterns(typeConverter, patterns);
-    target.addIllegalOp<tensor::CastOp, tensor::ExtractOp>();
-    target.addLegalDialect<func::FuncDialect>();
-
-    if (failed(
-            applyPartialConversion(getOperation(), target, std::move(patterns))))
-      signalPassFailure();
-  }
-};
-```
-
-The pass has all the hallmarks of a dialect conversion pass that does type
-conversions: a `TypeConverter`, a `RewritePatternSet`, and a `ConversionTarget`,
-and a call to `applyPartialConversion`. Note that a function
-`populateTensorBufferizePatterns` is separated, so that power users can use the
-patterns independently, if necessary (such as to combine multiple sets of
-conversion patterns into a single conversion call, for performance).
-
-One convenient utility provided by the MLIR bufferization infrastructure is the
-`BufferizeTypeConverter`, which comes pre-loaded with the necessary conversions
-and materializations between `tensor` and `memref`.
-
-In this case, the `BufferizationOpsDialect` is marked as legal, so the
-`bufferization.to_tensor` and `bufferization.to_memref` ops, which are inserted
-automatically by the dialect conversion framework as materializations, are
-legal. There is a helper `populateBufferizeMaterializationLegality`
-([code](https://github.com/llvm/llvm-project/blob/a0b65a7bcd6065688189b3d678c42ed6af9603db/mlir/include/mlir/Transforms/Bufferize.h#L53))
-which helps with this in general.
-
-### Other partial bufferization examples
-
--   `func-bufferize`
-    ([code](https://github.com/llvm/llvm-project/blob/2f5715dc78328215d51d5664c72c632a6dac1046/mlir/lib/Dialect/Func/Transforms/FuncBufferize.cpp#L1),
-    [test](https://github.com/llvm/llvm-project/blob/2f5715dc78328215d51d5664c72c632a6dac1046/mlir/test/Dialect/Func/func-bufferize.mlir#L1))
-
-    -   Bufferizes `func`, `call`, and `BranchOpInterface` ops.
-    -   This is an example of how to bufferize ops that have multi-block
-        regions.
-    -   This is an example of a pass that is not split along dialect
-        subdivisions.
-
-### How to write a finalizing bufferization pass
-
-The contract of a finalizing bufferization pass is that all tensors are gone
-from the program.
-
-The easiest way to write a finalizing bufferize pass is to not write one at all!
-MLIR provides a pass `finalizing-bufferize` which eliminates the
-`bufferization.to_tensor` / `bufferization.to_memref` materialization ops
-inserted by partial bufferization passes and emits an error if that is not
-sufficient to remove all tensors from the program.
-
-This pass is sufficient when partial bufferization passes have bufferized all
-the ops in the program, leaving behind only the materializations. When possible,
-it is recommended to structure your pass pipeline this way, as this has the
-significant advantage that if an op does not get bufferized (due to a missing
-pattern, bug in the code, etc.), `finalizing-bufferize` will emit a nice clean
-error, and the IR seen by `finalizing-bufferize` will only contain only one
-unbufferized op.
-
-However, before the current bufferization infrastructure was put in place,
-bufferization could only be done as a single finalizing bufferization mega-pass
-that used the `populate*BufferizePatterns` functions from multiple dialects to
-simultaneously bufferize everything at once. Thus, one might see code in
-downstream projects structured this way. This structure is not recommended in
-new code. A helper, `populateEliminateBufferizeMaterializationsPatterns`
-([code](https://github.com/llvm/llvm-project/blob/a0b65a7bcd6065688189b3d678c42ed6af9603db/mlir/include/mlir/Transforms/Bufferize.h#L58))
-is available for such passes to provide patterns that eliminate
-`bufferization.to_tensor` and `bufferization.to_memref`.
-
-### Changes since [the talk](#the-talk)
-
--   `func-bufferize` was changed to be a partial conversion pass, and there is a
-    new `finalizing-bufferize` which serves as a general finalizing
-    bufferization pass.
--   Most partial bufferization passes have been reimplemented in terms of
-    `BufferizableOpInterface`. New users should use One-Shot Bufferize instead
-    of dialect conversion-based bufferization.
diff --git a/mlir/include/mlir/Dialect/Func/Transforms/Passes.h b/mlir/include/mlir/Dialect/Func/Transforms/Passes.h
index 011ad3e3d0be4d..02fc9e1d934390 100644
--- a/mlir/include/mlir/Dialect/Func/Transforms/Passes.h
+++ b/mlir/include/mlir/Dialect/Func/Transforms/Passes.h
@@ -29,9 +29,6 @@ namespace func {
 #define GEN_PASS_DECL
 #include "mlir/Dialect/Func/Transforms/Passes.h.inc"
 
-/// Creates an instance of func bufferization pass.
-std::unique_ptr<Pass> createFuncBufferizePass();
-
 /// Pass to deduplicate functions.
 std::unique_ptr<Pass> createDuplicateFunctionEliminationPass();
 
diff --git a/mlir/include/mlir/Dialect/Func/Transforms/Passes.td b/mlir/include/mlir/Dialect/Func/Transforms/Passes.td
index 8f6dbcb1ee653a..c3caf120d052e2 100644
--- a/mlir/include/mlir/Dialect/Func/Transforms/Passes.td
+++ b/mlir/include/mlir/Dialect/Func/Transforms/Passes.td
@@ -11,35 +11,6 @@
 
 include "mlir/Pass/PassBase.td"
 
-def FuncBufferize : Pass<"func-bufferize", "ModuleOp"> {
-  let summary = "Bufferize func/call/return ops";
-  let description = [{
-    A bufferize pass that bufferizes func.func and func.call ops.
-
-    Because this pass updates func.func ops, it must be a module pass. It is
-    useful to keep this pass separate from other bufferizations so that the
-    other ones can be run at function-level in parallel.
-
-    This pass must be done atomically because it changes func op signatures,
-    which requires atomically updating calls as well throughout the entire
-    module.
-
-    This pass also changes the type of block arguments, which requires that all
-    successor arguments of predecessors be converted. This is achieved by
-    rewriting terminators based on the information provided by the
-    `BranchOpInterface`.
-    As this pass rewrites function operations, it also rewrites the
-    corresponding return operations. Other return-like operations that
-    implement the `ReturnLike` trait are not rewritten in general, as they
-    require that the corresponding parent operation is also rewritten.
-    Finally, this pass fails for unknown terminators, as we cannot decide
-    whether they need rewriting.
-  }];
-  let constructor = "mlir::func::createFuncBufferizePass()";
-  let dependentDialects = ["bufferization::BufferizationDialect",
-                           "memref::MemRefDialect"];
-}
-
 def DuplicateFunctionEliminationPass : Pass<"duplicate-function-elimination",
     "ModuleOp"> {
   let summary = "Deduplicate functions";
diff --git a/mlir/lib/Dialect/Func/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Func/Transforms/CMakeLists.txt
index 172019907c3a8a..f8fb1f436a95b1 100644
--- a/mlir/lib/Dialect/Func/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Func/Transforms/CMakeLists.txt
@@ -1,7 +1,6 @@
 add_mlir_dialect_library(MLIRFuncTransforms
   DecomposeCallGraphTypes.cpp
   DuplicateFunctionElimination.cpp
-  FuncBufferize.cpp
   FuncConversions.cpp
   OneToNFuncConversions.cpp
 
@@ -12,8 +11,6 @@ add_mlir_dialect_library(MLIRFuncTransforms
   MLIRFuncTransformsIncGen
 
   LINK_LIBS PUBLIC
-  MLIRBufferizationDialect
-  MLIRBufferizationTransforms
   MLIRFuncDialect
   MLIRIR
   MLIRMemRefDialect
diff --git a/mlir/lib/Dialect/Func/Transforms/FuncBufferize.cpp b/mlir/lib/Dialect/Func/Transforms/FuncBufferize.cpp
deleted file mode 100644
index 5f4fed8e4d491b..00000000000000
--- a/mlir/lib/Dialect/Func/Transforms/FuncBufferize.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-//===- Bufferize.cpp - Bufferization for func ops -------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements bufferization of func.func's and func.call's.
-//
-//===----------------------------------------------------------------------===//
-
-#include "mlir/Dialect/Func/Transforms/Passes.h"
-
-#include "mlir/Dialect/Bufferization/IR/Bufferization.h"
-#include "mlir/Dialect/Bufferization/Transforms/Bufferize.h"
-#include "mlir/Dialect/Func/IR/FuncOps.h"
-#include "mlir/Dialect/Func/Transforms/FuncConversions.h"
-#include "mlir/Dialect/MemRef/IR/MemRef.h"
-#include "mlir/Transforms/DialectConversion.h"
-
-namespace mlir {
-#define GEN_PASS_DEF_FUNCBUFFERIZE
-#include "mlir/Dialect/Func/Transforms/Passes.h.inc"
-} // namespace...
[truncated]

matthias-springer added a commit that referenced this pull request Oct 29, 2024
The dialect conversion-based bufferization passes have been migrated to One-Shot Bufferize about two years ago. To clean up the code base, this commit removes the `finalizing-bufferize` pass, one of the few remaining parts of the old infrastructure. Most bufferization passes have already been removed.

Note for LLVM integration: If you depend on this pass, migrate to One-Shot Bufferize or copy the pass to your codebase.

Depends on #114152.
@matthias-springer matthias-springer force-pushed the users/matthias-springer/bufferization_unique_returns branch from 684ac4a to 40c5042 Compare October 30, 2024 22:27
@matthias-springer matthias-springer force-pushed the users/matthias-springer/remove-func-bufferize-pass branch from be96e32 to d491c19 Compare October 30, 2024 22:29
matthias-springer added a commit that referenced this pull request Oct 30, 2024
The dialect conversion-based bufferization passes have been migrated to One-Shot Bufferize about two years ago. To clean up the code base, this commit removes the `finalizing-bufferize` pass, one of the few remaining parts of the old infrastructure. Most bufferization passes have already been removed.

Note for LLVM integration: If you depend on this pass, migrate to One-Shot Bufferize or copy the pass to your codebase.

Depends on #114152.
@matthias-springer matthias-springer force-pushed the users/matthias-springer/bufferization_unique_returns branch 2 times, most recently from 3f7f8a7 to 52d1a20 Compare November 10, 2024 04:40
@matthias-springer matthias-springer force-pushed the users/matthias-springer/bufferization_unique_returns branch from 52d1a20 to 1122ffe Compare November 12, 2024 12:59
Base automatically changed from users/matthias-springer/bufferization_unique_returns to main November 12, 2024 23:51
The dialect conversion-based bufferization passes have been migrated to One-Shot Bufferize about two years ago. To clean up the code base, this commit removes the `func-bufferize` pass, one of the few remaining parts of the old infrastructure. Most bufferization passes have already been removed.

Note for LLVM integration: If you depend on this pass, migrate to One-Shot Bufferize or copy the pass to your codebase.
@matthias-springer matthias-springer force-pushed the users/matthias-springer/remove-func-bufferize-pass branch from d491c19 to 34218ee Compare November 12, 2024 23:54
matthias-springer added a commit that referenced this pull request Nov 14, 2024
The dialect conversion-based bufferization passes have been migrated to One-Shot Bufferize about two years ago. To clean up the code base, this commit removes the `finalizing-bufferize` pass, one of the few remaining parts of the old infrastructure. Most bufferization passes have already been removed.

Note for LLVM integration: If you depend on this pass, migrate to One-Shot Bufferize or copy the pass to your codebase.

Depends on #114152.
@matthias-springer
Copy link
Member Author

@javedabsar1 Is this good to merge?

Copy link
Contributor

@javedabsar1 javedabsar1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The implementation (partial bufferization) is being deleted so no point keeping documentation for it.

@matthias-springer matthias-springer merged commit e394fec into main Nov 20, 2024
8 checks passed
@matthias-springer matthias-springer deleted the users/matthias-springer/remove-func-bufferize-pass branch November 20, 2024 00:29
@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 20, 2024

LLVM Buildbot has detected a new failure on builder mlir-rocm-mi200 running on mi200-buildbot while building mlir at step 6 "test-build-check-mlir-build-only-check-mlir".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/177/builds/8605

Here is the relevant piece of the build log for the reference
Step 6 (test-build-check-mlir-build-only-check-mlir) failure: test (failure)
******************** TEST 'MLIR :: Integration/Dialect/MemRef/verify-memref.mlir' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 1
/vol/worker/mi200-buildbot/mlir-rocm-mi200/build/bin/mlir-opt /vol/worker/mi200-buildbot/mlir-rocm-mi200/llvm-project/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir    -one-shot-bufferize="bufferize-function-boundaries" --canonicalize    -convert-vector-to-scf -convert-scf-to-cf -convert-vector-to-llvm -finalize-memref-to-llvm   -convert-func-to-llvm -reconcile-unrealized-casts | /vol/worker/mi200-buildbot/mlir-rocm-mi200/build/bin/mlir-cpu-runner   -e entry -entry-point-result=void   -shared-libs=/vol/worker/mi200-buildbot/mlir-rocm-mi200/build/lib/libmlir_c_runner_utils.so,/vol/worker/mi200-buildbot/mlir-rocm-mi200/build/lib/libmlir_runner_utils.so | /vol/worker/mi200-buildbot/mlir-rocm-mi200/build/bin/FileCheck /vol/worker/mi200-buildbot/mlir-rocm-mi200/llvm-project/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir
# executed command: /vol/worker/mi200-buildbot/mlir-rocm-mi200/build/bin/mlir-opt /vol/worker/mi200-buildbot/mlir-rocm-mi200/llvm-project/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir -one-shot-bufferize=bufferize-function-boundaries --canonicalize -convert-vector-to-scf -convert-scf-to-cf -convert-vector-to-llvm -finalize-memref-to-llvm -convert-func-to-llvm -reconcile-unrealized-casts
# .---command stderr------------
# | /vol/worker/mi200-buildbot/mlir-rocm-mi200/llvm-project/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir:36:10: error: 'tensor.cast' op not bufferizable under the given constraints: cannot avoid RaW conflict
# |     %1 = tensor.cast %i8 : tensor<3x3xi8> to tensor<*xi8>
# |          ^
# | /vol/worker/mi200-buildbot/mlir-rocm-mi200/llvm-project/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir:36:10: note: see current operation: %11 = "tensor.cast"(%0) : (tensor<3x3xi8>) -> tensor<*xi8>
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /vol/worker/mi200-buildbot/mlir-rocm-mi200/build/bin/mlir-cpu-runner -e entry -entry-point-result=void -shared-libs=/vol/worker/mi200-buildbot/mlir-rocm-mi200/build/lib/libmlir_c_runner_utils.so,/vol/worker/mi200-buildbot/mlir-rocm-mi200/build/lib/libmlir_runner_utils.so
# .---command stderr------------
# | Error: entry point not found
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /vol/worker/mi200-buildbot/mlir-rocm-mi200/build/bin/FileCheck /vol/worker/mi200-buildbot/mlir-rocm-mi200/llvm-project/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  /vol/worker/mi200-buildbot/mlir-rocm-mi200/build/bin/FileCheck /vol/worker/mi200-buildbot/mlir-rocm-mi200/llvm-project/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir
# `-----------------------------
# error: command failed with exit status: 2

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 20, 2024

LLVM Buildbot has detected a new failure on builder mlir-nvidia-gcc7 running on mlir-nvidia while building mlir at step 6 "test-build-check-mlir-build-only-check-mlir".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/116/builds/6590

Here is the relevant piece of the build log for the reference
Step 6 (test-build-check-mlir-build-only-check-mlir) failure: test (failure)
******************** TEST 'MLIR :: Integration/Dialect/MemRef/verify-memref.mlir' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 1
/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.obj/bin/mlir-opt /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir    -one-shot-bufferize="bufferize-function-boundaries" --canonicalize    -convert-vector-to-scf -convert-scf-to-cf -convert-vector-to-llvm -finalize-memref-to-llvm   -convert-func-to-llvm -reconcile-unrealized-casts | /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.obj/bin/mlir-cpu-runner   -e entry -entry-point-result=void   -shared-libs=/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.obj/lib/libmlir_c_runner_utils.so,/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.obj/lib/libmlir_runner_utils.so | /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.obj/bin/FileCheck /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir
# executed command: /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.obj/bin/mlir-opt /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir -one-shot-bufferize=bufferize-function-boundaries --canonicalize -convert-vector-to-scf -convert-scf-to-cf -convert-vector-to-llvm -finalize-memref-to-llvm -convert-func-to-llvm -reconcile-unrealized-casts
# .---command stderr------------
# | /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir:36:10: error: 'tensor.cast' op not bufferizable under the given constraints: cannot avoid RaW conflict
# |     %1 = tensor.cast %i8 : tensor<3x3xi8> to tensor<*xi8>
# |          ^
# | /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir:36:10: note: see current operation: %11 = "tensor.cast"(%0) : (tensor<3x3xi8>) -> tensor<*xi8>
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.obj/bin/mlir-cpu-runner -e entry -entry-point-result=void -shared-libs=/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.obj/lib/libmlir_c_runner_utils.so,/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.obj/lib/libmlir_runner_utils.so
# .---command stderr------------
# | Error: entry point not found
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.obj/bin/FileCheck /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.obj/bin/FileCheck /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir
# `-----------------------------
# error: command failed with exit status: 2

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 20, 2024

LLVM Buildbot has detected a new failure on builder mlir-nvidia running on mlir-nvidia while building mlir at step 5 "build-check-mlir-build-only".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/138/builds/6655

Here is the relevant piece of the build log for the reference
Step 5 (build-check-mlir-build-only) failure: build (failure)
...
24.350 [471/16/4533] Creating library symlink lib/libLLVMX86Disassembler.so
24.357 [470/16/4534] Building CXX object tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/lib/Bindings/Python/MainModule.cpp.o
24.364 [469/16/4535] Building CXX object tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/lib/Bindings/Python/IRAffine.cpp.o
24.373 [468/16/4536] Building CXX object tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/lib/Bindings/Python/IRInterfaces.cpp.o
24.380 [467/16/4537] Building CXX object tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/lib/Bindings/Python/IRModule.cpp.o
24.387 [466/16/4538] Building CXX object tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/lib/Bindings/Python/IRAttributes.cpp.o
24.388 [465/16/4539] Building CXX object tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/lib/Bindings/Python/IRCore.cpp.o
24.394 [464/16/4540] Building CXX object tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/lib/Bindings/Python/IRTypes.cpp.o
24.403 [463/16/4541] Building CXX object tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/lib/Bindings/Python/Pass.cpp.o
24.404 [462/16/4542] Linking CXX shared library lib/libMLIRArithTransforms.so.20.0git
FAILED: lib/libMLIRArithTransforms.so.20.0git 
: && /usr/bin/clang++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Werror=mismatched-tags -Werror=global-constructors -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete -fuse-ld=lld -Wl,--color-diagnostics   -Wl,--gc-sections -shared -Wl,-soname,libMLIRArithTransforms.so.20.0git -o lib/libMLIRArithTransforms.so.20.0git tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferDeallocationOpInterfaceImpl.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferViewFlowOpInterfaceImpl.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/EmulateUnsupportedFloats.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/EmulateWideInt.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/EmulateNarrowType.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/ExpandOps.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/IntRangeOptimizations.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/ReifyValueBounds.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/UnsignedWhenEquivalent.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/vol/worker/mlir-nvidia/mlir-nvidia/llvm.obj/lib:"  lib/libMLIRFuncTransforms.so.20.0git  lib/libMLIRTransforms.so.20.0git  lib/libMLIRTransformUtils.so.20.0git  lib/libMLIRVectorDialect.so.20.0git  lib/libMLIRFuncDialect.so.20.0git  lib/libMLIRSubsetOpInterface.so.20.0git  lib/libMLIRRewrite.so.20.0git  lib/libMLIRRewritePDL.so.20.0git  lib/libMLIRPDLToPDLInterp.so.20.0git  lib/libMLIRPass.so.20.0git  lib/libMLIRPDLInterpDialect.so.20.0git  lib/libMLIRPDLDialect.so.20.0git  lib/libMLIRRuntimeVerifiableOpInterface.so.20.0git  lib/libMLIRTensorDialect.so.20.0git  lib/libMLIRParallelCombiningOpInterface.so.20.0git  lib/libMLIRAffineDialect.so.20.0git  lib/libMLIRMemRefDialect.so.20.0git  lib/libMLIRArithUtils.so.20.0git  lib/libMLIRComplexDialect.so.20.0git  lib/libMLIRArithDialect.so.20.0git  lib/libMLIRCastInterfaces.so.20.0git  lib/libMLIRInferIntRangeCommon.so.20.0git  lib/libMLIRDialect.so.20.0git  lib/libMLIRMemorySlotInterfaces.so.20.0git  lib/libMLIRValueBoundsOpInterface.so.20.0git  lib/libMLIRAnalysis.so.20.0git  lib/libMLIRInferIntRangeInterface.so.20.0git  lib/libMLIRCallInterfaces.so.20.0git  lib/libMLIRControlFlowInterfaces.so.20.0git  lib/libMLIRDataLayoutInterfaces.so.20.0git  lib/libMLIRPresburger.so.20.0git  lib/libMLIRViewLikeInterface.so.20.0git  lib/libMLIRInferTypeOpInterface.so.20.0git  lib/libMLIRLoopLikeInterface.so.20.0git  lib/libMLIRFunctionInterfaces.so.20.0git  lib/libMLIRSideEffectInterfaces.so.20.0git  lib/libMLIRUBDialect.so.20.0git  lib/libMLIRDialectUtils.so.20.0git  lib/libMLIRShapedOpInterfaces.so.20.0git  lib/libMLIRDestinationStyleOpInterface.so.20.0git  lib/libMLIRMaskableOpInterface.so.20.0git  lib/libMLIRMaskingOpInterface.so.20.0git  lib/libMLIRVectorInterfaces.so.20.0git  lib/libMLIRIR.so.20.0git  lib/libMLIRSupport.so.20.0git  lib/libLLVMSupport.so.20.0git  -Wl,-rpath-link,/vol/worker/mlir-nvidia/mlir-nvidia/llvm.obj/lib && :
ld.lld: error: undefined symbol: mlir::bufferization::DeallocationState::getOwnership(mlir::Value, mlir::Block*) const
>>> referenced by BufferDeallocationOpInterfaceImpl.cpp
>>>               tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferDeallocationOpInterfaceImpl.cpp.o:(mlir::bufferization::detail::BufferDeallocationOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::SelectOpInterface>::materializeUniqueOwnershipForMemref(mlir::bufferization::detail::BufferDeallocationOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::bufferization::DeallocationState&, mlir::bufferization::DeallocationOptions const&, mlir::OpBuilder&, mlir::Value))
>>> referenced by BufferDeallocationOpInterfaceImpl.cpp
>>>               tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferDeallocationOpInterfaceImpl.cpp.o:(mlir::bufferization::detail::BufferDeallocationOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::SelectOpInterface>::materializeUniqueOwnershipForMemref(mlir::bufferization::detail::BufferDeallocationOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::bufferization::DeallocationState&, mlir::bufferization::DeallocationOptions const&, mlir::OpBuilder&, mlir::Value))
>>> referenced by BufferDeallocationOpInterfaceImpl.cpp
>>>               tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferDeallocationOpInterfaceImpl.cpp.o:(mlir::bufferization::detail::BufferDeallocationOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::SelectOpInterface>::materializeUniqueOwnershipForMemref(mlir::bufferization::detail::BufferDeallocationOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::bufferization::DeallocationState&, mlir::bufferization::DeallocationOptions const&, mlir::OpBuilder&, mlir::Value))
>>> referenced 1 more times

ld.lld: error: undefined symbol: mlir::bufferization::Ownership::isUnique() const
>>> referenced by BufferDeallocationOpInterfaceImpl.cpp
>>>               tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferDeallocationOpInterfaceImpl.cpp.o:(mlir::bufferization::detail::BufferDeallocationOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::SelectOpInterface>::materializeUniqueOwnershipForMemref(mlir::bufferization::detail::BufferDeallocationOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::bufferization::DeallocationState&, mlir::bufferization::DeallocationOptions const&, mlir::OpBuilder&, mlir::Value))
>>> referenced by BufferDeallocationOpInterfaceImpl.cpp
>>>               tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferDeallocationOpInterfaceImpl.cpp.o:(mlir::bufferization::detail::BufferDeallocationOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::SelectOpInterface>::materializeUniqueOwnershipForMemref(mlir::bufferization::detail::BufferDeallocationOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::bufferization::DeallocationState&, mlir::bufferization::DeallocationOptions const&, mlir::OpBuilder&, mlir::Value))

ld.lld: error: undefined symbol: mlir::bufferization::Ownership::getIndicator() const
>>> referenced by BufferDeallocationOpInterfaceImpl.cpp
>>>               tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferDeallocationOpInterfaceImpl.cpp.o:(mlir::bufferization::detail::BufferDeallocationOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::SelectOpInterface>::materializeUniqueOwnershipForMemref(mlir::bufferization::detail::BufferDeallocationOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::bufferization::DeallocationState&, mlir::bufferization::DeallocationOptions const&, mlir::OpBuilder&, mlir::Value))
>>> referenced by BufferDeallocationOpInterfaceImpl.cpp
>>>               tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferDeallocationOpInterfaceImpl.cpp.o:(mlir::bufferization::detail::BufferDeallocationOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::SelectOpInterface>::materializeUniqueOwnershipForMemref(mlir::bufferization::detail::BufferDeallocationOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::bufferization::DeallocationState&, mlir::bufferization::DeallocationOptions const&, mlir::OpBuilder&, mlir::Value))

ld.lld: error: undefined symbol: mlir::bufferization::DeallocationState::getMemrefWithUniqueOwnership(mlir::OpBuilder&, mlir::Value, mlir::Block*)
>>> referenced by BufferDeallocationOpInterfaceImpl.cpp
>>>               tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferDeallocationOpInterfaceImpl.cpp.o:(mlir::bufferization::detail::BufferDeallocationOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::SelectOpInterface>::materializeUniqueOwnershipForMemref(mlir::bufferization::detail::BufferDeallocationOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::bufferization::DeallocationState&, mlir::bufferization::DeallocationOptions const&, mlir::OpBuilder&, mlir::Value))

ld.lld: error: undefined symbol: mlir::bufferization::detail::defaultResultBufferizesToMemoryWrite(mlir::OpResult, mlir::bufferization::AnalysisState const&)
>>> referenced by BufferizableOpInterfaceImpl.cpp
>>>               tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o:(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::ConstantOpInterface>::resultBufferizesToMemoryWrite(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::OpResult, mlir::bufferization::AnalysisState const&))
>>> referenced by BufferizableOpInterfaceImpl.cpp
>>>               tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o:(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::IndexCastOpInterface>::resultBufferizesToMemoryWrite(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::OpResult, mlir::bufferization::AnalysisState const&))
>>> referenced by BufferizableOpInterfaceImpl.cpp
>>>               tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o:(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::SelectOpInterface>::resultBufferizesToMemoryWrite(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::OpResult, mlir::bufferization::AnalysisState const&))

ld.lld: error: undefined symbol: mlir::bufferization::detail::defaultGetAliasingOpOperands(mlir::Value, mlir::bufferization::AnalysisState const&)
>>> referenced by BufferizableOpInterfaceImpl.cpp
>>>               tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o:(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::ConstantOpInterface>::getAliasingOpOperands(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::Value, mlir::bufferization::AnalysisState const&))
>>> referenced by BufferizableOpInterfaceImpl.cpp

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 20, 2024

LLVM Buildbot has detected a new failure on builder flang-aarch64-libcxx running on linaro-flang-aarch64-libcxx while building mlir at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/89/builds/10908

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
47.240 [1857/33/5385] Building CXX object tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaAccess.cpp.o
47.242 [1857/32/5386] Building CXX object tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/ParsedAttr.cpp.o
47.244 [1857/31/5387] Building CXX object tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaARM.cpp.o
47.245 [1857/30/5388] Building CXX object tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaAPINotes.cpp.o
47.247 [1857/29/5389] Building CXX object tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaBPF.cpp.o
47.254 [1857/28/5390] Building CXX object tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaConsumer.cpp.o
47.269 [1857/27/5391] Building CXX object tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaBase.cpp.o
47.272 [1857/26/5392] Building CXX object tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaBoundsSafety.cpp.o
47.277 [1857/25/5393] Building CXX object tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaChecking.cpp.o
47.294 [1843/38/5394] Linking CXX shared library lib/libMLIRArithTransforms.so.20.0git
FAILED: lib/libMLIRArithTransforms.so.20.0git 
: && /usr/local/bin/c++ -fPIC -stdlib=libc++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Werror=mismatched-tags -Werror=global-constructors -O3 -DNDEBUG  -stdlib=libc++ -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-libcxx/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libMLIRArithTransforms.so.20.0git -o lib/libMLIRArithTransforms.so.20.0git tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferDeallocationOpInterfaceImpl.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferViewFlowOpInterfaceImpl.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/EmulateUnsupportedFloats.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/EmulateWideInt.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/EmulateNarrowType.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/ExpandOps.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/IntRangeOptimizations.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/ReifyValueBounds.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/UnsignedWhenEquivalent.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/tcwg-buildbot/worker/flang-aarch64-libcxx/build/lib:"  lib/libMLIRFuncTransforms.so.20.0git  lib/libMLIRTransforms.so.20.0git  lib/libMLIRTransformUtils.so.20.0git  lib/libMLIRVectorDialect.so.20.0git  lib/libMLIRFuncDialect.so.20.0git  lib/libMLIRSubsetOpInterface.so.20.0git  lib/libMLIRRewrite.so.20.0git  lib/libMLIRRewritePDL.so.20.0git  lib/libMLIRPDLToPDLInterp.so.20.0git  lib/libMLIRPass.so.20.0git  lib/libMLIRPDLInterpDialect.so.20.0git  lib/libMLIRPDLDialect.so.20.0git  lib/libMLIRRuntimeVerifiableOpInterface.so.20.0git  lib/libMLIRTensorDialect.so.20.0git  lib/libMLIRParallelCombiningOpInterface.so.20.0git  lib/libMLIRAffineDialect.so.20.0git  lib/libMLIRMemRefDialect.so.20.0git  lib/libMLIRArithUtils.so.20.0git  lib/libMLIRComplexDialect.so.20.0git  lib/libMLIRArithDialect.so.20.0git  lib/libMLIRCastInterfaces.so.20.0git  lib/libMLIRInferIntRangeCommon.so.20.0git  lib/libMLIRDialect.so.20.0git  lib/libMLIRMemorySlotInterfaces.so.20.0git  lib/libMLIRValueBoundsOpInterface.so.20.0git  lib/libMLIRAnalysis.so.20.0git  lib/libMLIRInferIntRangeInterface.so.20.0git  lib/libMLIRCallInterfaces.so.20.0git  lib/libMLIRControlFlowInterfaces.so.20.0git  lib/libMLIRDataLayoutInterfaces.so.20.0git  lib/libMLIRPresburger.so.20.0git  lib/libMLIRViewLikeInterface.so.20.0git  lib/libMLIRInferTypeOpInterface.so.20.0git  lib/libMLIRLoopLikeInterface.so.20.0git  lib/libMLIRFunctionInterfaces.so.20.0git  lib/libMLIRSideEffectInterfaces.so.20.0git  lib/libMLIRUBDialect.so.20.0git  lib/libMLIRDialectUtils.so.20.0git  lib/libMLIRShapedOpInterfaces.so.20.0git  lib/libMLIRDestinationStyleOpInterface.so.20.0git  lib/libMLIRMaskableOpInterface.so.20.0git  lib/libMLIRMaskingOpInterface.so.20.0git  lib/libMLIRVectorInterfaces.so.20.0git  lib/libMLIRIR.so.20.0git  lib/libMLIRSupport.so.20.0git  lib/libLLVMSupport.so.20.0git  -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-libcxx/build/lib && :
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferDeallocationOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferDeallocationOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::SelectOpInterface>::materializeUniqueOwnershipForMemref(mlir::bufferization::detail::BufferDeallocationOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::bufferization::DeallocationState&, mlir::bufferization::DeallocationOptions const&, mlir::OpBuilder&, mlir::Value)':
BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0x90): undefined reference to `mlir::bufferization::DeallocationState::getOwnership(mlir::Value, mlir::Block*) const'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0x9c): undefined reference to `mlir::bufferization::Ownership::isUnique() const'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0xb4): undefined reference to `mlir::bufferization::DeallocationState::getOwnership(mlir::Value, mlir::Block*) const'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0xc0): undefined reference to `mlir::bufferization::Ownership::isUnique() const'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0xe4): undefined reference to `mlir::bufferization::DeallocationState::getOwnership(mlir::Value, mlir::Block*) const'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0xf0): undefined reference to `mlir::bufferization::Ownership::getIndicator() const'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0x108): undefined reference to `mlir::bufferization::DeallocationState::getOwnership(mlir::Value, mlir::Block*) const'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0x114): undefined reference to `mlir::bufferization::Ownership::getIndicator() const'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0x18c): undefined reference to `mlir::bufferization::DeallocationState::getMemrefWithUniqueOwnership(mlir::OpBuilder&, mlir::Value, mlir::Block*)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::ConstantOpInterface>::resultBufferizesToMemoryWrite(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::OpResult, mlir::bufferization::AnalysisState const&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_119ConstantOpInterfaceEE29resultBufferizesToMemoryWriteEPKNS2_7ConceptEPNS_9OperationENS_8OpResultERKNS0_13AnalysisStateE+0x5c): undefined reference to `mlir::bufferization::detail::defaultResultBufferizesToMemoryWrite(mlir::OpResult, mlir::bufferization::AnalysisState const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::ConstantOpInterface>::getAliasingOpOperands(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::Value, mlir::bufferization::AnalysisState const&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_119ConstantOpInterfaceEE21getAliasingOpOperandsEPKNS2_7ConceptEPNS_9OperationENS_5ValueERKNS0_13AnalysisStateE+0x44): undefined reference to `mlir::bufferization::detail::defaultGetAliasingOpOperands(mlir::Value, mlir::bufferization::AnalysisState const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::ConstantOpInterface>::resolveConflicts(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::RewriterBase&, mlir::bufferization::AnalysisState const&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_119ConstantOpInterfaceEE16resolveConflictsEPKNS2_7ConceptEPNS_9OperationERNS_12RewriterBaseERKNS0_13AnalysisStateE+0x70): undefined reference to `mlir::bufferization::BufferizableOpInterface::resolveTensorOpOperandConflicts(mlir::RewriterBase&, mlir::bufferization::AnalysisState const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::ConstantOpInterface>::bufferize(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::RewriterBase&, mlir::bufferization::BufferizationOptions const&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_119ConstantOpInterfaceEE9bufferizeEPKNS2_7ConceptEPNS_9OperationERNS_12RewriterBaseERKNS0_20BufferizationOptionsE+0xec): undefined reference to `mlir::bufferization::getGlobalFor(mlir::arith::ConstantOp, unsigned long, mlir::Attribute)'
/usr/bin/ld: BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_119ConstantOpInterfaceEE9bufferizeEPKNS2_7ConceptEPNS_9OperationERNS_12RewriterBaseERKNS0_20BufferizationOptionsE+0x160): undefined reference to `mlir::bufferization::replaceOpWithBufferizedValues(mlir::RewriterBase&, mlir::Operation*, mlir::ValueRange)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::ConstantOpInterface>::getBufferType(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::Value, mlir::bufferization::BufferizationOptions const&, llvm::SmallVector<mlir::Value, 6u>&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_119ConstantOpInterfaceEE13getBufferTypeEPKNS2_7ConceptEPNS_9OperationENS_5ValueERKNS0_20BufferizationOptionsERN4llvm11SmallVectorISC_Lj6EEE+0x28): undefined reference to `mlir::bufferization::getOwnerOfValue(mlir::Value)'
/usr/bin/ld: BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_119ConstantOpInterfaceEE13getBufferTypeEPKNS2_7ConceptEPNS_9OperationENS_5ValueERKNS0_20BufferizationOptionsERN4llvm11SmallVectorISC_Lj6EEE+0x94): undefined reference to `mlir::bufferization::detail::defaultGetBufferType(mlir::Value, mlir::bufferization::BufferizationOptions const&, llvm::SmallVector<mlir::Value, 6u>&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::ConstantOpInterface>::isRepetitiveRegion(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, unsigned int)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_119ConstantOpInterfaceEE18isRepetitiveRegionEPKNS2_7ConceptEPNS_9OperationEj+0x70): undefined reference to `mlir::bufferization::detail::defaultIsRepetitiveRegion(mlir::bufferization::BufferizableOpInterface, unsigned int)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::ConstantOpInterface>::hasTensorSemantics(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_119ConstantOpInterfaceEE18hasTensorSemanticsEPKNS2_7ConceptEPNS_9OperationE+0x40): undefined reference to `mlir::bufferization::detail::defaultHasTensorSemantics(mlir::Operation*)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::IndexCastOpInterface>::resultBufferizesToMemoryWrite(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::OpResult, mlir::bufferization::AnalysisState const&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_120IndexCastOpInterfaceEE29resultBufferizesToMemoryWriteEPKNS2_7ConceptEPNS_9OperationENS_8OpResultERKNS0_13AnalysisStateE+0x5c): undefined reference to `mlir::bufferization::detail::defaultResultBufferizesToMemoryWrite(mlir::OpResult, mlir::bufferization::AnalysisState const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::IndexCastOpInterface>::getAliasingOpOperands(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::Value, mlir::bufferization::AnalysisState const&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_120IndexCastOpInterfaceEE21getAliasingOpOperandsEPKNS2_7ConceptEPNS_9OperationENS_5ValueERKNS0_13AnalysisStateE+0x44): undefined reference to `mlir::bufferization::detail::defaultGetAliasingOpOperands(mlir::Value, mlir::bufferization::AnalysisState const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::IndexCastOpInterface>::resolveConflicts(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::RewriterBase&, mlir::bufferization::AnalysisState const&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_120IndexCastOpInterfaceEE16resolveConflictsEPKNS2_7ConceptEPNS_9OperationERNS_12RewriterBaseERKNS0_13AnalysisStateE+0x70): undefined reference to `mlir::bufferization::BufferizableOpInterface::resolveTensorOpOperandConflicts(mlir::RewriterBase&, mlir::bufferization::AnalysisState const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::IndexCastOpInterface>::bufferize(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::RewriterBase&, mlir::bufferization::BufferizationOptions const&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_120IndexCastOpInterfaceEE9bufferizeEPKNS2_7ConceptEPNS_9OperationERNS_12RewriterBaseERKNS0_20BufferizationOptionsE+0x9c): undefined reference to `mlir::bufferization::getBuffer(mlir::RewriterBase&, mlir::Value, mlir::bufferization::BufferizationOptions const&)'
/usr/bin/ld: BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_120IndexCastOpInterfaceEE9bufferizeEPKNS2_7ConceptEPNS_9OperationERNS_12RewriterBaseERKNS0_20BufferizationOptionsE+0x1bc): undefined reference to `mlir::bufferization::replaceOpWithBufferizedValues(mlir::RewriterBase&, mlir::Operation*, mlir::ValueRange)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::IndexCastOpInterface>::getBufferType(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::Value, mlir::bufferization::BufferizationOptions const&, llvm::SmallVector<mlir::Value, 6u>&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_120IndexCastOpInterfaceEE13getBufferTypeEPKNS2_7ConceptEPNS_9OperationENS_5ValueERKNS0_20BufferizationOptionsERN4llvm11SmallVectorISC_Lj6EEE+0x28): undefined reference to `mlir::bufferization::getOwnerOfValue(mlir::Value)'

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 20, 2024

LLVM Buildbot has detected a new failure on builder flang-aarch64-latest-gcc running on linaro-flang-aarch64-latest-gcc while building mlir at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/130/builds/6413

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
413.914 [3021/13/4257] Creating library symlink lib/libMLIRMLProgramDialect.so
413.962 [3021/12/4258] Linking CXX shared library lib/libMLIRMathTransforms.so.20.0git
413.984 [3021/11/4259] Linking CXX shared library lib/libMLIRArithToEmitC.so.20.0git
413.994 [3018/13/4260] Creating library symlink lib/libMLIRArithToEmitC.so
414.001 [3014/16/4261] Linking CXX shared library lib/libMLIRControlFlowTransforms.so.20.0git
414.010 [3014/15/4262] Creating library symlink lib/libMLIRMathTransforms.so
414.025 [3014/14/4263] Creating library symlink lib/libMLIRNVGPUTransforms.so
414.041 [3012/15/4264] Creating library symlink lib/libMLIRControlFlowTransforms.so
414.079 [3012/14/4265] Linking CXX shared library lib/libMLIRBufferizationToMemRef.so.20.0git
414.110 [3012/13/4266] Linking CXX shared library lib/libMLIRArithTransforms.so.20.0git
FAILED: lib/libMLIRArithTransforms.so.20.0git 
: && /usr/local/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Wno-unused-but-set-parameter -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libMLIRArithTransforms.so.20.0git -o lib/libMLIRArithTransforms.so.20.0git tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferDeallocationOpInterfaceImpl.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferViewFlowOpInterfaceImpl.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/EmulateUnsupportedFloats.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/EmulateWideInt.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransform
s.dir/EmulateNarrowType.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/ExpandOps.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/IntRangeOptimizations.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/ReifyValueBounds.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/UnsignedWhenEquivalent.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/lib:"  lib/libMLIRFuncTransforms.so.20.0git  lib/libMLIRTransforms.so.20.0git  lib/libMLIRTransformUtils.so.20.0git  lib/libMLIRVectorDialect.so.20.0git  lib/libMLIRFuncDialect.so.20.0git  lib/libMLIRSubsetOpInterface.so.20.0git  lib/libMLIRRewrite.so.20.0git  lib/libMLIRRewritePDL.so.20.0git  lib/libMLIRPDLToPDLInterp.so.20.0git  lib/libMLIRPass.so.20.0git  lib/libMLIRPDLInterpDialect.so.20.0git  lib/libMLIRPDLDialect.so.20.0git  lib/libMLIRRuntimeVerifiableOpInterface.so.20.0git  lib/libMLIRTensorDialect.so.20.0git  lib/libMLIRParallelCombiningOpInterface.so.20.0git  lib/libMLIRAffineDialect.so.20.0git  lib/libMLIRMemRefDialect.so.20.0git  lib/libMLIRArithUtils.so.20.0git  lib/libMLIRComplexDialect.so.20.0git  lib/libMLIRArithDialect.so.20.0git  lib/libMLIRCastInterfaces.so.20.0git  lib/libMLIRInferIntRangeCommon.so.20.0git  lib/libMLIRDialect.so.20.0git  lib/libMLIRMemorySlotInterfaces.so.20.0git  lib/libMLIRValueBoundsOpInterface.so.20.0git  lib/libMLIRAnalysis.so.20.0git  lib/libMLIRInferIntRangeInterface.so.20.0git  lib/libMLIRCallInterfaces.so.20.0git  lib/libMLIRControlFlowInterfaces.so.20.0git  lib/libMLIRDataLayoutInterfaces.so.20.0git  lib/libMLIRPresburger.so.20.0git  lib/libMLIRViewLikeInterface.so.20.0git  lib/libMLIRInferTypeOpInterface.so.20.0git  lib/libMLIRLoopLikeInterface.so.20.0git  lib/libMLIRFunctionInterfaces.so.20.0git  lib/libMLIRSideEffectInterfaces.so.20.0git  lib/libMLIRUBDialect.so.20.0git  lib/libMLIRDialectUtils.so.20.0git  lib/libMLIRShapedOpInterfaces.so.20.0git  lib/libMLIRDestinationStyleOpInterface.so.20.0git  lib/libMLIRMaskableOpInterface.so.20.0git  lib/libMLIRMaskingOpInterface.so.20.0git  lib/libMLIRVectorInterfaces.so.20.0git  lib/libMLIRIR.so.20.0git  lib/libMLIRSupport.so.20.0git  lib/libLLVMSupport.so.20.0git  -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/lib && :
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferDeallocationOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferDeallocationOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::SelectOpInterface>::materializeUniqueOwnershipForMemref(mlir::bufferization::detail::BufferDeallocationOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::bufferization::DeallocationState&, mlir::bufferization::DeallocationOptions const&, mlir::OpBuilder&, mlir::Value)':
BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0xbc): undefined reference to `mlir::bufferization::DeallocationState::getOwnership(mlir::Value, mlir::Block*) const'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0xc8): undefined reference to `mlir::bufferization::Ownership::isUnique() const'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationO
ptionsERNS_9OpBuilderENS_5ValueE+0xe8): undefined reference to `mlir::bufferization::DeallocationState::getMemrefWithUniqueOwnership(mlir::OpBuilder&, mlir::Value, mlir::Block*)'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0x14c): undefined reference to `mlir::bufferization::DeallocationState::getOwnership(mlir::Value, mlir::Block*) const'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0x158): undefined reference to `mlir::bufferization::Ownership::isUnique() const'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0x184): undefined reference to `mlir::bufferization::DeallocationState::getOwnership(mlir::Value, mlir::Block*) const'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0x198): undefined reference to `mlir::bufferization::Ownership::getIndicator() const'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0x1b8): undefined reference to `mlir::bufferization::DeallocationState::getOwnership(mlir::Value, mlir::Block*) const'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0x1cc): undefined reference to `mlir::bufferization::Ownership::getIndicator() const'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::SelectOpInterface>::getAliasingOpOperands(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::Value, mlir::bufferization::AnalysisState const&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE21getAliasingOpOperandsEPKNS2_7ConceptEPNS_9OperationENS_5ValueERKNS0_13AnalysisStateE+0x84): undefined reference to `mlir::bufferization::detail::defaultGetAliasingOpOperands(mlir::Value, mlir::bufferization::AnalysisState const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::ConstantOpInterface>::getAliasingOpOperands(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::Value, mlir::bufferization::AnalysisState const&)':
BufferizableOp
InterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_119ConstantOpInterfaceEE21getAliasingOpOperandsEPKNS2_7ConceptEPNS_9OperationENS_5ValueERKNS0_13AnalysisStateE+0x84): undefined reference to `mlir::bufferization::detail::defaultGetAliasingOpOperands(mlir::Value, mlir::bufferization::AnalysisState const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::IndexCastOpInterface>::getAliasingOpOperands(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::Value, mlir::bufferization::AnalysisState const&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_120IndexCastOpInterfaceEE21getAliasingOpOperandsEPKNS2_7ConceptEPNS_9OperationENS_5ValueERKNS0_13AnalysisStateE+0x84): undefined reference to `mlir::bufferization::detail::defaultGetAliasingOpOperands(mlir::Value, mlir::bufferization::AnalysisState const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::SelectOpInterface>::hasTensorSemantics(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE18hasTensorSemanticsEPKNS2_7ConceptEPNS_9OperationE+0x68): undefined reference to `mlir::bufferization::detail::defaultHasTensorSemantics(mlir::Operation*)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::SelectOpInterface>::resultBufferizesToMemoryWrite(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::OpResult, mlir::bufferization::AnalysisState const&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE29resultBufferizesToMemoryWriteEPKNS2_7ConceptEPNS_9OperationENS_8OpResultERKNS0_13AnalysisStateE+0x6c): undefined reference to `mlir::bufferization::detail::defaultResultBufferizesToMemoryWrite(mlir::OpResult, mlir::bufferization::AnalysisState const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::ConstantOpInterface>::hasTensorSemantics(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_119ConstantOpInterfaceEE18hasTensorSemanticsEPKNS2_7ConceptEPNS_9OperationE+0x68): undefined reference to `mlir::bufferization::detail::defaultHasTensorSemantics(mlir::Operation*)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::ConstantOpInterface>::resultBufferizesToMemoryWrite(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::OpResult, mlir::bufferization::AnalysisState const&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTrai
ts13FallbackModelIN12_GLOBAL__N_119ConstantOpInterfaceEE29resultBufferizesToMemoryWriteEPKNS2_7ConceptEPNS_9OperationENS_8OpResultERKNS0_13AnalysisStateE+0x6c): undefined reference to `mlir::bufferization::detail::defaultResultBufferizesToMemoryWrite(mlir::OpResult, mlir::bufferization::AnalysisState const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::ConstantOpInterface>::getBufferType(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::Value, mlir::bufferization::BufferizationOptions const&, llvm::SmallVector<mlir::Value, 6u>&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_119ConstantOpInterfaceEE13getBufferTypeEPKNS2_7ConceptEPNS_9OperationENS_5ValueERKNS0_20BufferizationOptionsERN4llvm11SmallVectorISC_Lj6EEE+0x38): undefined reference to `mlir::bufferization::getOwnerOfValue(mlir::Value)'
/usr/bin/ld: BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_119ConstantOpInterfaceEE13getBufferTypeEPKNS2_7ConceptEPNS_9OperationENS_5ValueERKNS0_20BufferizationOptionsERN4llvm11SmallVectorISC_Lj6EEE+0xbc): undefined reference to `mlir::bufferization::detail::defaultGetBufferType(mlir::Value, mlir::bufferization::BufferizationOptions const&, llvm::SmallVector<mlir::Value, 6u>&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::IndexCastOpInterface>::hasTensorSemantics(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_120IndexCastOpInterfaceEE18hasTensorSemanticsEPKNS2_7ConceptEPNS_9OperationE+0x68): undefined reference to `mlir::bufferization::detail::defaultHasTensorSemantics(mlir::Operation*)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::IndexCastOpInterface>::resultBufferizesToMemoryWrite(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::OpResult, mlir::bufferization::AnalysisState const&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_120IndexCastOpInterfaceEE29resultBufferizesToMemoryWriteEPKNS2_7ConceptEPNS_9OperationENS_8OpResultERKNS0_13AnalysisStateE+0x6c): undefined reference to `mlir::bufferization::detail::defaultResultBufferizesToMemoryWrite(mlir::OpResult, mlir::bufferization::AnalysisState const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::IndexCastOpInterface>::getBufferType(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::Value, mlir::bufferization::BufferizationOptions const&, llvm::SmallVector<mlir::Value, 6u>&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_120IndexCastOpInterfaceEE13getBufferTypeEPKNS2_7ConceptEPNS_9OperationENS_5ValueERKNS0_20BufferizationOptionsERN4llvm11SmallVectorISC_Lj6EEE+0x38): undefined reference to `mlir::bufferization::getOwnerOfValue(mlir::Value)'

matthias-springer added a commit that referenced this pull request Nov 20, 2024
Since #114152, `MLIRFuncTransforms` no longer depends on
`MLIRBufferizationDialect`. This commit adds a missing dependency that
is no longer transitively included.
@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 20, 2024

LLVM Buildbot has detected a new failure on builder flang-aarch64-sharedlibs running on linaro-flang-aarch64-sharedlibs while building mlir at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/80/builds/6537

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
271.020 [3320/20/4147] Creating library symlink lib/libMLIRCAPILLVM.so
271.027 [3320/19/4148] Linking CXX shared library lib/libMLIRTensorMeshShardingExtensions.so.20.0git
271.028 [3320/18/4149] Linking CXX shared library lib/libMLIRCAPIPDL.so.20.0git
271.031 [3320/17/4150] Creating library symlink lib/libMLIRCAPIArith.so
271.049 [3320/16/4151] Linking CXX shared library lib/libMLIRAffineAnalysis.so.20.0git
271.054 [3320/15/4152] Creating library symlink lib/libMLIRCAPIAMDGPU.so
271.056 [3320/14/4153] Linking CXX shared library lib/libMLIRControlFlowToSCF.so.20.0git
271.063 [3320/13/4154] Creating library symlink lib/libMLIRIndexToLLVM.so
271.081 [3320/12/4155] Linking CXX shared library lib/libMLIRShapeToStandard.so.20.0git
271.093 [3316/15/4156] Linking CXX shared library lib/libMLIRArithTransforms.so.20.0git
FAILED: lib/libMLIRArithTransforms.so.20.0git 
: && /usr/local/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Werror=mismatched-tags -Werror=global-constructors -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libMLIRArithTransforms.so.20.0git -o lib/libMLIRArithTransforms.so.20.0git tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferDeallocationOpInterfaceImpl.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferViewFlowOpInterfaceImpl.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/EmulateUnsupportedFloats.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/EmulateWideInt.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/EmulateNarrowType.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/ExpandOps.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/IntRangeOptimizations.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/ReifyValueBounds.cpp.o tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/UnsignedWhenEquivalent.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/lib:"  lib/libMLIRFuncTransforms.so.20.0git  lib/libMLIRTransforms.so.20.0git  lib/libMLIRTransformUtils.so.20.0git  lib/libMLIRVectorDialect.so.20.0git  lib/libMLIRFuncDialect.so.20.0git  lib/libMLIRSubsetOpInterface.so.20.0git  lib/libMLIRRewrite.so.20.0git  lib/libMLIRRewritePDL.so.20.0git  lib/libMLIRPDLToPDLInterp.so.20.0git  lib/libMLIRPass.so.20.0git  lib/libMLIRPDLInterpDialect.so.20.0git  lib/libMLIRPDLDialect.so.20.0git  lib/libMLIRRuntimeVerifiableOpInterface.so.20.0git  lib/libMLIRTensorDialect.so.20.0git  lib/libMLIRParallelCombiningOpInterface.so.20.0git  lib/libMLIRAffineDialect.so.20.0git  lib/libMLIRMemRefDialect.so.20.0git  lib/libMLIRArithUtils.so.20.0git  lib/libMLIRComplexDialect.so.20.0git  lib/libMLIRArithDialect.so.20.0git  lib/libMLIRCastInterfaces.so.20.0git  lib/libMLIRInferIntRangeCommon.so.20.0git  lib/libMLIRDialect.so.20.0git  lib/libMLIRMemorySlotInterfaces.so.20.0git  lib/libMLIRValueBoundsOpInterface.so.20.0git  lib/libMLIRAnalysis.so.20.0git  lib/libMLIRInferIntRangeInterface.so.20.0git  lib/libMLIRCallInterfaces.so.20.0git  lib/libMLIRControlFlowInterfaces.so.20.0git  lib/libMLIRDataLayoutInterfaces.so.20.0git  lib/libMLIRPresburger.so.20.0git  lib/libMLIRViewLikeInterface.so.20.0git  lib/libMLIRInferTypeOpInterface.so.20.0git  lib/libMLIRLoopLikeInterface.so.20.0git  lib/libMLIRFunctionInterfaces.so.20.0git  lib/libMLIRSideEffectInterfaces.so.20.0git  lib/libMLIRUBDialect.so.20.0git  lib/libMLIRDialectUtils.so.20.0git  lib/libMLIRShapedOpInterfaces.so.20.0git  lib/libMLIRDestinationStyleOpInterface.so.20.0git  lib/libMLIRMaskableOpInterface.so.20.0git  lib/libMLIRMaskingOpInterface.so.20.0git  lib/libMLIRVectorInterfaces.so.20.0git  lib/libMLIRIR.so.20.0git  lib/libMLIRSupport.so.20.0git  lib/libLLVMSupport.so.20.0git  -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/lib && :
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferDeallocationOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferDeallocationOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::SelectOpInterface>::materializeUniqueOwnershipForMemref(mlir::bufferization::detail::BufferDeallocationOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::bufferization::DeallocationState&, mlir::bufferization::DeallocationOptions const&, mlir::OpBuilder&, mlir::Value)':
BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0x90): undefined reference to `mlir::bufferization::DeallocationState::getOwnership(mlir::Value, mlir::Block*) const'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0x9c): undefined reference to `mlir::bufferization::Ownership::isUnique() const'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0xb4): undefined reference to `mlir::bufferization::DeallocationState::getOwnership(mlir::Value, mlir::Block*) const'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0xc0): undefined reference to `mlir::bufferization::Ownership::isUnique() const'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0xe4): undefined reference to `mlir::bufferization::DeallocationState::getOwnership(mlir::Value, mlir::Block*) const'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0xf0): undefined reference to `mlir::bufferization::Ownership::getIndicator() const'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0x108): undefined reference to `mlir::bufferization::DeallocationState::getOwnership(mlir::Value, mlir::Block*) const'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0x114): undefined reference to `mlir::bufferization::Ownership::getIndicator() const'
/usr/bin/ld: BufferDeallocationOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail44BufferDeallocationOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_117SelectOpInterfaceEE35materializeUniqueOwnershipForMemrefEPKNS2_7ConceptEPNS_9OperationERNS0_17DeallocationStateERKNS0_19DeallocationOptionsERNS_9OpBuilderENS_5ValueE+0x18c): undefined reference to `mlir::bufferization::DeallocationState::getMemrefWithUniqueOwnership(mlir::OpBuilder&, mlir::Value, mlir::Block*)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::ConstantOpInterface>::resultBufferizesToMemoryWrite(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::OpResult, mlir::bufferization::AnalysisState const&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_119ConstantOpInterfaceEE29resultBufferizesToMemoryWriteEPKNS2_7ConceptEPNS_9OperationENS_8OpResultERKNS0_13AnalysisStateE+0x5c): undefined reference to `mlir::bufferization::detail::defaultResultBufferizesToMemoryWrite(mlir::OpResult, mlir::bufferization::AnalysisState const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::ConstantOpInterface>::getAliasingOpOperands(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::Value, mlir::bufferization::AnalysisState const&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_119ConstantOpInterfaceEE21getAliasingOpOperandsEPKNS2_7ConceptEPNS_9OperationENS_5ValueERKNS0_13AnalysisStateE+0x44): undefined reference to `mlir::bufferization::detail::defaultGetAliasingOpOperands(mlir::Value, mlir::bufferization::AnalysisState const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::ConstantOpInterface>::resolveConflicts(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::RewriterBase&, mlir::bufferization::AnalysisState const&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_119ConstantOpInterfaceEE16resolveConflictsEPKNS2_7ConceptEPNS_9OperationERNS_12RewriterBaseERKNS0_13AnalysisStateE+0x70): undefined reference to `mlir::bufferization::BufferizableOpInterface::resolveTensorOpOperandConflicts(mlir::RewriterBase&, mlir::bufferization::AnalysisState const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::ConstantOpInterface>::bufferize(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::RewriterBase&, mlir::bufferization::BufferizationOptions const&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_119ConstantOpInterfaceEE9bufferizeEPKNS2_7ConceptEPNS_9OperationERNS_12RewriterBaseERKNS0_20BufferizationOptionsE+0xec): undefined reference to `mlir::bufferization::getGlobalFor(mlir::arith::ConstantOp, unsigned long, mlir::Attribute)'
/usr/bin/ld: BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_119ConstantOpInterfaceEE9bufferizeEPKNS2_7ConceptEPNS_9OperationERNS_12RewriterBaseERKNS0_20BufferizationOptionsE+0x160): undefined reference to `mlir::bufferization::replaceOpWithBufferizedValues(mlir::RewriterBase&, mlir::Operation*, mlir::ValueRange)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::ConstantOpInterface>::getBufferType(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::Value, mlir::bufferization::BufferizationOptions const&, llvm::SmallVector<mlir::Value, 6u>&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_119ConstantOpInterfaceEE13getBufferTypeEPKNS2_7ConceptEPNS_9OperationENS_5ValueERKNS0_20BufferizationOptionsERN4llvm11SmallVectorISC_Lj6EEE+0x28): undefined reference to `mlir::bufferization::getOwnerOfValue(mlir::Value)'
/usr/bin/ld: BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_119ConstantOpInterfaceEE13getBufferTypeEPKNS2_7ConceptEPNS_9OperationENS_5ValueERKNS0_20BufferizationOptionsERN4llvm11SmallVectorISC_Lj6EEE+0x94): undefined reference to `mlir::bufferization::detail::defaultGetBufferType(mlir::Value, mlir::bufferization::BufferizationOptions const&, llvm::SmallVector<mlir::Value, 6u>&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::ConstantOpInterface>::isRepetitiveRegion(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, unsigned int)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_119ConstantOpInterfaceEE18isRepetitiveRegionEPKNS2_7ConceptEPNS_9OperationEj+0x70): undefined reference to `mlir::bufferization::detail::defaultIsRepetitiveRegion(mlir::bufferization::BufferizableOpInterface, unsigned int)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::ConstantOpInterface>::hasTensorSemantics(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_119ConstantOpInterfaceEE18hasTensorSemanticsEPKNS2_7ConceptEPNS_9OperationE+0x40): undefined reference to `mlir::bufferization::detail::defaultHasTensorSemantics(mlir::Operation*)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::IndexCastOpInterface>::resultBufferizesToMemoryWrite(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::OpResult, mlir::bufferization::AnalysisState const&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_120IndexCastOpInterfaceEE29resultBufferizesToMemoryWriteEPKNS2_7ConceptEPNS_9OperationENS_8OpResultERKNS0_13AnalysisStateE+0x5c): undefined reference to `mlir::bufferization::detail::defaultResultBufferizesToMemoryWrite(mlir::OpResult, mlir::bufferization::AnalysisState const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::IndexCastOpInterface>::getAliasingOpOperands(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::Value, mlir::bufferization::AnalysisState const&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_120IndexCastOpInterfaceEE21getAliasingOpOperandsEPKNS2_7ConceptEPNS_9OperationENS_5ValueERKNS0_13AnalysisStateE+0x44): undefined reference to `mlir::bufferization::detail::defaultGetAliasingOpOperands(mlir::Value, mlir::bufferization::AnalysisState const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::IndexCastOpInterface>::resolveConflicts(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::RewriterBase&, mlir::bufferization::AnalysisState const&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_120IndexCastOpInterfaceEE16resolveConflictsEPKNS2_7ConceptEPNS_9OperationERNS_12RewriterBaseERKNS0_13AnalysisStateE+0x70): undefined reference to `mlir::bufferization::BufferizableOpInterface::resolveTensorOpOperandConflicts(mlir::RewriterBase&, mlir::bufferization::AnalysisState const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::IndexCastOpInterface>::bufferize(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::RewriterBase&, mlir::bufferization::BufferizationOptions const&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_120IndexCastOpInterfaceEE9bufferizeEPKNS2_7ConceptEPNS_9OperationERNS_12RewriterBaseERKNS0_20BufferizationOptionsE+0x9c): undefined reference to `mlir::bufferization::getBuffer(mlir::RewriterBase&, mlir::Value, mlir::bufferization::BufferizationOptions const&)'
/usr/bin/ld: BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_120IndexCastOpInterfaceEE9bufferizeEPKNS2_7ConceptEPNS_9OperationERNS_12RewriterBaseERKNS0_20BufferizationOptionsE+0x1bc): undefined reference to `mlir::bufferization::replaceOpWithBufferizedValues(mlir::RewriterBase&, mlir::Operation*, mlir::ValueRange)'
/usr/bin/ld: tools/mlir/lib/Dialect/Arith/Transforms/CMakeFiles/obj.MLIRArithTransforms.dir/BufferizableOpInterfaceImpl.cpp.o: in function `mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::IndexCastOpInterface>::getBufferType(mlir::bufferization::detail::BufferizableOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::Value, mlir::bufferization::BufferizationOptions const&, llvm::SmallVector<mlir::Value, 6u>&)':
BufferizableOpInterfaceImpl.cpp:(.text._ZN4mlir13bufferization6detail38BufferizableOpInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_120IndexCastOpInterfaceEE13getBufferTypeEPKNS2_7ConceptEPNS_9OperationENS_5ValueERKNS0_20BufferizationOptionsERN4llvm11SmallVectorISC_Lj6EEE+0x28): undefined reference to `mlir::bufferization::getOwnerOfValue(mlir::Value)'

matthias-springer added a commit that referenced this pull request Nov 20, 2024
Since #114152,
`MLIRFuncTransforms` no longer depends on `MLIRBufferizationTransforms`.
This commit adds a missing dependency that is no longer transitively
included.
@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 20, 2024

LLVM Buildbot has detected a new failure on builder clang-aarch64-sve-vls running on linaro-g3-02 while building mlir at step 7 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/143/builds/3550

Here is the relevant piece of the build log for the reference
Step 7 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'MLIR :: Integration/Dialect/MemRef/verify-memref.mlir' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 1
/home/tcwg-buildbot/worker/clang-aarch64-sve-vls/stage1/bin/mlir-opt /home/tcwg-buildbot/worker/clang-aarch64-sve-vls/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir    -one-shot-bufferize="bufferize-function-boundaries" --canonicalize    -convert-vector-to-scf -convert-scf-to-cf -convert-vector-to-llvm -finalize-memref-to-llvm   -convert-func-to-llvm -reconcile-unrealized-casts | /home/tcwg-buildbot/worker/clang-aarch64-sve-vls/stage1/bin/mlir-cpu-runner   -e entry -entry-point-result=void   -shared-libs=/home/tcwg-buildbot/worker/clang-aarch64-sve-vls/stage1/lib/libmlir_c_runner_utils.so,/home/tcwg-buildbot/worker/clang-aarch64-sve-vls/stage1/lib/libmlir_runner_utils.so | /home/tcwg-buildbot/worker/clang-aarch64-sve-vls/stage1/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve-vls/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir
# executed command: /home/tcwg-buildbot/worker/clang-aarch64-sve-vls/stage1/bin/mlir-opt /home/tcwg-buildbot/worker/clang-aarch64-sve-vls/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir -one-shot-bufferize=bufferize-function-boundaries --canonicalize -convert-vector-to-scf -convert-scf-to-cf -convert-vector-to-llvm -finalize-memref-to-llvm -convert-func-to-llvm -reconcile-unrealized-casts
# .---command stderr------------
# | /home/tcwg-buildbot/worker/clang-aarch64-sve-vls/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir:36:10: error: 'tensor.cast' op not bufferizable under the given constraints: cannot avoid RaW conflict
# |     %1 = tensor.cast %i8 : tensor<3x3xi8> to tensor<*xi8>
# |          ^
# | /home/tcwg-buildbot/worker/clang-aarch64-sve-vls/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir:36:10: note: see current operation: %11 = "tensor.cast"(%0) : (tensor<3x3xi8>) -> tensor<*xi8>
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /home/tcwg-buildbot/worker/clang-aarch64-sve-vls/stage1/bin/mlir-cpu-runner -e entry -entry-point-result=void -shared-libs=/home/tcwg-buildbot/worker/clang-aarch64-sve-vls/stage1/lib/libmlir_c_runner_utils.so,/home/tcwg-buildbot/worker/clang-aarch64-sve-vls/stage1/lib/libmlir_runner_utils.so
# .---command stderr------------
# | Error: entry point not found
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /home/tcwg-buildbot/worker/clang-aarch64-sve-vls/stage1/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve-vls/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  /home/tcwg-buildbot/worker/clang-aarch64-sve-vls/stage1/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve-vls/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir
# `-----------------------------
# error: command failed with exit status: 2

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 20, 2024

LLVM Buildbot has detected a new failure on builder clang-aarch64-sve-vla running on linaro-g3-02 while building mlir at step 7 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/17/builds/4005

Here is the relevant piece of the build log for the reference
Step 7 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'MLIR :: Integration/Dialect/MemRef/verify-memref.mlir' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 1
/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/stage1/bin/mlir-opt /home/tcwg-buildbot/worker/clang-aarch64-sve-vla/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir    -one-shot-bufferize="bufferize-function-boundaries" --canonicalize    -convert-vector-to-scf -convert-scf-to-cf -convert-vector-to-llvm -finalize-memref-to-llvm   -convert-func-to-llvm -reconcile-unrealized-casts | /home/tcwg-buildbot/worker/clang-aarch64-sve-vla/stage1/bin/mlir-cpu-runner   -e entry -entry-point-result=void   -shared-libs=/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/stage1/lib/libmlir_c_runner_utils.so,/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/stage1/lib/libmlir_runner_utils.so | /home/tcwg-buildbot/worker/clang-aarch64-sve-vla/stage1/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve-vla/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir
# executed command: /home/tcwg-buildbot/worker/clang-aarch64-sve-vla/stage1/bin/mlir-opt /home/tcwg-buildbot/worker/clang-aarch64-sve-vla/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir -one-shot-bufferize=bufferize-function-boundaries --canonicalize -convert-vector-to-scf -convert-scf-to-cf -convert-vector-to-llvm -finalize-memref-to-llvm -convert-func-to-llvm -reconcile-unrealized-casts
# .---command stderr------------
# | /home/tcwg-buildbot/worker/clang-aarch64-sve-vla/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir:36:10: error: 'tensor.cast' op not bufferizable under the given constraints: cannot avoid RaW conflict
# |     %1 = tensor.cast %i8 : tensor<3x3xi8> to tensor<*xi8>
# |          ^
# | /home/tcwg-buildbot/worker/clang-aarch64-sve-vla/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir:36:10: note: see current operation: %11 = "tensor.cast"(%0) : (tensor<3x3xi8>) -> tensor<*xi8>
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /home/tcwg-buildbot/worker/clang-aarch64-sve-vla/stage1/bin/mlir-cpu-runner -e entry -entry-point-result=void -shared-libs=/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/stage1/lib/libmlir_c_runner_utils.so,/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/stage1/lib/libmlir_runner_utils.so
# .---command stderr------------
# | Error: entry point not found
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /home/tcwg-buildbot/worker/clang-aarch64-sve-vla/stage1/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve-vla/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  /home/tcwg-buildbot/worker/clang-aarch64-sve-vla/stage1/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve-vla/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir
# `-----------------------------
# error: command failed with exit status: 2

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 20, 2024

LLVM Buildbot has detected a new failure on builder clang-aarch64-sve-vls-2stage running on linaro-g3-04 while building mlir at step 12 "ninja check 2".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/4/builds/3675

Here is the relevant piece of the build log for the reference
Step 12 (ninja check 2) failure: stage 2 checked (failure)
******************** TEST 'MLIR :: Integration/Dialect/MemRef/verify-memref.mlir' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 1
/home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/stage2/bin/mlir-opt /home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir    -one-shot-bufferize="bufferize-function-boundaries" --canonicalize    -convert-vector-to-scf -convert-scf-to-cf -convert-vector-to-llvm -finalize-memref-to-llvm   -convert-func-to-llvm -reconcile-unrealized-casts | /home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/stage2/bin/mlir-cpu-runner   -e entry -entry-point-result=void   -shared-libs=/home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/stage2/lib/libmlir_c_runner_utils.so,/home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/stage2/lib/libmlir_runner_utils.so | /home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/stage2/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir
# executed command: /home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/stage2/bin/mlir-opt /home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir -one-shot-bufferize=bufferize-function-boundaries --canonicalize -convert-vector-to-scf -convert-scf-to-cf -convert-vector-to-llvm -finalize-memref-to-llvm -convert-func-to-llvm -reconcile-unrealized-casts
# .---command stderr------------
# | /home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir:36:10: error: 'tensor.cast' op not bufferizable under the given constraints: cannot avoid RaW conflict
# |     %1 = tensor.cast %i8 : tensor<3x3xi8> to tensor<*xi8>
# |          ^
# | /home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir:36:10: note: see current operation: %11 = "tensor.cast"(%0) : (tensor<3x3xi8>) -> tensor<*xi8>
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/stage2/bin/mlir-cpu-runner -e entry -entry-point-result=void -shared-libs=/home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/stage2/lib/libmlir_c_runner_utils.so,/home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/stage2/lib/libmlir_runner_utils.so
# .---command stderr------------
# | Error: entry point not found
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/stage2/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  /home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/stage2/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir
# `-----------------------------
# error: command failed with exit status: 2

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 20, 2024

LLVM Buildbot has detected a new failure on builder clang-aarch64-sve-vla-2stage running on linaro-g3-03 while building mlir at step 12 "ninja check 2".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/41/builds/3556

Here is the relevant piece of the build log for the reference
Step 12 (ninja check 2) failure: stage 2 checked (failure)
******************** TEST 'MLIR :: Integration/Dialect/MemRef/verify-memref.mlir' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 1
/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/bin/mlir-opt /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir    -one-shot-bufferize="bufferize-function-boundaries" --canonicalize    -convert-vector-to-scf -convert-scf-to-cf -convert-vector-to-llvm -finalize-memref-to-llvm   -convert-func-to-llvm -reconcile-unrealized-casts | /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/bin/mlir-cpu-runner   -e entry -entry-point-result=void   -shared-libs=/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/lib/libmlir_c_runner_utils.so,/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/lib/libmlir_runner_utils.so | /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir
# executed command: /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/bin/mlir-opt /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir -one-shot-bufferize=bufferize-function-boundaries --canonicalize -convert-vector-to-scf -convert-scf-to-cf -convert-vector-to-llvm -finalize-memref-to-llvm -convert-func-to-llvm -reconcile-unrealized-casts
# .---command stderr------------
# | /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir:36:10: error: 'tensor.cast' op not bufferizable under the given constraints: cannot avoid RaW conflict
# |     %1 = tensor.cast %i8 : tensor<3x3xi8> to tensor<*xi8>
# |          ^
# | /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir:36:10: note: see current operation: %11 = "tensor.cast"(%0) : (tensor<3x3xi8>) -> tensor<*xi8>
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/bin/mlir-cpu-runner -e entry -entry-point-result=void -shared-libs=/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/lib/libmlir_c_runner_utils.so,/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/lib/libmlir_runner_utils.so
# .---command stderr------------
# | Error: entry point not found
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/mlir/test/Integration/Dialect/MemRef/verify-memref.mlir
# `-----------------------------
# error: command failed with exit status: 2

--

********************


matthias-springer added a commit that referenced this pull request Nov 21, 2024
The dialect conversion-based bufferization passes have been migrated to One-Shot Bufferize about two years ago. To clean up the code base, this commit removes the `finalizing-bufferize` pass, one of the few remaining parts of the old infrastructure. Most bufferization passes have already been removed.

Note for LLVM integration: If you depend on this pass, migrate to One-Shot Bufferize or copy the pass to your codebase.

Depends on #114152.
matthias-springer added a commit that referenced this pull request Nov 21, 2024
The dialect conversion-based bufferization passes have been migrated to
One-Shot Bufferize about two years ago. To clean up the code base, this
commit removes the `finalizing-bufferize` pass, one of the few remaining
parts of the old infrastructure. Most bufferization passes have already
been removed.

Note for LLVM integration: If you depend on this pass, migrate to
One-Shot Bufferize or copy the pass to your codebase.

Depends on #114152.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants