File tree Expand file tree Collapse file tree 3 files changed +711
-0
lines changed Expand file tree Collapse file tree 3 files changed +711
-0
lines changed Original file line number Diff line number Diff line change
1
+ // ===- SCFVectorize.h - ------------------------------------------*- 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_TRANSFORMS_SCFVECTORIZE_H_
10
+ #define MLIR_TRANSFORMS_SCFVECTORIZE_H_
11
+
12
+ #include < memory>
13
+ #include < optional>
14
+
15
+ namespace mlir {
16
+ class OpBuilder ;
17
+ class Pass ;
18
+ struct LogicalResult ;
19
+ namespace scf {
20
+ class ParallelOp ;
21
+ }
22
+ } // namespace mlir
23
+
24
+ namespace mlir {
25
+ struct SCFVectorizeInfo {
26
+ unsigned dim = 0 ;
27
+ unsigned factor = 0 ;
28
+ unsigned count = 0 ;
29
+ bool masked = false ;
30
+ };
31
+
32
+ std::optional<SCFVectorizeInfo> getLoopVectorizeInfo (mlir::scf::ParallelOp loop,
33
+ unsigned dim,
34
+ unsigned vectorBitWidth);
35
+
36
+ struct SCFVectorizeParams {
37
+ unsigned dim = 0 ;
38
+ unsigned factor = 0 ;
39
+ bool masked = false ;
40
+ };
41
+
42
+ mlir::LogicalResult vectorizeLoop (mlir::OpBuilder &builder,
43
+ mlir::scf::ParallelOp loop,
44
+ const SCFVectorizeParams ¶ms);
45
+
46
+ std::unique_ptr<mlir::Pass> createSCFVectorizePass ();
47
+ } // namespace mlir
48
+
49
+ #endif // MLIR_TRANSFORMS_SCFVECTORIZE_H_
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ add_mlir_library(MLIRTransforms
14
14
PrintIR.cpp
15
15
RemoveDeadValues.cpp
16
16
SCCP.cpp
17
+ SCFVectorize.cpp
17
18
SROA.cpp
18
19
StripDebugInfo.cpp
19
20
SymbolDCE.cpp
You can’t perform that action at this time.
0 commit comments