Skip to content

Commit aeea3e0

Browse files
committed
fixup! fixup! [mlir][Vector] Update VectorEmulateNarrowType.cpp (4/N)
isFullyAligned -> isDivisibleInSize
1 parent 91b8aac commit aeea3e0

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ struct ConvertVectorStore final : OpConversionPattern<vector::StoreOp> {
519519

520520
auto origElements = valueToStore.getType().getNumElements();
521521
// Note, per-element-alignment was already verified above.
522-
bool isFullyAligned = origElements % emulatedPerContainerElem == 0;
522+
bool isDivisibleInSize = origElements % emulatedPerContainerElem == 0;
523523

524524
auto stridedMetadata =
525525
rewriter.create<memref::ExtractStridedMetadataOp>(loc, op.getBase());
@@ -535,8 +535,8 @@ struct ConvertVectorStore final : OpConversionPattern<vector::StoreOp> {
535535
getAsOpFoldResult(adaptor.getIndices()));
536536

537537
std::optional<int64_t> foldedNumFrontPadElems =
538-
isFullyAligned ? 0
539-
: getConstantIntValue(linearizedInfo.intraDataOffset);
538+
isDivisibleInSize ? 0
539+
: getConstantIntValue(linearizedInfo.intraDataOffset);
540540

541541
if (!foldedNumFrontPadElems) {
542542
return rewriter.notifyMatchFailure(
@@ -554,7 +554,7 @@ struct ConvertVectorStore final : OpConversionPattern<vector::StoreOp> {
554554
// need unaligned emulation because the store address is aligned and the
555555
// source is a whole byte.
556556
bool emulationRequiresPartialStores =
557-
!isFullyAligned || *foldedNumFrontPadElems != 0;
557+
!isDivisibleInSize || *foldedNumFrontPadElems != 0;
558558
if (!emulationRequiresPartialStores) {
559559
// Basic case: storing full bytes.
560560
auto numElements = origElements / emulatedPerContainerElem;
@@ -881,7 +881,7 @@ struct ConvertVectorLoad final : OpConversionPattern<vector::LoadOp> {
881881

882882
auto origElements = op.getVectorType().getNumElements();
883883
// Note, per-element-alignment was already verified above.
884-
bool isFullyAligned = origElements % emulatedPerContainerElem == 0;
884+
bool isDivisibleInSize = origElements % emulatedPerContainerElem == 0;
885885

886886
auto stridedMetadata =
887887
rewriter.create<memref::ExtractStridedMetadataOp>(loc, op.getBase());
@@ -897,8 +897,8 @@ struct ConvertVectorLoad final : OpConversionPattern<vector::LoadOp> {
897897
getAsOpFoldResult(adaptor.getIndices()));
898898

899899
std::optional<int64_t> foldedIntraVectorOffset =
900-
isFullyAligned ? 0
901-
: getConstantIntValue(linearizedInfo.intraDataOffset);
900+
isDivisibleInSize ? 0
901+
: getConstantIntValue(linearizedInfo.intraDataOffset);
902902

903903
// Always load enough elements which can cover the original elements.
904904
int64_t maxintraDataOffset =
@@ -915,7 +915,7 @@ struct ConvertVectorLoad final : OpConversionPattern<vector::LoadOp> {
915915
result = dynamicallyExtractSubVector(
916916
rewriter, loc, dyn_cast<TypedValue<VectorType>>(result), resultVector,
917917
linearizedInfo.intraDataOffset, origElements);
918-
} else if (!isFullyAligned) {
918+
} else if (!isDivisibleInSize) {
919919
result = staticallyExtractSubvector(
920920
rewriter, loc, result, *foldedIntraVectorOffset, origElements);
921921
}
@@ -1002,7 +1002,7 @@ struct ConvertVectorMaskedLoad final
10021002
auto origType = op.getVectorType();
10031003
auto origElements = origType.getNumElements();
10041004
// Note, per-element-alignment was already verified above.
1005-
bool isFullyAligned = origElements % emulatedPerContainerElem == 0;
1005+
bool isDivisibleInSize = origElements % emulatedPerContainerElem == 0;
10061006

10071007
auto stridedMetadata =
10081008
rewriter.create<memref::ExtractStridedMetadataOp>(loc, op.getBase());
@@ -1017,8 +1017,8 @@ struct ConvertVectorMaskedLoad final
10171017
getAsOpFoldResult(adaptor.getIndices()));
10181018

10191019
std::optional<int64_t> foldedIntraVectorOffset =
1020-
isFullyAligned ? 0
1021-
: getConstantIntValue(linearizedInfo.intraDataOffset);
1020+
isDivisibleInSize ? 0
1021+
: getConstantIntValue(linearizedInfo.intraDataOffset);
10221022

10231023
int64_t maxIntraDataOffset =
10241024
foldedIntraVectorOffset.value_or(emulatedPerContainerElem - 1);
@@ -1042,7 +1042,7 @@ struct ConvertVectorMaskedLoad final
10421042
passthru = dynamicallyInsertSubVector(
10431043
rewriter, loc, passthru, emptyVector, linearizedInfo.intraDataOffset,
10441044
origElements);
1045-
} else if (!isFullyAligned) {
1045+
} else if (!isDivisibleInSize) {
10461046
passthru = staticallyInsertSubvector(rewriter, loc, passthru, emptyVector,
10471047
*foldedIntraVectorOffset);
10481048
}
@@ -1070,7 +1070,7 @@ struct ConvertVectorMaskedLoad final
10701070
mask = dynamicallyInsertSubVector(rewriter, loc, mask, emptyMask,
10711071
linearizedInfo.intraDataOffset,
10721072
origElements);
1073-
} else if (!isFullyAligned) {
1073+
} else if (!isDivisibleInSize) {
10741074
mask = staticallyInsertSubvector(rewriter, loc, op.getMask(), emptyMask,
10751075
*foldedIntraVectorOffset);
10761076
}
@@ -1081,7 +1081,7 @@ struct ConvertVectorMaskedLoad final
10811081
result = dynamicallyExtractSubVector(
10821082
rewriter, loc, result, op.getPassThru(),
10831083
linearizedInfo.intraDataOffset, origElements);
1084-
} else if (!isFullyAligned) {
1084+
} else if (!isDivisibleInSize) {
10851085
result = staticallyExtractSubvector(
10861086
rewriter, loc, result, *foldedIntraVectorOffset, origElements);
10871087
}
@@ -1159,7 +1159,7 @@ struct ConvertVectorTransferRead final
11591159
auto origElements = op.getVectorType().getNumElements();
11601160

11611161
// Note, per-element-alignment was already verified above.
1162-
bool isFullyAligned =
1162+
bool isDivisibleInSize =
11631163
fitsInMultiByteContainerTy(op.getVectorType(), containerElemTy);
11641164

11651165
auto newPadding = rewriter.create<arith::ExtUIOp>(loc, containerElemTy,
@@ -1179,8 +1179,8 @@ struct ConvertVectorTransferRead final
11791179
getAsOpFoldResult(adaptor.getIndices()));
11801180

11811181
std::optional<int64_t> foldedIntraVectorOffset =
1182-
isFullyAligned ? 0
1183-
: getConstantIntValue(linearizedInfo.intraDataOffset);
1182+
isDivisibleInSize ? 0
1183+
: getConstantIntValue(linearizedInfo.intraDataOffset);
11841184

11851185
int64_t maxIntraDataOffset =
11861186
foldedIntraVectorOffset.value_or(emulatedPerContainerElem - 1);
@@ -1204,7 +1204,7 @@ struct ConvertVectorTransferRead final
12041204
result = dynamicallyExtractSubVector(rewriter, loc, bitCast, zeros,
12051205
linearizedInfo.intraDataOffset,
12061206
origElements);
1207-
} else if (!isFullyAligned) {
1207+
} else if (!isDivisibleInSize) {
12081208
result = staticallyExtractSubvector(
12091209
rewriter, loc, result, *foldedIntraVectorOffset, origElements);
12101210
}

0 commit comments

Comments
 (0)