[Mlir-commits] [mlir] [mlir][SPIR-V] Add support for SPV_INTEL_long_composites extension (PR #195685)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon May 4 22:56:55 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions h,cpp -- mlir/include/mlir/Target/SPIRV/SPIRVBinaryUtils.h mlir/lib/Target/SPIRV/Deserialization/DeserializeOps.cpp mlir/lib/Target/SPIRV/Deserialization/Deserializer.h mlir/lib/Target/SPIRV/Serialization/SerializeOps.cpp mlir/lib/Target/SPIRV/Serialization/Serializer.cpp mlir/lib/Target/SPIRV/Serialization/Serializer.h mlir/unittests/Dialect/SPIRV/SerializationTest.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/unittests/Dialect/SPIRV/SerializationTest.cpp b/mlir/unittests/Dialect/SPIRV/SerializationTest.cpp
index a0da5a52a..02fd844f8 100644
--- a/mlir/unittests/Dialect/SPIRV/SerializationTest.cpp
+++ b/mlir/unittests/Dialect/SPIRV/SerializationTest.cpp
@@ -277,7 +277,8 @@ bool hasLongCompositesCapabilityAndExtension(SmallVectorImpl<uint32_t> &b) {
if (op == spirv::Opcode::OpExtension) {
unsigned idx = 0;
if (spirv::decodeStringLiteral(operands, idx) ==
- spirv::stringifyExtension(spirv::Extension::SPV_INTEL_long_composites))
+ spirv::stringifyExtension(
+ spirv::Extension::SPV_INTEL_long_composites))
foundExt = true;
}
offset += wordCount;
@@ -387,14 +388,12 @@ TEST_F(SerializationTest, LongSpecConstantCompositeIsSplit) {
for (unsigned i = 0; i < kLongCompositeSize; ++i) {
std::string name = ("sc" + Twine(i)).str();
auto sc = spirv::SpecConstantOp::create(
- builder, loc, builder.getStringAttr(name),
- builder.getI8IntegerAttr(0));
+ builder, loc, builder.getStringAttr(name), builder.getI8IntegerAttr(0));
constituents.push_back(SymbolRefAttr::get(sc));
}
- spirv::SpecConstantCompositeOp::create(
- builder, loc, TypeAttr::get(arrayType),
- builder.getStringAttr("long_scc"),
- builder.getArrayAttr(constituents));
+ spirv::SpecConstantCompositeOp::create(builder, loc, TypeAttr::get(arrayType),
+ builder.getStringAttr("long_scc"),
+ builder.getArrayAttr(constituents));
ASSERT_TRUE(succeeded(spirv::serialize(module.get(), binary)));
EXPECT_TRUE(allInstructionsWithinWordLimit(binary));
@@ -428,9 +427,8 @@ TEST_F(SerializationTest, LongCompositeConstructIsSplit) {
Block *entry = funcOp.addEntryBlock();
OpBuilder bodyBuilder = OpBuilder::atBlockBegin(entry);
SmallVector<Value> constituents(kLongCompositeSize, entry->getArgument(0));
- auto cc =
- spirv::CompositeConstructOp::create(bodyBuilder, loc, arrayType,
- constituents);
+ auto cc = spirv::CompositeConstructOp::create(bodyBuilder, loc, arrayType,
+ constituents);
spirv::ReturnValueOp::create(bodyBuilder, loc, cc.getResult());
ASSERT_TRUE(succeeded(spirv::serialize(module.get(), binary)));
``````````
</details>
https://github.com/llvm/llvm-project/pull/195685
More information about the Mlir-commits
mailing list