[Mlir-commits] [mlir] [mlir][spirv] Add basic support for SPV_EXT_replicated_composites (PR #147067)
Jakub Kuderski
llvmlistbot at llvm.org
Wed Jul 9 11:06:24 PDT 2025
================
@@ -135,6 +135,47 @@ def SPIRV_ConstantOp : SPIRV_Op<"Constant",
let autogenSerialization = 0;
}
+
+// -----
+
+def SPIRV_EXTConstantCompositeReplicateOp : SPIRV_ExtVendorOp<"ConstantCompositeReplicate", [Pure]> {
+ let summary = [{
+ Declare a new replicated composite constant op.
+ }];
+
+ let description = [{
+ Represents a splat composite constant i.e., all elements of composite constant
+ have the same value.
+
+ #### Example:
+
+ ```mlir
+ %0 = spirv.EXT.ConstantCompositeReplicate [1 : i32] : vector<2xi32>
+
+ %0 = spirv.EXT.ConstantCompositeReplicate [1 : i32] : !spirv.array<2 x vector<2xi32>>
+
+ %0 = spirv.EXT.ConstantCompositeReplicate [dense<[1, 2]> : vector<2xi32>] : !spirv.array<2 x vector<2xi32>>
----------------
kuhar wrote:
nit: make sure that the SSA values have unique names
https://github.com/llvm/llvm-project/pull/147067
More information about the Mlir-commits
mailing list