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 ArithmeticDialect; 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 #define GEN_PASS_CLASSES 31 #include "mlir/Dialect/Async/Passes.h.inc" 32 33 // -------------------------------------------------------------------------- // 34 // Utility functions shared by Async Transformations. 35 // -------------------------------------------------------------------------- // 36 37 // Forward declarations. 38 class OpBuilder; 39 40 namespace async { 41 42 /// Clone ConstantLike operations that are defined above the given region and 43 /// have users in the region into the region entry block. We do that to reduce 44 /// the number of function arguments when we outline `async.execute` and 45 /// `scf.parallel` operations body into functions. 46 void cloneConstantsIntoTheRegion(Region ®ion); 47 void cloneConstantsIntoTheRegion(Region ®ion, OpBuilder &builder); 48 49 } // namespace async 50 51 } // namespace mlir 52 53 #endif // DIALECT_ASYNC_TRANSFORMS_PASSDETAIL_H_ 54