File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
lib/Dialect/Vector/Transforms Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -2462,6 +2462,9 @@ struct BubbleUpBitCastForStridedSliceInsert
2462
2462
VectorType castSrcType = bitcastOp.getSourceVectorType ();
2463
2463
VectorType castDstType = bitcastOp.getResultVectorType ();
2464
2464
assert (castSrcType.getRank () == castDstType.getRank ());
2465
+ // Skip 0-D vector which will not from InsertStridedSliceOp.
2466
+ if (castSrcType.getRank () == 0 )
2467
+ return failure ();
2465
2468
2466
2469
int64_t castSrcLastDim = castSrcType.getShape ().back ();
2467
2470
int64_t castDstLastDim = castDstType.getShape ().back ();
Original file line number Diff line number Diff line change @@ -525,3 +525,11 @@ func.func @bubble_up_bitcast_in_strided_slice_insert_larger_odd_shape(%dst: vect
525
525
%cast = vector.bitcast %0: vector <8 xf16 > to vector <4 xf32 >
526
526
return %cast: vector <4 xf32 >
527
527
}
528
+
529
+ // Make sure not crash on 0-D vector.
530
+ // CHECK-LABEL:func.func @vec_0D
531
+ // CHECK-NEXT:vector.bitcast
532
+ func.func @vec_0D (%arg0: vector <f32 >) -> vector <i32 > {
533
+ %0 = vector.bitcast %arg0 : vector <f32 > to vector <i32 >
534
+ return %0 : vector <i32 >
535
+ }
You can’t perform that action at this time.
0 commit comments