Skip to content

Commit dbea886

Browse files
committed
Remove check for source type and reformat code
1 parent f597218 commit dbea886

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -585,13 +585,6 @@ struct VectorInterleaveOpConvert final
585585
LogicalResult
586586
matchAndRewrite(vector::InterleaveOp interleaveOp, OpAdaptor adaptor,
587587
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-
595588
// Check the result vector type
596589
VectorType oldResultType = interleaveOp.getResultVectorType();
597590
Type newResultType = getTypeConverter()->convertType(oldResultType);
@@ -600,10 +593,11 @@ struct VectorInterleaveOpConvert final
600593
"unsupported result vector type");
601594

602595
// Interleave the indices
596+
VectorType sourceType = interleaveOp.getSourceVectorType();
603597
int n = sourceType.getNumElements();
604598

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
607601
// use spirv::CompositeConstructOp.
608602
if (n == 1) {
609603
SmallVector<Value> newOperands(2);
@@ -622,7 +616,7 @@ struct VectorInterleaveOpConvert final
622616
rewriter.replaceOpWithNewOp<spirv::VectorShuffleOp>(
623617
interleaveOp, newResultType, adaptor.getLhs(), adaptor.getRhs(),
624618
rewriter.getI32ArrayAttr(indices));
625-
619+
626620
return success();
627621
}
628622
};

0 commit comments

Comments
 (0)