Skip to content

Commit a9651e1

Browse files
committed
fixup! [mlir][vector] Restrict DropInnerMostUnitDimsTransferRead
Switch to using isZeroIndex from StaticValueUtils.h
1 parent 545c8cf commit a9651e1

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

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

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,17 +1295,7 @@ class DropInnerMostUnitDimsTransferRead
12951295

12961296
// Make sure that the indixes to be dropped are equal 0.
12971297
// TODO: Deal with cases when the indices are not 0.
1298-
auto isZeroIdx = [](Value idx) {
1299-
Attribute attr;
1300-
APInt value;
1301-
if (!matchPattern(idx, m_Constant(&attr)))
1302-
return false;
1303-
if (matchPattern(attr, m_ConstantInt(&value)))
1304-
if (!value.isZero())
1305-
return false;
1306-
return true;
1307-
};
1308-
if (!llvm::all_of(readOp.getIndices().take_back(dimsToDrop), isZeroIdx))
1298+
if (!llvm::all_of(readOp.getIndices().take_back(dimsToDrop), isZeroIndex))
13091299
return failure();
13101300

13111301
auto resultTargetVecType =

0 commit comments

Comments
 (0)