MLIR  16.0.0git
Passes.h
Go to the documentation of this file.
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_ARITH_TRANSFORMS_PASSES_H_
10 #define MLIR_DIALECT_ARITH_TRANSFORMS_PASSES_H_
11 
12 #include "mlir/Pass/Pass.h"
13 
14 namespace mlir {
15 namespace arith {
16 
17 #define GEN_PASS_DECL
18 #include "mlir/Dialect/Arith/Transforms/Passes.h.inc"
19 
20 class WideIntEmulationConverter;
21 
22 /// Create a pass to bufferize Arith ops.
23 std::unique_ptr<Pass> createArithBufferizePass();
24 
25 /// Create a pass to bufferize arith.constant ops.
26 std::unique_ptr<Pass> createConstantBufferizePass(uint64_t alignment = 0);
27 
28 /// Adds patterns to emulate wide Arith and Function ops over integer
29 /// types into supported ones. This is done by splitting original power-of-two
30 /// i2N integer types into two iN halves.
32  WideIntEmulationConverter &typeConverter, RewritePatternSet &patterns);
33 
34 /// Add patterns to expand Arith ceil/floor division ops.
35 void populateCeilFloorDivExpandOpsPatterns(RewritePatternSet &patterns);
36 
37 /// Add patterns to expand Arith ops.
38 void populateArithExpandOpsPatterns(RewritePatternSet &patterns);
39 
40 /// Create a pass to legalize Arith ops.
41 std::unique_ptr<Pass> createArithExpandOpsPass();
42 
43 /// Create a pass to replace signed ops with unsigned ones where they are proven
44 /// equivalent.
45 std::unique_ptr<Pass> createArithUnsignedWhenEquivalentPass();
46 
47 //===----------------------------------------------------------------------===//
48 // Registration
49 //===----------------------------------------------------------------------===//
50 
51 /// Generate the code for registering passes.
52 #define GEN_PASS_REGISTRATION
53 #include "mlir/Dialect/Arith/Transforms/Passes.h.inc"
54 
55 } // namespace arith
56 } // namespace mlir
57 
58 #endif // MLIR_DIALECT_ARITH_TRANSFORMS_PASSES_H_
std::unique_ptr< Pass > createArithBufferizePass()
Create a pass to bufferize Arith ops.
Definition: Bufferize.cpp:61
void populateArithWideIntEmulationPatterns(WideIntEmulationConverter &typeConverter, RewritePatternSet &patterns)
Adds patterns to emulate wide Arith and Function ops over integer types into supported ones.
void populateCeilFloorDivExpandOpsPatterns(RewritePatternSet &patterns)
Add patterns to expand Arith ceil/floor division ops.
Definition: ExpandOps.cpp:228
std::unique_ptr< Pass > createConstantBufferizePass(uint64_t alignment=0)
Create a pass to bufferize arith.constant ops.
Definition: Bufferize.cpp:66
std::unique_ptr< Pass > createArithExpandOpsPass()
Create a pass to legalize Arith ops.
Definition: ExpandOps.cpp:249
void populateArithExpandOpsPatterns(RewritePatternSet &patterns)
Add patterns to expand Arith ops.
Definition: ExpandOps.cpp:235
std::unique_ptr< Pass > createArithUnsignedWhenEquivalentPass()
Create a pass to replace signed ops with unsigned ones where they are proven equivalent.
Include the generated interface declarations.