MLIR  19.0.0git
VectorTransformOps.h
Go to the documentation of this file.
1 //===- VectorTransformOps.h - Vector transform ops --------------*- 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_VECTOR_TRANSFORMOPS_VECTORTRANSFORMOPS_H
10 #define MLIR_DIALECT_VECTOR_TRANSFORMOPS_VECTORTRANSFORMOPS_H
11 
16 
17 namespace mlir {
18 namespace vector {
19 class VectorOp;
20 struct LowerVectorsOptions;
21 } // namespace vector
22 } // namespace mlir
23 
24 //===----------------------------------------------------------------------===//
25 // Vector Transform Operations
26 //===----------------------------------------------------------------------===//
27 
28 #define GET_OP_CLASSES
29 #include "mlir/Dialect/Vector/TransformOps/VectorTransformOps.h.inc"
30 
31 namespace mlir {
32 class DialectRegistry;
33 
34 namespace vector {
35 void registerTransformDialectExtension(DialectRegistry &registry);
36 
37 /// Helper structure used to hold the different options of LowerVectorsOp.
39  // Have the default values match the LowerVectorsOp values in the td file.
41  setVectorTransformsOptions(VectorContractLowering::OuterProduct);
43  VectorMultiReductionLowering::InnerParallel);
44  setVectorTransposeLowering(VectorTransposeLowering::EltWise);
45  setVectorTransferSplit(VectorTransferSplit::LinalgCopy);
46  }
47 
48  /// Duplicate the base API of VectorTransformsOptions but return the
49  /// LowerVectorsOptions type. This allows to really set up the different
50  /// options in any order via chained setXXX calls. @{
51  LowerVectorsOptions &setVectorTransformsOptions(VectorContractLowering opt) {
53  return *this;
54  }
55 
57  setVectorMultiReductionLowering(VectorMultiReductionLowering opt) {
59  return *this;
60  }
61  LowerVectorsOptions &setVectorTransposeLowering(VectorTransposeLowering opt) {
63  return *this;
64  }
65  LowerVectorsOptions &setVectorTransferSplit(VectorTransferSplit opt) {
67  return *this;
68  }
69  /// @}
70 
71  bool transposeAVX2Lowering = false;
74  return *this;
75  }
76 
77  bool unrollVectorTransfers = true;
80  return *this;
81  }
82 };
83 } // namespace vector
84 } // namespace mlir
85 
86 #endif // MLIR_DIALECT_VECTOR_TRANSFORMOPS_VECTORTRANSFORMOPS_H
void registerTransformDialectExtension(DialectRegistry &registry)
Include the generated interface declarations.
Helper structure used to hold the different options of LowerVectorsOp.
LowerVectorsOptions & setVectorTransformsOptions(VectorContractLowering opt)
Duplicate the base API of VectorTransformsOptions but return the LowerVectorsOptions type.
LowerVectorsOptions & setUnrollVectorTransfers(bool opt)
LowerVectorsOptions & setVectorTransferSplit(VectorTransferSplit opt)
LowerVectorsOptions & setTransposeAVX2Lowering(bool opt)
LowerVectorsOptions & setVectorMultiReductionLowering(VectorMultiReductionLowering opt)
LowerVectorsOptions & setVectorTransposeLowering(VectorTransposeLowering opt)
Structure to control the behavior of vector transform patterns.
VectorTransformsOptions & setVectorMultiReductionLowering(VectorMultiReductionLowering opt)
VectorTransformsOptions & setVectorTransposeLowering(VectorTransposeLowering opt)
VectorTransformsOptions & setVectorTransferSplit(VectorTransferSplit opt)
VectorTransformsOptions & setVectorTransformsOptions(VectorContractLowering opt)