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

Arseniy Obolenskiy llvmlistbot at llvm.org
Wed Oct 14 02:22:57 PDT 2026


================
@@ -1097,6 +1099,61 @@ static LogicalResult verifyRegionAttribute(Location loc, Type valueType,
          << symbol << "' attribute on region argument";
 }
 
+/// Verifies FuncParamAttr decorations. A missing index denotes a function
+/// result.
+static LogicalResult verifyFunctionParameterAttributes(
+    Location loc, Type type, Attribute attr,
+    std::optional<unsigned> index = std::nullopt) {
+  auto attrs = dyn_cast<ArrayAttr>(attr);
+  if (!attrs || attrs.empty() ||
+      !llvm::all_of(attrs,
+                    llvm::IsaPred<spirv::FunctionParameterAttributeAttr>))
+    return emitError(loc,
+                     "'spirv.func_param_attr' must be a non-empty array of "
----------------
aobolensk wrote:

spirv.func_param_attr -> getFuncParamAttrName()

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


More information about the Mlir-commits mailing list