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

Jakub Kuderski llvmlistbot at llvm.org
Fri Jul 4 07:48:55 PDT 2025


================
@@ -1554,15 +1562,58 @@ spirv::Deserializer::processConstantComposite(ArrayRef<uint32_t> operands) {
   return success();
 }
 
+LogicalResult spirv::Deserializer::processConstantCompositeReplicateEXT(
+    ArrayRef<uint32_t> operands) {
+
+  if (operands.size() != 3) {
+    return emitError(
+        unknownLoc,
+        "OpConstantCompositeReplicateEXT 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 constantID = operands[2];
+
+  auto constantInfo = getConstant(constantID);
----------------
kuhar wrote:

Use the full types here since they are not obvious outside of IDE: https://llvm.org/docs/CodingStandards.html#use-auto-type-deduction-to-make-code-more-readable

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


More information about the Mlir-commits mailing list