[Mlir-commits] [mlir] [mlir][SPIR-V] Add support for SPV_INTEL_long_composites extension (PR #195685)
Jakub Kuderski
llvmlistbot at llvm.org
Tue May 5 09:47:58 PDT 2026
================
@@ -125,11 +125,45 @@ LogicalResult spirv::Deserializer::sliceInstruction(
return success();
}
+void spirv::Deserializer::mergeLongCompositeContinuations(
+ spirv::Opcode opcode, ArrayRef<uint32_t> &operands,
+ SmallVectorImpl<uint32_t> &mergedStorage) {
+ std::optional<spirv::Opcode> continuationOp = getContinuationOpcode(opcode);
+ if (!continuationOp)
+ return;
+
+ auto binarySize = binary.size();
+ auto isNextContinuation = [&]() {
+ if (curOffset >= binarySize)
+ return false;
+ uint32_t wordCount = binary[curOffset] >> 16;
+ if (wordCount == 0 || curOffset + wordCount > binarySize)
+ return false;
+ return extractOpcode(binary[curOffset]) == *continuationOp;
+ };
+
+ if (!isNextContinuation())
+ return;
+
+ mergedStorage.assign(operands.begin(), operands.end());
----------------
kuhar wrote:
```suggestion
mergedStorage.assign(operands);
```
I think this should work
https://github.com/llvm/llvm-project/pull/195685
More information about the Mlir-commits
mailing list