[Mlir-commits] [mlir] [mlir][vector] Add linearization pattern for vector.splat (PR #137651)

Nishant Patel llvmlistbot at llvm.org
Thu May 1 13:39:16 PDT 2025


================
@@ -415,6 +419,35 @@ struct LinearizeVectorBitCast final
   }
 };
 
+/// This pattern converts the SplatOp to work on a linearized vector.
+/// Following,
+///   vector.splat %value : vector<4x4xf32>
+/// is converted to:
+///   %out_1d = vector.splat %value : vector<16xf32>
+///   %out_nd = vector.shape_cast %out_1d : vector<16xf32> to vector<4x4xf32>
+/// It ensures that the operation is compatible with the target vector
----------------
nbpatel wrote:

oh my bad, fixed

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


More information about the Mlir-commits mailing list