================
@@ -61,11 +88,20 @@ LogicalResult buildNewArgTypes(ArrayRef<Type> oldArgTypes,
Type origTy = oldArgTypes[idx];
switch (ac.kind) {
case ArgKind::Direct:
- // Direct with a coerced type means the wire signature uses the
- // coerced type; the body still expects origTy and we'll insert a
- // coercion at the entry block. Direct without a coerced type is a
- // true pass-through.
- newArgTypes.push_back(ac.coercedType ? ac.coercedType : origTy);
+ // Direct with canFlatten and a struct coerced type: push one wire type
+ // per field of the coerced struct rather than the struct itself.
+ // Single-field coerced structs fall through to the non-flatten path —
+ // the struct is already scalar-sized and flattening adds no value.
+ if (auto flatTy = getFlattenedCoercedType(ac)) {
----------------
adams381 wrote:
Spelled out `cir::RecordType`. Did the same at the other
`getFlattenedCoercedType` call sites.
https://github.com/llvm/llvm-project/pull/201719
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits