[Mlir-commits] [mlir] [mlir][spirv] Add basic support for SPV_EXT_replicated_composites (PR #147067)

Mohammadreza Ameri Mahabadian llvmlistbot at llvm.org
Mon Jul 7 01:33:39 PDT 2025


================
@@ -1589,6 +1640,42 @@ spirv::Deserializer::processSpecConstantComposite(ArrayRef<uint32_t> operands) {
   return success();
 }
 
+LogicalResult spirv::Deserializer::processSpecConstantCompositeReplicateEXT(
+    ArrayRef<uint32_t> operands) {
+
+  if (operands.size() != 3) {
+    return emitError(unknownLoc,
+                     "OpSpecConstantCompositeReplicateEXT must have "
+                     "type <id> and result <id> and only one parameter which "
+                     "is <id> of splat constant");
+  }
+
+  Type resultType = getType(operands[0]);
+  if (!resultType) {
+    return emitError(unknownLoc, "undefined result type from <id> ")
+           << operands[0];
+  }
+
+  auto compositeType = dyn_cast<CompositeType>(resultType);
+  if (!compositeType) {
+    return emitError(unknownLoc,
+                     "result type from <id> is not a composite type")
+           << operands[0];
+  }
+
+  auto resultID = operands[1];
+
+  auto symName = opBuilder.getStringAttr(getSpecConstantSymbol(resultID));
+  auto constituentSpecConstantOp = getSpecConstant(operands[2]);
+  auto op = opBuilder.create<spirv::EXTSpecConstantCompositeReplicateOp>(
----------------
mahabadm wrote:

Done.

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


More information about the Mlir-commits mailing list