Skip to content

Commit da590f3

Browse files
committed
Fixes for review
1 parent 717429e commit da590f3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

flang/lib/Optimizer/CodeGen/Target.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -826,20 +826,23 @@ struct TargetAArch64 : public GenericTarget<TargetAArch64> {
826826
return marshal;
827827
}
828828

829+
// Determine if the type is a Homogenous Floating-point Aggregate (HFA). An
830+
// HFA is a record type with up to 4 floating-point members of the same type.
829831
static bool isHFA(fir::RecordType ty) {
830832
auto types = ty.getTypeList();
831833
if (types.empty() || types.size() > 4) {
832834
return false;
833835
}
834836

835837
if (!isa_real(types.front().second)) {
836-
types.front().second.dump();
837838
return false;
838839
}
839840

840841
return llvm::all_equal(llvm::make_second_range(types));
841842
}
842843

844+
// AArch64 procedure call ABI:
845+
// https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#parameter-passing
843846
CodeGenSpecifics::Marshalling
844847
structReturnType(mlir::Location loc, fir::RecordType ty) const override {
845848
CodeGenSpecifics::Marshalling marshal;
@@ -855,7 +858,7 @@ struct TargetAArch64 : public GenericTarget<TargetAArch64> {
855858

856859
// return in registers if size <= 16 bytes
857860
if (size <= 16) {
858-
auto dwordSize = (size + 7) / 8;
861+
std::size_t dwordSize = (size + 7) / 8;
859862
auto newTy = fir::SequenceType::get(
860863
dwordSize, mlir::IntegerType::get(ty.getContext(), 64));
861864
marshal.emplace_back(newTy, AT{});

0 commit comments

Comments
 (0)