@@ -585,13 +585,6 @@ struct VectorInterleaveOpConvert final
585
585
LogicalResult
586
586
matchAndRewrite (vector::InterleaveOp interleaveOp, OpAdaptor adaptor,
587
587
ConversionPatternRewriter &rewriter) const override {
588
- // Check the source vector type
589
- VectorType sourceType = interleaveOp.getSourceVectorType ();
590
- if (sourceType.getRank () != 1 || sourceType.isScalable ()) {
591
- return rewriter.notifyMatchFailure (interleaveOp,
592
- " unsupported source vector type" );
593
- }
594
-
595
588
// Check the result vector type
596
589
VectorType oldResultType = interleaveOp.getResultVectorType ();
597
590
Type newResultType = getTypeConverter ()->convertType (oldResultType);
@@ -600,10 +593,11 @@ struct VectorInterleaveOpConvert final
600
593
" unsupported result vector type" );
601
594
602
595
// Interleave the indices
596
+ VectorType sourceType = interleaveOp.getSourceVectorType ();
603
597
int n = sourceType.getNumElements ();
604
598
605
- // Input vectors of size 1 are converted to scalars by the type converter.
606
- // We cannot use spirv::VectorShuffleOp directly in this case, and need to
599
+ // Input vectors of size 1 are converted to scalars by the type converter.
600
+ // We cannot use spirv::VectorShuffleOp directly in this case, and need to
607
601
// use spirv::CompositeConstructOp.
608
602
if (n == 1 ) {
609
603
SmallVector<Value> newOperands (2 );
@@ -622,7 +616,7 @@ struct VectorInterleaveOpConvert final
622
616
rewriter.replaceOpWithNewOp <spirv::VectorShuffleOp>(
623
617
interleaveOp, newResultType, adaptor.getLhs (), adaptor.getRhs (),
624
618
rewriter.getI32ArrayAttr (indices));
625
-
619
+
626
620
return success ();
627
621
}
628
622
};
0 commit comments