@@ -585,24 +585,22 @@ struct VectorInterleaveOpConvert final
585
585
LogicalResult
586
586
matchAndRewrite (vector::InterleaveOp interleaveOp, OpAdaptor adaptor,
587
587
ConversionPatternRewriter &rewriter) const override {
588
- // Check the result vector type
588
+ // Check the result vector type.
589
589
VectorType oldResultType = interleaveOp.getResultVectorType ();
590
590
Type newResultType = getTypeConverter ()->convertType (oldResultType);
591
591
if (!newResultType)
592
592
return rewriter.notifyMatchFailure (interleaveOp,
593
593
" unsupported result vector type" );
594
594
595
- // Interleave the indices
595
+ // Interleave the indices.
596
596
VectorType sourceType = interleaveOp.getSourceVectorType ();
597
597
int n = sourceType.getNumElements ();
598
598
599
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
601
- // use spirv::CompositeConstructOp.
600
+ // We cannot use ` spirv::VectorShuffleOp` directly in this case, and need to
601
+ // use ` spirv::CompositeConstructOp` .
602
602
if (n == 1 ) {
603
- SmallVector<Value> newOperands (2 );
604
- newOperands[0 ] = adaptor.getLhs ();
605
- newOperands[1 ] = adaptor.getRhs ();
603
+ Value newOperands[] = {adaptor.getLhs (), adaptor.getRhs ()};
606
604
rewriter.replaceOpWithNewOp <spirv::CompositeConstructOp>(
607
605
interleaveOp, newResultType, newOperands);
608
606
return success ();
0 commit comments