Skip to content

Commit 2541aa2

Browse files
committed
Revert unnecessary cosmetic changes
- Revert OpenMP conversion changes - Revert DataLayoutPropagation tensor semantic checks removal - Revert Vectorization tensor semantic checks removal - Revert Transforms tensor semantic checks removal - Revert ReshapeOpsUtils formatting changes - Revert MemRefOps.td whitespace changes Keep only essential changes for memref support in pack/unpack
1 parent 2aca3fd commit 2541aa2

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ FailureOr<LowerPackResult> linalg::lowerPack(RewriterBase &rewriter,
268268
highs[pos] = affine::makeComposedFoldedAffineApply(
269269
rewriter, loc, map, {outerSize, origSize, innerSize});
270270
}
271-
271+
// TODO: Need memref.pad operation to support memref operands
272272
RankedTensorType collapsed = tensor::CollapseShapeOp::inferCollapsedType(
273273
RankedTensorType::Builder(packedTensorType).setShape(stripMinedShape),
274274
packingMetadata.reassociations);
@@ -1030,6 +1030,9 @@ LogicalResult ExtractSliceOfPadTensorSwapPattern::matchAndRewrite(
10301030
static Value getPackOpSourceOrPaddedSource(OpBuilder &builder,
10311031
linalg::PackOp packOp) {
10321032
Value input = packOp.getSource();
1033+
// TODO: Support Memref PackOp. Temporarily return just Op Source.
1034+
if (!packOp.hasPureTensorSemantics())
1035+
return input;
10331036

10341037
if (!packOp.getPaddingValue()) {
10351038
return input;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1889,8 +1889,9 @@ static LogicalResult
18891889
vectorizeUnPackOpPrecondition(linalg::UnPackOp unpackOp,
18901890
ArrayRef<int64_t> inputVectorSizes) {
18911891
// TODO: Support Memref PackOp. Temporarily return failure.
1892-
if (!unpackOp.hasPureTensorSemantics())
1892+
if (!unpackOp.hasPureTensorSemantics()) {
18931893
return failure();
1894+
}
18941895

18951896
if (llvm::any_of(unpackOp.getInnerTiles(), [](OpFoldResult res) {
18961897
return !getConstantIntValue(res).has_value();

mlir/lib/Dialect/Utils/ReshapeOpsUtils.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,12 @@ SmallVector<Range> SliceFromCollapseHelper::getExtractSliceParams(
315315
// have proven that these are not sliced. In this case we just take
316316
// the full extent of each dimension in the reassociation list.
317317
if (linearizedDimensions[it.index()]) {
318-
llvm::append_range(offsetsSizesAndStrides,
319-
llvm::map_range(it.value(), [&](int64_t idx) -> Range {
320-
return {zeroAttr, collapseShapeInputShape[idx],
321-
oneAttr};
322-
}));
318+
llvm::append_range(
319+
offsetsSizesAndStrides,
320+
llvm::map_range(it.value(), [&](int64_t idx) -> Range {
321+
return {zeroAttr, collapseShapeInputShape[idx], oneAttr};
322+
}));
323+
323324
continue;
324325
}
325326

0 commit comments

Comments
 (0)