MLIR  20.0.0git
Utils.h
Go to the documentation of this file.
1 //===- Utils.h - Utils related to the transform dialect ---------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef MLIR_DIALECT_TRANSFORM_IR_UTILS_H
10 #define MLIR_DIALECT_TRANSFORM_IR_UTILS_H
11 
12 namespace mlir {
13 class InFlightDiagnostic;
14 class Operation;
15 template <typename>
16 class OwningOpRef;
17 
18 namespace transform {
19 namespace detail {
20 
21 /// Merge all symbols from `other` into `target`. Both ops need to implement the
22 /// `SymbolTable` trait. Operations are moved from `other`, i.e., `other` may be
23 /// modified by this function and might not verify after the function returns.
24 /// Upon merging, private symbols may be renamed in order to avoid collisions in
25 /// the result. Public symbols may not collide, with the exception of
26 /// instances of `SymbolOpInterface`, where collisions are allowed if at least
27 /// one of the two is external, in which case the other op preserved (or any one
28 /// of the two if both are external).
29 // TODO: Reconsider cloning individual ops rather than forcing users of the
30 // function to clone (or move) `other` in order to improve efficiency.
31 // This might primarily make sense if we can also prune the symbols that
32 // are merged to a subset (such as those that are actually used).
33 InFlightDiagnostic mergeSymbolsInto(Operation *target,
34  OwningOpRef<Operation *> other);
35 
36 } // namespace detail
37 } // namespace transform
38 } // namespace mlir
39 
40 #endif // MLIR_DIALECT_TRANSFORM_IR_UTILS_H
InFlightDiagnostic mergeSymbolsInto(Operation *target, OwningOpRef< Operation * > other)
Merge all symbols from other into target.
Definition: Utils.cpp:79
Include the generated interface declarations.