1 //===- Passes.h - Pass Entrypoints ------------------------------*- 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_ARITHMETIC_TRANSFORMS_PASSES_H_ 10 #define MLIR_DIALECT_ARITHMETIC_TRANSFORMS_PASSES_H_ 11 12 #include "mlir/Pass/Pass.h" 13 14 namespace mlir { 15 namespace arith { 16 17 /// Create a pass to bufferize Arithmetic ops. 18 std::unique_ptr<Pass> createArithmeticBufferizePass(); 19 20 /// Create a pass to bufferize arith.constant ops. 21 std::unique_ptr<Pass> createConstantBufferizePass(uint64_t alignment = 0); 22 23 /// Add patterns to expand Arithmetic ops for LLVM lowering. 24 void populateArithmeticExpandOpsPatterns(RewritePatternSet &patterns); 25 26 /// Create a pass to legalize Arithmetic ops for LLVM lowering. 27 std::unique_ptr<Pass> createArithmeticExpandOpsPass(); 28 29 /// Create a pass to replace signed ops with unsigned ones where they are proven 30 /// equivalent. 31 std::unique_ptr<Pass> createArithmeticUnsignedWhenEquivalentPass(); 32 33 //===----------------------------------------------------------------------===// 34 // Registration 35 //===----------------------------------------------------------------------===// 36 37 /// Generate the code for registering passes. 38 #define GEN_PASS_REGISTRATION 39 #include "mlir/Dialect/Arithmetic/Transforms/Passes.h.inc" 40 41 } // namespace arith 42 } // namespace mlir 43 44 #endif // MLIR_DIALECT_ARITHMETIC_TRANSFORMS_PASSES_H_ 45