|
9 | 9 | #ifndef MLIR_DIALECT_VECTOR_UTILS_VECTORUTILS_H_
|
10 | 10 | #define MLIR_DIALECT_VECTOR_UTILS_VECTORUTILS_H_
|
11 | 11 |
|
| 12 | +#include "mlir/Dialect/MemRef/IR/MemRef.h" |
| 13 | +#include "mlir/Dialect/Tensor/IR/Tensor.h" |
12 | 14 | #include "mlir/Dialect/Utils/IndexingUtils.h"
|
13 | 15 | #include "mlir/Dialect/Vector/IR/VectorOps.h"
|
14 | 16 | #include "mlir/IR/BuiltinAttributes.h"
|
15 | 17 | #include "mlir/Support/LLVM.h"
|
16 | 18 |
|
17 | 19 | #include "llvm/ADT/DenseMap.h"
|
| 20 | +#include "llvm/ADT/TypeSwitch.h" |
18 | 21 |
|
19 | 22 | namespace mlir {
|
20 | 23 |
|
@@ -98,6 +101,17 @@ bool isContiguousSlice(MemRefType memrefType, VectorType vectorType);
|
98 | 101 | std::optional<StaticTileOffsetRange>
|
99 | 102 | createUnrollIterator(VectorType vType, int64_t targetRank = 1);
|
100 | 103 |
|
| 104 | +/// A wrapper for getMixedSizes for vector.transfer_read and |
| 105 | +/// vector.transfer_write Ops (for source and destination, respectively). |
| 106 | +/// |
| 107 | +/// Tensor and MemRef types implement their own, very similar version of |
| 108 | +/// getMixedSizes. This method will call the appropriate version (depending on |
| 109 | +/// `hasTensorSemantics`). It will also automatically extract the operand for |
| 110 | +/// which to call it on (source for "read" and destination for "write" ops). |
| 111 | +SmallVector<OpFoldResult> getMixedSizesXfer(bool hasTensorSemantics, |
| 112 | + Operation *xfer, |
| 113 | + RewriterBase &rewriter); |
| 114 | + |
101 | 115 | } // namespace vector
|
102 | 116 |
|
103 | 117 | /// Constructs a permutation map of invariant memref indices to vector
|
|
0 commit comments