Skip to content

Commit 159e94a

Browse files
[mlir][linalg][transform] Add some debug output to vectorization. (NFC) (#66520)
This helps to understand what the problem is when vectorization of structured ops failes due to mismatching vector sizes.
1 parent 9568601 commit 159e94a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,6 @@ getTensorExtractMemoryAccessPattern(tensor::ExtractOp extractOp,
924924
targetShape.back() == 1)
925925
return VectorMemoryAccessKind::Gather;
926926

927-
928927
// 2. Assume that it's a gather load when reading _from_ a tensor for which
929928
// the trailing dimension is 1, e.g. `tensor<1x4x1xi32>`.
930929
// TODO: Relax this condition.
@@ -1484,6 +1483,10 @@ static LogicalResult vectorizeDynamicLinalgOpPrecondition(linalg::LinalgOp op) {
14841483
static LogicalResult
14851484
isValidMaskedInputVector(ArrayRef<int64_t> shape,
14861485
ArrayRef<int64_t> inputVectorSizes) {
1486+
LDBG("Iteration space static sizes:");
1487+
LLVM_DEBUG(llvm::interleaveComma(shape, llvm::dbgs()));
1488+
LLVM_DEBUG(llvm::dbgs() << "\n");
1489+
14871490
if (inputVectorSizes.size() != shape.size()) {
14881491
LDBG("Input vector sizes don't match the number of loops");
14891492
return failure();

0 commit comments

Comments
 (0)