Skip to content

Commit 3765470

Browse files
committed
Address comments
1 parent c56479d commit 3765470

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2955,7 +2955,7 @@ OpFoldResult vector::InsertOp::fold(FoldAdaptor adaptor) {
29552955
// Fold "vector.insert %v, %dest [] : vector<2x2xf32> from vector<2x2xf32>" to
29562956
// %v. Note: Do not fold "vector.insert %v, %dest [] : f32 into vector<f32>"
29572957
// (type mismatch).
2958-
if (getNumIndices() == 0 && getSourceType() == getResult().getType())
2958+
if (getNumIndices() == 0 && getSourceType() == getType())
29592959
return getSource();
29602960
return {};
29612961
}

mlir/test/Dialect/Vector/canonicalize.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2745,11 +2745,11 @@ func.func @vector_insert_const_regression(%arg0: i8) -> vector<4xi8> {
27452745

27462746
// -----
27472747

2748-
// CHECK-LABEL: func @insert_into_0d_regression(
2748+
// CHECK-LABEL: func @insert_no_fold_type_mismatch(
27492749
// CHECK-SAME: %[[v:.*]]: vector<f32>)
27502750
// CHECK: %[[extract:.*]] = vector.insert %{{.*}}, %[[v]] [] : f32 into vector<f32>
27512751
// CHECK: return %[[extract]]
2752-
func.func @insert_into_0d_regression(%v: vector<f32>) -> vector<f32> {
2752+
func.func @insert_no_fold_type_mismatch(%v: vector<f32>) -> vector<f32> {
27532753
%cst = arith.constant 0.000000e+00 : f32
27542754
%0 = vector.insert %cst, %v [] : f32 into vector<f32>
27552755
return %0 : vector<f32>

0 commit comments

Comments
 (0)