Skip to content

Commit 19cac4f

Browse files
committed
undo formatting noise
1 parent ed2b46a commit 19cac4f

File tree

1 file changed

+20
-25
lines changed

1 file changed

+20
-25
lines changed

mlir/lib/Dialect/Vector/IR/VectorOps.cpp

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5696,8 +5696,8 @@ static VectorType trimTrailingOneDims(VectorType oldType) {
56965696
///
56975697
/// Looks at `vector.shape_cast` Ops that simply "drop" the trailing unit
56985698
/// dimension. If the input vector comes from `vector.create_mask` for which
5699-
/// the corresponding mask input value is 1 (e.g. `%c1` below), then it is
5700-
/// safe to fold shape_cast into create_mask.
5699+
/// the corresponding mask input value is 1 (e.g. `%c1` below), then it is safe
5700+
/// to fold shape_cast into create_mask.
57015701
///
57025702
/// BEFORE:
57035703
/// %1 = vector.create_mask %c1, %dim, %c1, %c1 : vector<1x[4]x1x1xi1>
@@ -5964,8 +5964,8 @@ LogicalResult TypeCastOp::verify() {
59645964
auto resultType = getResultMemRefType();
59655965
if (getElementTypeOrSelf(getElementTypeOrSelf(sourceType)) !=
59665966
getElementTypeOrSelf(getElementTypeOrSelf(resultType)))
5967-
return emitOpError("expects result and operand with same underlying "
5968-
"scalar type: ")
5967+
return emitOpError(
5968+
"expects result and operand with same underlying scalar type: ")
59695969
<< resultType;
59705970
if (extractShape(sourceType) != extractShape(resultType))
59715971
return emitOpError(
@@ -6003,8 +6003,7 @@ OpFoldResult vector::TransposeOp::fold(FoldAdaptor adaptor) {
60036003
return attr.reshape(getResultVectorType());
60046004

60056005
// Eliminate identity transpose ops. This happens when the dimensions of the
6006-
// input vector remain in their original order after the transpose
6007-
// operation.
6006+
// input vector remain in their original order after the transpose operation.
60086007
ArrayRef<int64_t> perm = getPermutation();
60096008

60106009
// Check if the permutation of the dimensions contains sequential values:
@@ -6063,8 +6062,7 @@ class TransposeFolder final : public OpRewritePattern<vector::TransposeOp> {
60636062
return result;
60646063
};
60656064

6066-
// Return if the input of 'transposeOp' is not defined by another
6067-
// transpose.
6065+
// Return if the input of 'transposeOp' is not defined by another transpose.
60686066
vector::TransposeOp parentTransposeOp =
60696067
transposeOp.getVector().getDefiningOp<vector::TransposeOp>();
60706068
if (!parentTransposeOp)
@@ -6208,9 +6206,8 @@ LogicalResult ConstantMaskOp::verify() {
62086206
return emitOpError(
62096207
"only supports 'none set' or 'all set' scalable dimensions");
62106208
}
6211-
// Verify that if one mask dim size is zero, they all should be zero
6212-
// (because the mask region is a conjunction of each mask dimension
6213-
// interval).
6209+
// Verify that if one mask dim size is zero, they all should be zero (because
6210+
// the mask region is a conjunction of each mask dimension interval).
62146211
bool anyZeros = llvm::is_contained(maskDimSizes, 0);
62156212
bool allZeros = llvm::all_of(maskDimSizes, [](int64_t s) { return s == 0; });
62166213
if (anyZeros && !allZeros)
@@ -6248,8 +6245,7 @@ void CreateMaskOp::build(OpBuilder &builder, OperationState &result,
62486245

62496246
LogicalResult CreateMaskOp::verify() {
62506247
auto vectorType = llvm::cast<VectorType>(getResult().getType());
6251-
// Verify that an operand was specified for each result vector each
6252-
// dimension.
6248+
// Verify that an operand was specified for each result vector each dimension.
62536249
if (vectorType.getRank() == 0) {
62546250
if (getNumOperands() != 1)
62556251
return emitOpError(
@@ -6457,7 +6453,7 @@ void MaskOp::ensureTerminator(Region &region, Builder &builder, Location loc) {
64576453
OpTrait::SingleBlockImplicitTerminator<vector::YieldOp>::Impl<
64586454
MaskOp>::ensureTerminator(region, builder, loc);
64596455
// Keep the default yield terminator if the number of masked operations is
6460-
// not the expected. This case will trigger a verification failure.
6456+
// not as expected. This case will trigger a verification failure.
64616457
Block &block = region.front();
64626458
if (block.getOperations().size() != 2)
64636459
return;
@@ -6561,9 +6557,9 @@ LogicalResult MaskOp::fold(FoldAdaptor adaptor,
65616557
return success();
65626558
}
65636559

6564-
// Elides empty vector.mask operations with or without return values.
6565-
// Propagates the yielded values by the vector.yield terminator, if any, or
6566-
// erases the op, otherwise.
6560+
// Elides empty vector.mask operations with or without return values. Propagates
6561+
// the yielded values by the vector.yield terminator, if any, or erases the op,
6562+
// otherwise.
65676563
class ElideEmptyMaskOp : public OpRewritePattern<MaskOp> {
65686564
using OpRewritePattern::OpRewritePattern;
65696565

@@ -6666,8 +6662,7 @@ OpFoldResult SplatOp::fold(FoldAdaptor adaptor) {
66666662
if (!isa_and_nonnull<IntegerAttr, FloatAttr>(constOperand))
66676663
return {};
66686664

6669-
// SplatElementsAttr::get treats single value for second arg as being a
6670-
// splat.
6665+
// SplatElementsAttr::get treats single value for second arg as being a splat.
66716666
return SplatElementsAttr::get(getType(), {constOperand});
66726667
}
66736668

@@ -6789,12 +6784,12 @@ Operation *mlir::vector::maskOperation(OpBuilder &builder,
67896784
}
67906785

67916786
/// Creates a vector select operation that picks values from `newValue` or
6792-
/// `passthru` for each result vector lane based on `mask`. This utility is
6793-
/// used to propagate the pass-thru value of vector.mask or for cases where
6794-
/// only the pass-thru value propagation is needed. VP intrinsics do not
6795-
/// support pass-thru values and every mask-out lane is set to poison. LLVM
6796-
/// backends are usually able to match op + select patterns and fold them into
6797-
/// a native target instructions.
6787+
/// `passthru` for each result vector lane based on `mask`. This utility is used
6788+
/// to propagate the pass-thru value of vector.mask or for cases where only the
6789+
/// pass-thru value propagation is needed. VP intrinsics do not support
6790+
/// pass-thru values and every mask-out lane is set to poison. LLVM backends are
6791+
/// usually able to match op + select patterns and fold them into a native
6792+
/// target instructions.
67986793
Value mlir::vector::selectPassthru(OpBuilder &builder, Value mask,
67996794
Value newValue, Value passthru) {
68006795
if (!mask)

0 commit comments

Comments
 (0)