================
@@ -77,6 +77,54 @@ bool AMDGPUABIInfo::isHomogeneousAggregateSmallEnough(
return Members * NumRegs <= MaxNumRegsForArgsRet;
}
+/// Check if all fields in an aggregate type contain only sub-32-bit integer
+/// types. Such aggregates should be packed into i32 registers rather than
+/// passed as individual elements. Aggregates containing floats or full-sized
+/// integer types (i32, i64) should preserve their original types.
+static bool containsOnlyPackableIntegerTypes(const RecordDecl *RD,
+ const ASTContext &Context) {
+ for (const FieldDecl *Field : RD->fields()) {
+ QualType FieldTy = Field->getType();
+
+ // Recursively check nested structs
+ if (const auto *NestedRD = FieldTy->getAsRecordDecl()) {
----------------
addmisol wrote:
sure👍
https://github.com/llvm/llvm-project/pull/185083
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits