[Mlir-commits] [mlir] [mlir][vector] Add support for linearizing Insert VectorOp in VectorLinearize (PR #92370)

Ivan Butygin llvmlistbot at llvm.org
Thu May 16 06:14:59 PDT 2024


================
@@ -355,6 +371,88 @@ struct LinearizeVectorExtract final
     return success();
   }
 
+private:
+  unsigned targetVectorBitWidth;
+};
+
+/// This pattern converts the InsertOp to a ShuffleOp that works on a
+/// linearized vector.
+/// Following,
+///   vector.insert %source %destination [ position ]
+/// is converted to :
+///   %source_1d = vector.shape_cast %source
+///   %destination_1d = vector.shape_cast %destination
+///   %out_1d = vector.shuffle %destination_1d, %source_1d [ shuffle_indices_1d
+///   ] %out_nd = vector.shape_cast %out_1d
+/// `shuffle_indices_1d` is computed using the position of the original insert.
+struct LinearizeVectorInsert final
+    : public mlir::OpConversionPattern<mlir::vector::InsertOp> {
----------------
Hardcode84 wrote:

nit: you can remove `mlir::` in most places

https://github.com/llvm/llvm-project/pull/92370


More information about the Mlir-commits mailing list