[flang-commits] [flang] [llvm] [flang][CodeGen] Add initial SystemZ ABI support (PR #208618)

Ulrich Weigand via flang-commits flang-commits at lists.llvm.org
Thu Aug 27 04:10:29 PDT 2026


================
@@ -1920,6 +1920,115 @@ struct TargetLoongArch64 : public GenericTarget<TargetLoongArch64> {
 };
 } // namespace
 
+//===----------------------------------------------------------------------===//
+// SystemZ target specifics.
+//===----------------------------------------------------------------------===//
+
+namespace {
+struct TargetSystemZ : public GenericTarget<TargetSystemZ> {
+  using GenericTarget::GenericTarget;
+
+  static constexpr int defaultWidth = 64;
+
+  auto complexType(mlir::Type eleTy, bool isResult) const {
+    assert(fir::isa_real(eleTy));
+    CodeGenSpecifics::Marshalling marshal;
+    unsigned short align{std::max(
+        static_cast<unsigned short>(getDataLayout().getTypeABIAlignment(eleTy)),
+        static_cast<unsigned short>(8))};
+    marshal.emplace_back(
+        fir::ReferenceType::get(mlir::TupleType::get(
+            eleTy.getContext(), mlir::TypeRange{eleTy, eleTy})),
+        AT{/*align=*/align, /*byval=*/!isResult, /*sret=*/isResult});
----------------
uweigand wrote:

Oh, I see here is another byval.  This is also incorrect, it should be indirect just as with structs.

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


More information about the flang-commits mailing list