https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/220893
>From 8f94ced02191b13e2ca186e2b15eac311079f738 Mon Sep 17 00:00:00 2001 From: Henrich Lauko <[email protected]> Date: Thu, 3 Sep 2026 12:44:31 +0000 Subject: [PATCH] [CIR] Record why the CUDA registration attribute parses itself hasCustomAssemblyFormat with no explanation invites the question of whether a declarative assemblyFormat would do. It would not. The three flags print as presence-only keywords and parse in any order, while an optional group anchored on a `bool` parameter parses and prints a value, so the group would spell `extern true`. MLIR has no presence-only flag for `bool` in an attribute format, unlike UnitAttr in an operation format. struct(params) round-trips but spells the attribute `<device_side_name = "i", kind = Variable, isExtern = true>` instead of `<i, Variable, extern>`. NFC. --- clang/include/clang/CIR/Dialect/IR/CIRCUDAAttrs.td | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clang/include/clang/CIR/Dialect/IR/CIRCUDAAttrs.td b/clang/include/clang/CIR/Dialect/IR/CIRCUDAAttrs.td index 3362ff1812e34..c3662a92a43b8 100644 --- a/clang/include/clang/CIR/Dialect/IR/CIRCUDAAttrs.td +++ b/clang/include/clang/CIR/Dialect/IR/CIRCUDAAttrs.td @@ -92,6 +92,11 @@ def CIR_CUDAVarRegistrationInfoAttr : CIR_Attr<"CUDAVarRegistrationInfo", "cu.va "bool":$isManaged ); + // Not expressible as a declarative assemblyFormat. The three flags print as + // presence-only keywords and parse in any order, whereas an optional group + // anchored on a `bool` parameter parses and prints a value, so `extern` + // would have to spell `extern true`. struct(params) round-trips but costs + // the compact syntax. let hasCustomAssemblyFormat = 1; } _______________________________________________ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
