| 1 | //===- PassDetail.h - Async Pass class details ------------------*- 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 DIALECT_ASYNC_TRANSFORMS_PASSDETAIL_H_ |
| 10 | #define DIALECT_ASYNC_TRANSFORMS_PASSDETAIL_H_ |
| 11 | |
| 12 | #include "mlir/IR/BuiltinOps.h" |
| 13 | #include "mlir/IR/Dialect.h" |
| 14 | #include "mlir/Pass/Pass.h" |
| 15 | |
| 16 | namespace mlir { |
| 17 | |
| 18 | namespace arith { |
| 19 | class ArithDialect; |
| 20 | } // namespace arith |
| 21 | |
| 22 | namespace async { |
| 23 | class AsyncDialect; |
| 24 | } // namespace async |
| 25 | |
| 26 | namespace scf { |
| 27 | class SCFDialect; |
| 28 | } // namespace scf |
| 29 | |
| 30 | // -------------------------------------------------------------------------- // |
| 31 | // Utility functions shared by Async Transformations. |
| 32 | // -------------------------------------------------------------------------- // |
| 33 | |
| 34 | // Forward declarations. |
| 35 | class OpBuilder; |
| 36 | |
| 37 | namespace async { |
| 38 | |
| 39 | /// Clone ConstantLike operations that are defined above the given region and |
| 40 | /// have users in the region into the region entry block. We do that to reduce |
| 41 | /// the number of function arguments when we outline `async.execute` and |
| 42 | /// `scf.parallel` operations body into functions. |
| 43 | void cloneConstantsIntoTheRegion(Region ®ion); |
| 44 | void cloneConstantsIntoTheRegion(Region ®ion, OpBuilder &builder); |
| 45 | |
| 46 | } // namespace async |
| 47 | |
| 48 | } // namespace mlir |
| 49 | |
| 50 | #endif // DIALECT_ASYNC_TRANSFORMS_PASSDETAIL_H_ |
| 51 | |