@@ -1147,13 +1147,13 @@ getPackUnpackRankReducedPerm(ArrayRef<int64_t> shape,
1147
1147
// * the return size becomes the attribute encapsulating the known size, and
1148
1148
// * dim is updated from kDynamic to its actual known value.
1149
1149
static std::pair<int64_t , OpFoldResult>
1150
- getSimplifiedDimSizePair (OpFoldResult tileSizeOfr, PatternRewriter &rewriter ) {
1150
+ getSimplifiedDimSizePair (OpFoldResult tileSizeOfr, Builder &b ) {
1151
1151
int64_t tileSizeForShape =
1152
1152
getConstantIntValue (tileSizeOfr).value_or (ShapedType::kDynamic );
1153
1153
1154
1154
OpFoldResult tileSizeOfrSimplified;
1155
1155
if (tileSizeForShape != ShapedType::kDynamic ) {
1156
- tileSizeOfrSimplified = rewriter .getIndexAttr (tileSizeForShape);
1156
+ tileSizeOfrSimplified = b .getIndexAttr (tileSizeForShape);
1157
1157
} else {
1158
1158
tileSizeOfrSimplified = tileSizeOfr;
1159
1159
}
@@ -1226,28 +1226,18 @@ LogicalResult GeneralizeOuterUnitDimsPackOpPattern::matchAndRewrite(
1226
1226
1227
1227
// 2.1 Create tensor.empty (init value for TransposeOp)
1228
1228
SmallVector<OpFoldResult> transShapeForEmptyOpDynamic;
1229
- SmallVector<int64_t > transShapeForEmptyOpStatic;
1230
1229
1231
1230
// Acquire tensor shape required to create EmptyOp. This will match the inner
1232
- // tile sizes, but the actual data format will depend on whether the tile
1233
- // sizes are static or dynamic (each case leads to a different builder for
1234
- // EmptyOp). Conservatively, prepare for both scenarios.
1231
+ // tile sizes.
1235
1232
size_t idx = numTiles;
1236
1233
while (idx != 0 ) {
1237
1234
transShapeForEmptyOpDynamic.push_back (extractSliceSizes[srcRank - idx]);
1238
- transShapeForEmptyOpStatic.push_back (
1239
- outputShapeForExtractSlice[numTiles - idx]);
1240
1235
idx--;
1241
1236
}
1242
1237
1243
- applyPermutationToVector<int64_t >(transShapeForEmptyOpStatic, perm);
1244
1238
applyPermutationToVector<OpFoldResult>(transShapeForEmptyOpDynamic, perm);
1245
-
1246
- Value empty = ShapedType::isDynamicShape (transShapeForEmptyOpStatic)
1247
- ? rewriter.create <tensor::EmptyOp>(
1248
- loc, transShapeForEmptyOpDynamic, elemType)
1249
- : rewriter.create <tensor::EmptyOp>(
1250
- loc, transShapeForEmptyOpStatic, elemType);
1239
+ Value empty = rewriter.create <tensor::EmptyOp>(
1240
+ loc, transShapeForEmptyOpDynamic, elemType);
1251
1241
1252
1242
// 2.2 Create linalg.transpose
1253
1243
auto transposedOp =
0 commit comments