[Mlir-commits] [mlir] [mlir][SPIRV] Support Alignment and FuncParamAttr on parameters (PR #231069)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sun Oct 11 22:49:45 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/lib/Dialect/SPIRV/IR/SPIRVDialect.cpp mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp mlir/lib/Target/SPIRV/Deserialization/Deserializer.h mlir/lib/Target/SPIRV/Serialization/SerializeOps.cpp mlir/lib/Target/SPIRV/Serialization/Serializer.cpp mlir/unittests/Dialect/SPIRV/DeserializationTest.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/DeserializationTest.cpp b/mlir/unittests/Dialect/SPIRV/DeserializationTest.cpp
index ec1df4254..aaad50fee 100644
--- a/mlir/unittests/Dialect/SPIRV/DeserializationTest.cpp
+++ b/mlir/unittests/Dialect/SPIRV/DeserializationTest.cpp
@@ -226,8 +226,9 @@ TEST_F(DeserializationTest, FunctionReturnAttributeUnsupported) {
   addFunctionEnd();
 
   ASSERT_FALSE(deserialize());
-  expectDiagnostic("FuncParamAttr decoration on result <id> 1 is not supported: "
-                   "expected OpFunctionParameter");
+  expectDiagnostic(
+      "FuncParamAttr decoration on result <id> 1 is not supported: "
+      "expected OpFunctionParameter");
 }
 
 TEST_F(DeserializationTest, FunctionParameterAttributeOnGlobalUnsupported) {
@@ -239,14 +240,16 @@ TEST_F(DeserializationTest, FunctionParameterAttributeOnGlobalUnsupported) {
        static_cast<uint32_t>(spirv::FunctionParameterAttribute::NoAlias)});
   auto intType = addIntType(32);
   auto ptrType = nextID++;
-  auto storageClass = static_cast<uint32_t>(spirv::StorageClass::CrossWorkgroup);
+  auto storageClass =
+      static_cast<uint32_t>(spirv::StorageClass::CrossWorkgroup);
   addInstruction(spirv::Opcode::OpTypePointer,
                  {ptrType, storageClass, intType});
   addInstruction(spirv::Opcode::OpVariable, {ptrType, varID, storageClass});
 
   ASSERT_FALSE(deserialize());
-  expectDiagnostic("FuncParamAttr decoration on result <id> 1 is not supported: "
-                   "expected OpFunctionParameter");
+  expectDiagnostic(
+      "FuncParamAttr decoration on result <id> 1 is not supported: "
+      "expected OpFunctionParameter");
 }
 
 TEST_F(DeserializationTest, FunctionParameterAttributeUnknownTarget) {
@@ -257,8 +260,9 @@ TEST_F(DeserializationTest, FunctionParameterAttributeUnknownTarget) {
        static_cast<uint32_t>(spirv::FunctionParameterAttribute::NoAlias)});
 
   ASSERT_FALSE(deserialize());
-  expectDiagnostic("FuncParamAttr decoration on result <id> 42 is not supported: "
-                   "expected OpFunctionParameter");
+  expectDiagnostic(
+      "FuncParamAttr decoration on result <id> 42 is not supported: "
+      "expected OpFunctionParameter");
 }
 
 class UnsupportedParameterDecorationTest
@@ -281,10 +285,10 @@ TEST_P(UnsupportedParameterDecorationTest, RejectWithSupportedDecoration) {
   auto voidType = addVoidType();
   auto intType = addIntType(32);
   auto ptrType = nextID++;
-  addInstruction(
-      spirv::Opcode::OpTypePointer,
-      {ptrType, static_cast<uint32_t>(spirv::StorageClass::CrossWorkgroup),
-       intType});
+  addInstruction(spirv::Opcode::OpTypePointer,
+                 {ptrType,
+                  static_cast<uint32_t>(spirv::StorageClass::CrossWorkgroup),
+                  intType});
   auto fnType = addFunctionType(voidType, {ptrType});
   addFunction(voidType, fnType);
   addInstruction(spirv::Opcode::OpFunctionParameter, {ptrType, argID});

``````````

</details>


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


More information about the Mlir-commits mailing list