[Mlir-commits] [mlir] [mlir][spirv] Support function argument decorations for ptr in the PhysicalStorageBuffer (PR #76353)

Kohei Yamaguchi llvmlistbot at llvm.org
Thu Jan 4 22:41:14 PST 2024


================
@@ -177,6 +177,31 @@ LogicalResult Serializer::processUndefOp(spirv::UndefOp op) {
   return success();
 }
 
+LogicalResult Serializer::processFuncParameter(spirv::FuncOp op) {
+  for (auto [idx, arg] : llvm::enumerate(op.getArguments())) {
+    uint32_t argTypeID = 0;
+    if (failed(processType(op.getLoc(), arg.getType(), argTypeID))) {
+      return failure();
+    }
+    auto argValueID = getNextID();
+
+    // Process decoration attributes of arguments.
+    auto funcOp = cast<FunctionOpInterface>(*op);
+    for (auto argAttr : funcOp.getArgAttrs(idx)) {
+      if (auto decAttr = dyn_cast<DecorationAttr>(argAttr.getValue())) {
----------------
sott0n wrote:

Since this error is a verification on the IR side, I will add it to the test on the IR side, but is it necessary on the serialization/deserialization roundtrip side as well?

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


More information about the Mlir-commits mailing list