[llvm-branch-commits] [clang] [CIR] Implement Direct+canFlatten in CallConvLowering (PR #201719)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Jun 12 09:05:18 PDT 2026


================
@@ -161,9 +197,12 @@ ArrayAttr updateArgAttrs(MLIRContext *ctx, ArrayRef<Type> origArgTypes,
     DictionaryAttr existing = DictionaryAttr::get(ctx);
     if (existingArgAttrs && oldIdx < existingArgAttrs.size())
       existing = cast<DictionaryAttr>(existingArgAttrs[oldIdx]);
-    if (ac.kind == ArgKind::Expand) {
-      // Push one empty attribute dict per expanded field; the flattened
-      // scalar arguments carry no special ABI attributes.
+    if (auto flatTy = getFlattenedCoercedType(ac)) {
+      // Direct + canFlatten: one empty dict per flattened field.
+      for (unsigned i = 0; i < flatTy.getNumElements(); ++i)
+        newArgAttrs.push_back(DictionaryAttr::get(ctx));
----------------
adams381 wrote:

Switched to `newArgAttrs.append(flatTy.getNumElements(), DictionaryAttr::get(ctx))`.


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


More information about the llvm-branch-commits mailing list