Skip to content

Commit 31a0b27

Browse files
committed
More CR addressed.
1 parent 1897a65 commit 31a0b27

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

mlir/include/mlir/Dialect/Vector/Utils/VectorUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ bool isLinearizableVector(VectorType type);
193193
/// for each dimension of the passed in tensor.
194194
Value createReadOrMaskedRead(OpBuilder &builder, Location loc, Value source,
195195
ArrayRef<int64_t> readShape, Value padValue,
196-
bool enableMasking = true);
196+
bool useInBoundsInsteadOfMasking = true);
197197

198198
/// Returns success if `inputVectorSizes` is a valid masking configuraion for
199199
/// given `shape`, i.e., it meets:

mlir/lib/Dialect/Vector/Utils/VectorUtils.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,8 @@ bool vector::isLinearizableVector(VectorType type) {
330330

331331
Value vector::createReadOrMaskedRead(OpBuilder &builder, Location loc,
332332
Value source, ArrayRef<int64_t> readShape,
333-
Value padValue, bool enableMasking) {
333+
Value padValue,
334+
bool useInBoundsInsteadOfMasking) {
334335
assert(llvm::none_of(readShape,
335336
[](int64_t s) { return s == ShapedType::kDynamic; }) &&
336337
"expected static shape");
@@ -344,7 +345,7 @@ Value vector::createReadOrMaskedRead(OpBuilder &builder, Location loc,
344345
int64_t readRank = readShape.size();
345346
auto zero = builder.create<arith::ConstantIndexOp>(loc, 0);
346347
SmallVector<bool> inBoundsVal(readRank, true);
347-
if (!enableMasking) {
348+
if (!useInBoundsInsteadOfMasking) {
348349
// Update the inBounds attribute.
349350
for (unsigned i = 0; i < readRank; i++)
350351
inBoundsVal[i] = (sourceShape[i] == readShape[i]) &&
@@ -358,7 +359,7 @@ Value vector::createReadOrMaskedRead(OpBuilder &builder, Location loc,
358359
/*padding=*/padValue,
359360
/*inBounds=*/inBoundsVal);
360361

361-
if (llvm::equal(readShape, sourceShape) || !enableMasking)
362+
if (llvm::equal(readShape, sourceShape) || !useInBoundsInsteadOfMasking)
362363
return transferReadOp;
363364
SmallVector<OpFoldResult> mixedSourceDims =
364365
tensor::getMixedSizes(builder, loc, source);

0 commit comments

Comments
 (0)