Index: mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp =================================================================== --- mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp +++ mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp @@ -89,6 +89,11 @@ return failure(); vector::ExtractOp::Adaptor adaptor(operands); + if (adaptor.vector().getType().isa()) { + rewriter.replaceOp(extractOp, adaptor.vector()); + return success(); + } + int32_t id = getFirstIntValue(extractOp.position()); rewriter.replaceOpWithNewOp( extractOp, adaptor.vector(), id); Index: mlir/test/Conversion/VectorToSPIRV/simple.mlir =================================================================== --- mlir/test/Conversion/VectorToSPIRV/simple.mlir +++ mlir/test/Conversion/VectorToSPIRV/simple.mlir @@ -35,6 +35,7 @@ func @extract(%arg0 : vector<2xf32>) { %0 = "vector.extract"(%arg0) {position = [0]} : (vector<2xf32>) -> vector<1xf32> %1 = "vector.extract"(%arg0) {position = [1]} : (vector<2xf32>) -> f32 + %2 = "vector.extract"(%0) {position = [0]} : (vector<1xf32>) -> f32 spv.Return }