Skip to content

Commit 67391fc

Browse files
[mlir] Construct SmallVector with initial values (NFC) (#169239)
Identified with llvm-use-ranges.
1 parent 54db657 commit 67391fc

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

mlir/lib/Dialect/XeGPU/Transforms/XeGPUSubgroupDistribute.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -989,9 +989,8 @@ struct LoadMatrixDistribution final : public gpu::WarpDistributionPattern {
989989
SmallVector<Value> newOperands = llvm::map_to_vector(
990990
newRetIndices, [&](size_t idx) { return newWarpOp.getResult(idx); });
991991

992-
SmallVector<int64_t> newConstOffsets{matrixOp.getConstOffsets()};
993-
std::fill(newConstOffsets.begin(), newConstOffsets.end(),
994-
ShapedType::kDynamic);
992+
SmallVector<int64_t> newConstOffsets(matrixOp.getConstOffsets().size(),
993+
ShapedType::kDynamic);
995994
DenseI64ArrayAttr newConstOffsetsAttr =
996995
rewriter.getDenseI64ArrayAttr(newConstOffsets);
997996
ValueRange currentOffsets =
@@ -1066,9 +1065,8 @@ struct StoreMatrixDistribution final : public gpu::WarpDistributionPattern {
10661065
SmallVector<Value> newOperands = llvm::map_to_vector(
10671066
newRetIndices, [&](size_t idx) { return newWarpOp.getResult(idx); });
10681067

1069-
SmallVector<int64_t> newConstOffsets{matrixOp.getConstOffsets()};
1070-
std::fill(newConstOffsets.begin(), newConstOffsets.end(),
1071-
ShapedType::kDynamic);
1068+
SmallVector<int64_t> newConstOffsets(matrixOp.getConstOffsets().size(),
1069+
ShapedType::kDynamic);
10721070
DenseI64ArrayAttr newConstOffsetsAttr =
10731071
rewriter.getDenseI64ArrayAttr(newConstOffsets);
10741072
ValueRange currentOffsets =

0 commit comments

Comments
 (0)