Skip to content

Commit 7586aa1

Browse files
author
Yang Bai
committed
refine comment
1 parent 32b9f8c commit 7586aa1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,8 +2146,9 @@ OpFoldResult ExtractOp::fold(FoldAdaptor adaptor) {
21462146
return getVector();
21472147
if (auto res = foldPoisonSrcExtractOp(adaptor.getVector()))
21482148
return res;
2149-
// Fold `arith.constant` indices into the `vector.extract` operation. Make
2150-
// sure that patterns requiring constant indices are added after this fold.
2149+
// Fold `arith.constant` indices into the `vector.extract` operation.
2150+
// Do not stop here as this fold may enable subsequent folds that require
2151+
// constant indices.
21512152
SmallVector<Value> operands = {getVector()};
21522153
auto inplaceFolded = extractInsertFoldConstantOp(*this, adaptor, operands);
21532154

@@ -3149,8 +3150,9 @@ OpFoldResult vector::InsertOp::fold(FoldAdaptor adaptor) {
31493150
// (type mismatch).
31503151
if (getNumIndices() == 0 && getValueToStoreType() == getType())
31513152
return getValueToStore();
3152-
// Fold `arith.constant` indices into the `vector.insert` operation. Make
3153-
// sure that patterns requiring constant indices are added after this fold.
3153+
// Fold `arith.constant` indices into the `vector.insert` operation.
3154+
// Do not stop here as this fold may enable subsequent folds that require
3155+
// constant indices.
31543156
SmallVector<Value> operands = {getValueToStore(), getDest()};
31553157
auto inplaceFolded = extractInsertFoldConstantOp(*this, adaptor, operands);
31563158

0 commit comments

Comments
 (0)