Skip to content

Commit 99fc8ee

Browse files
committed
[mlir][vector] Update the internal representation of in_bounds
This PR updates the internal representation of the `in_bounds` attribute for `xfer_read`/`xfer_write` Ops. Currently we use `ArrayAttr` - that's being updated to `DenseBoolArrayAttribute`. Note that this means that the asm format of the `xfer_{read|_write}` will change from: ```mlir vector.transfer_read %arg0[%0, %1], %cst {in_bounds = [true], permutation_map = #map3} : memref<12x16xf32>, vector<8xf32> ``` to: ```mlir vector.transfer_read %arg0[%0, %1], %cst {in_bounds = array<i1: true>, permutation_map = #map3} : memref<12x16xf32>, vector<8xf32> ```
1 parent 85887d2 commit 99fc8ee

File tree

10 files changed

+63
-68
lines changed

10 files changed

+63
-68
lines changed

mlir/include/mlir/Dialect/Vector/IR/VectorOps.td

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,7 +1363,7 @@ def Vector_TransferReadOp :
13631363
AffineMapAttr:$permutation_map,
13641364
AnyType:$padding,
13651365
Optional<VectorOf<[I1]>>:$mask,
1366-
BoolArrayAttr:$in_bounds)>,
1366+
DenseBoolArrayAttr:$in_bounds)>,
13671367
Results<(outs AnyVectorOfAnyRank:$vector)> {
13681368

13691369
let summary = "Reads a supervector from memory into an SSA vector value.";
@@ -1558,7 +1558,7 @@ def Vector_TransferReadOp :
15581558
"Value":$source,
15591559
"ValueRange":$indices,
15601560
"AffineMapAttr":$permutationMapAttr,
1561-
"ArrayAttr":$inBoundsAttr)>,
1561+
"DenseBoolArrayAttr":$inBoundsAttr)>,
15621562
/// 2. Builder that sets padding to zero and an empty mask (variant without attrs).
15631563
OpBuilder<(ins "VectorType":$vectorType,
15641564
"Value":$source,
@@ -1610,7 +1610,7 @@ def Vector_TransferWriteOp :
16101610
Variadic<Index>:$indices,
16111611
AffineMapAttr:$permutation_map,
16121612
Optional<VectorOf<[I1]>>:$mask,
1613-
BoolArrayAttr:$in_bounds)>,
1613+
DenseBoolArrayAttr:$in_bounds)>,
16141614
Results<(outs Optional<AnyRankedTensor>:$result)> {
16151615

16161616
let summary = "The vector.transfer_write op writes a supervector to memory.";
@@ -1721,13 +1721,13 @@ def Vector_TransferWriteOp :
17211721
"ValueRange":$indices,
17221722
"AffineMapAttr":$permutationMapAttr,
17231723
"Value":$mask,
1724-
"ArrayAttr":$inBoundsAttr)>,
1724+
"DenseBoolArrayAttr":$inBoundsAttr)>,
17251725
/// 2. Builder with type inference that sets an empty mask (variant with attrs).
17261726
OpBuilder<(ins "Value":$vector,
17271727
"Value":$dest,
17281728
"ValueRange":$indices,
17291729
"AffineMapAttr":$permutationMapAttr,
1730-
"ArrayAttr":$inBoundsAttr)>,
1730+
"DenseBoolArrayAttr":$inBoundsAttr)>,
17311731
/// 3. Builder with type inference that sets an empty mask (variant without attrs).
17321732
OpBuilder<(ins "Value":$vector,
17331733
"Value":$dest,

mlir/include/mlir/Interfaces/VectorInterfaces.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def VectorTransferOpInterface : OpInterface<"VectorTransferOpInterface"> {
9898
dimension whether it is in-bounds or not. (Broadcast dimensions are
9999
always in-bounds).
100100
}],
101-
/*retTy=*/"::mlir::ArrayAttr",
101+
/*retTy=*/"::mlir::ArrayRef<bool>",
102102
/*methodName=*/"getInBounds",
103103
/*args=*/(ins)
104104
>,
@@ -241,7 +241,7 @@ def VectorTransferOpInterface : OpInterface<"VectorTransferOpInterface"> {
241241
if ($_op.isBroadcastDim(dim))
242242
return true;
243243
auto inBounds = $_op.getInBounds();
244-
return ::llvm::cast<::mlir::BoolAttr>(inBounds[dim]).getValue();
244+
return inBounds[dim];
245245
}
246246

247247
/// Helper function to account for the fact that `permutationMap` results

mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,11 @@ static void generateInBoundsCheck(
242242
}
243243

244244
/// Given an ArrayAttr, return a copy where the first element is dropped.
245-
static ArrayAttr dropFirstElem(OpBuilder &b, ArrayAttr attr) {
245+
static DenseBoolArrayAttr dropFirstElem(OpBuilder &b, DenseBoolArrayAttr attr) {
246246
if (!attr)
247247
return attr;
248-
return ArrayAttr::get(b.getContext(), attr.getValue().drop_front());
248+
return DenseBoolArrayAttr::get(b.getContext(),
249+
attr.asArrayRef().drop_front());
249250
}
250251

251252
/// Add the pass label to a vector transfer op if its rank is not the target

mlir/lib/Dialect/ArmSME/Transforms/VectorLegalization.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,7 @@ struct LegalizeMultiTileTransferWriteAsStoreLoop
498498
loc, slice, writeOp.getSource(), ValueRange{storeRow, storeCol},
499499
AffineMapAttr::get(writeOp.getPermutationMap().dropResult(0)),
500500
sliceMask,
501-
rewriter.getBoolArrayAttr(
502-
ArrayRef<bool>(writeOp.getInBoundsValues()).drop_front()));
501+
rewriter.getDenseBoolArrayAttr(writeOp.getInBounds().drop_front()));
503502
}
504503

505504
rewriter.eraseOp(writeOp);
@@ -692,13 +691,12 @@ struct LiftIllegalVectorTransposeToMemory
692691
transposeOp.getPermutation(), getContext());
693692
auto transposedSubview = rewriter.create<memref::TransposeOp>(
694693
loc, readSubview, AffineMapAttr::get(transposeMap));
695-
ArrayAttr inBoundsAttr = illegalRead.getInBoundsAttr();
694+
DenseBoolArrayAttr inBoundsAttr = illegalRead.getInBoundsAttr();
696695
// - The `in_bounds` attribute
697696
if (inBoundsAttr) {
698-
SmallVector<Attribute> inBoundsValues(inBoundsAttr.begin(),
699-
inBoundsAttr.end());
697+
SmallVector<bool> inBoundsValues(inBoundsAttr.asArrayRef());
700698
applyPermutationToVector(inBoundsValues, transposeOp.getPermutation());
701-
inBoundsAttr = rewriter.getArrayAttr(inBoundsValues);
699+
inBoundsAttr = rewriter.getDenseBoolArrayAttr(inBoundsValues);
702700
}
703701

704702
VectorType legalReadType = resultType.clone(readType.getElementType());

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ static Value buildVectorWrite(RewriterBase &rewriter, Value value,
636636
if (auto maskOp = dyn_cast<vector::MaskingOpInterface>(write)) {
637637
auto maskedWriteOp = cast<vector::TransferWriteOp>(maskOp.getMaskableOp());
638638
SmallVector<bool> inBounds(maskedWriteOp.getVectorType().getRank(), true);
639-
maskedWriteOp.setInBoundsAttr(rewriter.getBoolArrayAttr(inBounds));
639+
maskedWriteOp.setInBoundsAttr(rewriter.getDenseBoolArrayAttr(inBounds));
640640
}
641641

642642
LDBG("vectorized op: " << *write << "\n");
@@ -1362,7 +1362,7 @@ vectorizeAsLinalgGeneric(RewriterBase &rewriter, VectorizationState &state,
13621362
if (auto maskOp = dyn_cast<vector::MaskingOpInterface>(read)) {
13631363
SmallVector<bool> inBounds(readType.getRank(), true);
13641364
cast<vector::TransferReadOp>(maskOp.getMaskableOp())
1365-
.setInBoundsAttr(rewriter.getBoolArrayAttr(inBounds));
1365+
.setInBoundsAttr(rewriter.getDenseBoolArrayAttr(inBounds));
13661366
}
13671367

13681368
// 3.c. Not all ops support 0-d vectors, extract the scalar for now.
@@ -2364,7 +2364,7 @@ struct PadOpVectorizationWithTransferReadPattern
23642364
rewriter.modifyOpInPlace(xferOp, [&]() {
23652365
SmallVector<bool> inBounds(xferOp.getVectorType().getRank(), false);
23662366
xferOp->setAttr(xferOp.getInBoundsAttrName(),
2367-
rewriter.getBoolArrayAttr(inBounds));
2367+
rewriter.getDenseBoolArrayAttr(inBounds));
23682368
xferOp.getSourceMutable().assign(padOp.getSource());
23692369
xferOp.getPaddingMutable().assign(padValue);
23702370
});
@@ -2443,7 +2443,7 @@ struct PadOpVectorizationWithTransferWritePattern
24432443
auto newXferOp = rewriter.replaceOpWithNewOp<vector::TransferWriteOp>(
24442444
xferOp, padOp.getSource().getType(), xferOp.getVector(),
24452445
padOp.getSource(), xferOp.getIndices(), xferOp.getPermutationMapAttr(),
2446-
xferOp.getMask(), rewriter.getBoolArrayAttr(inBounds));
2446+
xferOp.getMask(), rewriter.getDenseBoolArrayAttr(inBounds));
24472447
rewriter.replaceOp(trimPadding, newXferOp->getResult(0));
24482448

24492449
return success();
@@ -2747,7 +2747,7 @@ LogicalResult LinalgCopyVTRForwardingPattern::matchAndRewrite(
27472747
Value res = rewriter.create<vector::TransferReadOp>(
27482748
xferOp.getLoc(), vectorType, in, xferOp.getIndices(),
27492749
xferOp.getPermutationMapAttr(), xferOp.getPadding(), xferOp.getMask(),
2750-
rewriter.getBoolArrayAttr(
2750+
rewriter.getDenseBoolArrayAttr(
27512751
SmallVector<bool>(vectorType.getRank(), false)));
27522752

27532753
if (maybeFillOp)
@@ -2806,7 +2806,7 @@ LogicalResult LinalgCopyVTWForwardingPattern::matchAndRewrite(
28062806
rewriter.create<vector::TransferWriteOp>(
28072807
xferOp.getLoc(), vector, out, xferOp.getIndices(),
28082808
xferOp.getPermutationMapAttr(), xferOp.getMask(),
2809-
rewriter.getBoolArrayAttr(
2809+
rewriter.getDenseBoolArrayAttr(
28102810
SmallVector<bool>(vector.getType().getRank(), false)));
28112811

28122812
rewriter.eraseOp(copyOp);
@@ -3306,7 +3306,7 @@ struct Conv1DGenerator
33063306
SmallVector<bool> inBounds(maskShape.size(), true);
33073307
auto xferOp = cast<VectorTransferOpInterface>(opToMask);
33083308
xferOp->setAttr(xferOp.getInBoundsAttrName(),
3309-
rewriter.getBoolArrayAttr(inBounds));
3309+
rewriter.getDenseBoolArrayAttr(inBounds));
33103310

33113311
SmallVector<OpFoldResult> mixedDims = vector::getMixedSizesXfer(
33123312
cast<LinalgOp>(op).hasPureTensorSemantics(), opToMask, rewriter);

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

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3802,7 +3802,7 @@ void ExtractStridedSliceOp::getCanonicalizationPatterns(
38023802
void TransferReadOp::build(OpBuilder &builder, OperationState &result,
38033803
VectorType vectorType, Value source,
38043804
ValueRange indices, AffineMapAttr permutationMapAttr,
3805-
/*optional*/ ArrayAttr inBoundsAttr) {
3805+
/*optional*/ DenseBoolArrayAttr inBoundsAttr) {
38063806
Type elemType = llvm::cast<ShapedType>(source.getType()).getElementType();
38073807
Value padding = builder.create<arith::ConstantOp>(
38083808
result.location, elemType, builder.getZeroAttr(elemType));
@@ -3817,8 +3817,8 @@ void TransferReadOp::build(OpBuilder &builder, OperationState &result,
38173817
std::optional<ArrayRef<bool>> inBounds) {
38183818
auto permutationMapAttr = AffineMapAttr::get(permutationMap);
38193819
auto inBoundsAttr = (inBounds && !inBounds.value().empty())
3820-
? builder.getBoolArrayAttr(inBounds.value())
3821-
: builder.getBoolArrayAttr(
3820+
? builder.getDenseBoolArrayAttr(inBounds.value())
3821+
: builder.getDenseBoolArrayAttr(
38223822
SmallVector<bool>(vectorType.getRank(), false));
38233823
build(builder, result, vectorType, source, indices, permutationMapAttr,
38243824
inBoundsAttr);
@@ -3833,8 +3833,8 @@ void TransferReadOp::build(OpBuilder &builder, OperationState &result,
38333833
llvm::cast<ShapedType>(source.getType()), vectorType);
38343834
auto permutationMapAttr = AffineMapAttr::get(permutationMap);
38353835
auto inBoundsAttr = (inBounds && !inBounds.value().empty())
3836-
? builder.getBoolArrayAttr(inBounds.value())
3837-
: builder.getBoolArrayAttr(
3836+
? builder.getDenseBoolArrayAttr(inBounds.value())
3837+
: builder.getDenseBoolArrayAttr(
38383838
SmallVector<bool>(vectorType.getRank(), false));
38393839
build(builder, result, vectorType, source, indices, permutationMapAttr,
38403840
padding,
@@ -3886,7 +3886,7 @@ static LogicalResult
38863886
verifyTransferOp(VectorTransferOpInterface op, ShapedType shapedType,
38873887
VectorType vectorType, VectorType maskType,
38883888
VectorType inferredMaskType, AffineMap permutationMap,
3889-
ArrayAttr inBounds) {
3889+
ArrayRef<bool> inBounds) {
38903890
if (op->hasAttr("masked")) {
38913891
return op->emitOpError("masked attribute has been removed. "
38923892
"Use in_bounds instead.");
@@ -3959,8 +3959,7 @@ verifyTransferOp(VectorTransferOpInterface op, ShapedType shapedType,
39593959
<< AffineMapAttr::get(permutationMap)
39603960
<< " vs inBounds of size: " << inBounds.size();
39613961
for (unsigned int i = 0, e = permutationMap.getNumResults(); i < e; ++i)
3962-
if (isa<AffineConstantExpr>(permutationMap.getResult(i)) &&
3963-
!llvm::cast<BoolAttr>(inBounds.getValue()[i]).getValue())
3962+
if (isa<AffineConstantExpr>(permutationMap.getResult(i)) && inBounds[i])
39643963
return op->emitOpError("requires broadcast dimensions to be in-bounds");
39653964

39663965
return success();
@@ -4041,7 +4040,7 @@ ParseResult TransferReadOp::parse(OpAsmParser &parser, OperationState &result) {
40414040
Attribute inBoundsAttr = result.attributes.get(inBoundsAttrName);
40424041
if (!inBoundsAttr) {
40434042
result.addAttribute(inBoundsAttrName,
4044-
builder.getBoolArrayAttr(
4043+
builder.getDenseBoolArrayAttr(
40454044
SmallVector<bool>(permMap.getNumResults(), false)));
40464045
}
40474046
if (parser.resolveOperand(sourceInfo, shapedType, result.operands) ||
@@ -4169,7 +4168,7 @@ static LogicalResult foldTransferInBoundsAttribute(TransferOp op) {
41694168
return failure();
41704169
// OpBuilder is only used as a helper to build an I64ArrayAttr.
41714170
OpBuilder b(op.getContext());
4172-
op.setInBoundsAttr(b.getBoolArrayAttr(newInBounds));
4171+
op.setInBoundsAttr(b.getDenseBoolArrayAttr(newInBounds));
41734172
return success();
41744173
}
41754174

@@ -4339,7 +4338,7 @@ void TransferWriteOp::build(OpBuilder &builder, OperationState &result,
43394338
Value vector, Value dest, ValueRange indices,
43404339
AffineMapAttr permutationMapAttr,
43414340
/*optional*/ Value mask,
4342-
/*optional*/ ArrayAttr inBoundsAttr) {
4341+
/*optional*/ DenseBoolArrayAttr inBoundsAttr) {
43434342
Type resultType = llvm::dyn_cast<RankedTensorType>(dest.getType());
43444343
build(builder, result, resultType, vector, dest, indices, permutationMapAttr,
43454344
mask, inBoundsAttr);
@@ -4349,7 +4348,7 @@ void TransferWriteOp::build(OpBuilder &builder, OperationState &result,
43494348
void TransferWriteOp::build(OpBuilder &builder, OperationState &result,
43504349
Value vector, Value dest, ValueRange indices,
43514350
AffineMapAttr permutationMapAttr,
4352-
/*optional*/ ArrayAttr inBoundsAttr) {
4351+
/*optional*/ DenseBoolArrayAttr inBoundsAttr) {
43534352
build(builder, result, vector, dest, indices, permutationMapAttr,
43544353
/*mask=*/Value(), inBoundsAttr);
43554354
}
@@ -4363,8 +4362,8 @@ void TransferWriteOp::build(OpBuilder &builder, OperationState &result,
43634362
auto permutationMapAttr = AffineMapAttr::get(permutationMap);
43644363
auto inBoundsAttr =
43654364
(inBounds && !inBounds.value().empty())
4366-
? builder.getBoolArrayAttr(inBounds.value())
4367-
: builder.getBoolArrayAttr(SmallVector<bool>(
4365+
? builder.getDenseBoolArrayAttr(inBounds.value())
4366+
: builder.getDenseBoolArrayAttr(SmallVector<bool>(
43684367
llvm::cast<VectorType>(vector.getType()).getRank(), false));
43694368
build(builder, result, vector, dest, indices, permutationMapAttr,
43704369
/*mask=*/Value(), inBoundsAttr);
@@ -4422,7 +4421,7 @@ ParseResult TransferWriteOp::parse(OpAsmParser &parser,
44224421
Attribute inBoundsAttr = result.attributes.get(inBoundsAttrName);
44234422
if (!inBoundsAttr) {
44244423
result.addAttribute(inBoundsAttrName,
4425-
builder.getBoolArrayAttr(
4424+
builder.getDenseBoolArrayAttr(
44264425
SmallVector<bool>(permMap.getNumResults(), false)));
44274426
}
44284427
if (parser.resolveOperand(vectorInfo, vectorType, result.operands) ||
@@ -4775,7 +4774,7 @@ struct SwapExtractSliceOfTransferWrite
47754774
auto newTransferWriteOp = rewriter.create<TransferWriteOp>(
47764775
transferOp.getLoc(), transferOp.getVector(), newExtractOp.getResult(),
47774776
transferOp.getIndices(), transferOp.getPermutationMapAttr(),
4778-
rewriter.getBoolArrayAttr(newInBounds));
4777+
rewriter.getDenseBoolArrayAttr(newInBounds));
47794778
rewriter.modifyOpInPlace(insertOp, [&]() {
47804779
insertOp.getSourceMutable().assign(newTransferWriteOp.getResult());
47814780
});

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

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,14 @@ using namespace mlir::vector;
2222

2323
/// Transpose a vector transfer op's `in_bounds` attribute by applying reverse
2424
/// permutation based on the given indices.
25-
static ArrayAttr
26-
inverseTransposeInBoundsAttr(OpBuilder &builder, ArrayAttr attr,
25+
static DenseBoolArrayAttr
26+
inverseTransposeInBoundsAttr(OpBuilder &builder, ArrayRef<bool> inBounds,
2727
const SmallVector<unsigned> &permutation) {
2828
SmallVector<bool> newInBoundsValues(permutation.size());
2929
size_t index = 0;
3030
for (unsigned pos : permutation)
31-
newInBoundsValues[pos] =
32-
cast<BoolAttr>(attr.getValue()[index++]).getValue();
33-
return builder.getBoolArrayAttr(newInBoundsValues);
31+
newInBoundsValues[pos] = inBounds[index++];
32+
return builder.getDenseBoolArrayAttr(newInBoundsValues);
3433
}
3534

3635
/// Extend the rank of a vector Value by `addedRanks` by adding outer unit
@@ -132,7 +131,7 @@ struct TransferReadPermutationLowering
132131
}
133132

134133
// Transpose in_bounds attribute.
135-
ArrayAttr newInBoundsAttr =
134+
DenseBoolArrayAttr newInBoundsAttr =
136135
inverseTransposeInBoundsAttr(rewriter, op.getInBounds(), permutation);
137136

138137
// Generate new transfer_read operation.
@@ -205,7 +204,7 @@ struct TransferWritePermutationLowering
205204
});
206205

207206
// Transpose in_bounds attribute.
208-
ArrayAttr newInBoundsAttr =
207+
DenseBoolArrayAttr newInBoundsAttr =
209208
inverseTransposeInBoundsAttr(rewriter, op.getInBounds(), permutation);
210209

211210
// Generate new transfer_write operation.
@@ -298,7 +297,8 @@ struct TransferWriteNonPermutationLowering
298297
for (int64_t i = 0, e = op.getVectorType().getRank(); i < e; ++i) {
299298
newInBoundsValues.push_back(op.isDimInBounds(i));
300299
}
301-
ArrayAttr newInBoundsAttr = rewriter.getBoolArrayAttr(newInBoundsValues);
300+
DenseBoolArrayAttr newInBoundsAttr =
301+
rewriter.getDenseBoolArrayAttr(newInBoundsValues);
302302
auto newWrite = rewriter.create<vector::TransferWriteOp>(
303303
op.getLoc(), newVec, op.getSource(), op.getIndices(),
304304
AffineMapAttr::get(newMap), newMask, newInBoundsAttr);
@@ -386,11 +386,8 @@ struct TransferOpReduceRank
386386

387387
VectorType newReadType = VectorType::get(
388388
newShape, originalVecType.getElementType(), newScalableDims);
389-
ArrayAttr newInBoundsAttr =
390-
op.getInBounds()
391-
? rewriter.getArrayAttr(
392-
op.getInBoundsAttr().getValue().take_back(reducedShapeRank))
393-
: ArrayAttr();
389+
DenseBoolArrayAttr newInBoundsAttr = rewriter.getDenseBoolArrayAttr(
390+
op.getInBounds().take_back(reducedShapeRank));
394391
Value newRead = rewriter.create<vector::TransferReadOp>(
395392
op.getLoc(), newReadType, op.getSource(), op.getIndices(),
396393
AffineMapAttr::get(newMap), op.getPadding(), op.getMask(),

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,9 @@ struct CastAwayTransferReadLeadingOneDim
248248
AffineMap::get(oldMap.getNumDims(), oldMap.getNumSymbols(), newResults,
249249
rewriter.getContext());
250250

251-
ArrayAttr inBoundsAttr;
252-
if (read.getInBounds())
253-
inBoundsAttr = rewriter.getArrayAttr(
254-
read.getInBoundsAttr().getValue().take_back(newType.getRank()));
251+
DenseBoolArrayAttr inBoundsAttr;
252+
inBoundsAttr = rewriter.getDenseBoolArrayAttr(
253+
read.getInBoundsAttr().asArrayRef().take_back(newType.getRank()));
255254

256255
Value mask = Value();
257256
if (read.getMask()) {
@@ -302,10 +301,9 @@ struct CastAwayTransferWriteLeadingOneDim
302301
AffineMap::get(oldMap.getNumDims(), oldMap.getNumSymbols(), newResults,
303302
rewriter.getContext());
304303

305-
ArrayAttr inBoundsAttr;
306-
if (write.getInBounds())
307-
inBoundsAttr = rewriter.getArrayAttr(
308-
write.getInBoundsAttr().getValue().take_back(newType.getRank()));
304+
DenseBoolArrayAttr inBoundsAttr;
305+
inBoundsAttr = rewriter.getDenseBoolArrayAttr(
306+
write.getInBoundsAttr().asArrayRef().take_back(newType.getRank()));
309307

310308
auto newVector = rewriter.create<vector::ExtractOp>(
311309
write.getLoc(), write.getVector(), splatZero(dropDim));

0 commit comments

Comments
 (0)