|
13 | 13 | #include "mlir/Dialect/Affine/IR/AffineOps.h"
|
14 | 14 | #include "mlir/Dialect/Utils/IndexingUtils.h"
|
15 | 15 | #include "mlir/Dialect/Vector/Transforms/VectorTransforms.h"
|
16 |
| -#include "mlir/IR/ImplicitLocOpBuilder.h" |
17 | 16 | #include "mlir/Interfaces/VectorInterfaces.h"
|
18 | 17 | #include "llvm/ADT/MapVector.h"
|
19 | 18 | #include "llvm/ADT/STLExtras.h"
|
20 | 19 | #include "llvm/Support/Debug.h"
|
21 |
| -#include <numeric> |
| 20 | +#include "llvm/Support/InterleavedRange.h" |
22 | 21 | #include <optional>
|
23 | 22 |
|
24 | 23 | #define DEBUG_TYPE "vector-unroll"
|
|
28 | 27 | using namespace mlir;
|
29 | 28 | using namespace mlir::vector;
|
30 | 29 |
|
31 |
| -/// Compute the indices of the slice `index` for a tranfer op. |
| 30 | +/// Compute the indices of the slice `index` for a transfer op. |
32 | 31 | static SmallVector<Value> sliceTransferIndices(ArrayRef<int64_t> elementOffsets,
|
33 | 32 | ArrayRef<Value> indices,
|
34 | 33 | AffineMap permutationMap,
|
@@ -88,17 +87,14 @@ getTargetShape(const vector::UnrollVectorOptions &options, Operation *op) {
|
88 | 87 | LDBG("--could not get shape of op " << *op << " -> BAIL");
|
89 | 88 | return std::nullopt;
|
90 | 89 | }
|
91 |
| - LLVM_DEBUG( |
92 |
| - llvm::interleaveComma(*maybeUnrollShape, DBGS() << "--vector op shape: "); |
93 |
| - llvm::dbgs() << "\n";); |
| 90 | + LDBG("--vector op shape: " << llvm::interleaved(*maybeUnrollShape)); |
94 | 91 |
|
95 | 92 | std::optional<SmallVector<int64_t>> targetShape = options.nativeShape(op);
|
96 | 93 | if (!targetShape) {
|
97 | 94 | LDBG("--no unrolling target shape defined " << *op << "-> SKIP");
|
98 | 95 | return std::nullopt;
|
99 | 96 | }
|
100 |
| - LLVM_DEBUG(llvm::interleaveComma(*targetShape, DBGS() << "--target shape: "); |
101 |
| - llvm::dbgs() << "\n";); |
| 97 | + LDBG("--target shape: " << llvm::interleaved(*targetShape)); |
102 | 98 |
|
103 | 99 | auto maybeShapeRatio = computeShapeRatio(*maybeUnrollShape, *targetShape);
|
104 | 100 | if (!maybeShapeRatio) {
|
|
0 commit comments