[all-commits] [llvm/llvm-project] 480e7f: [flang] correctly deal with bind(c) derived type r...

jeanPerier via All-commits all-commits at lists.llvm.org
Thu Oct 10 06:37:43 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 480e7f0667794822f7f3a065bed73d9a2ecc2d58
      https://github.com/llvm/llvm-project/commit/480e7f0667794822f7f3a065bed73d9a2ecc2d58
  Author: jeanPerier <jperier at nvidia.com>
  Date:   2024-10-10 (Thu, 10 Oct 2024)

  Changed paths:
    M flang/include/flang/Optimizer/CodeGen/Target.h
    M flang/include/flang/Optimizer/Dialect/FIROpsSupport.h
    M flang/lib/Optimizer/CodeGen/Target.cpp
    M flang/lib/Optimizer/CodeGen/TargetRewrite.cpp
    M flang/lib/Optimizer/Transforms/AbstractResult.cpp
    A flang/test/Fir/abstract-results-bindc.fir
    A flang/test/Fir/struct-return-x86-64.fir

  Log Message:
  -----------
  [flang] correctly deal with bind(c) derived type result ABI (#111678)

Derived type results of BIND(C) function should be returned according
the the C ABI for returning the related C struct type.

This currently did not happen since the abstract-result pass was forcing
the Fortran ABI for all derived type results.
use the bind_c attribute that was added on call/func/dispatch in FIR to
prevent such rewrite in the abstract result pass, and update the
target-rewrite pass to deal with the struct return ABI.

So far, the target specific part of the target-rewrite is only
implemented for X86-64 according to the "System V Application Binary
Interface AMD64 v1", the other targets will hit a TODO, just like for
BIND(C), VALUE derived type arguments.

This intends to deal with
https://github.com/llvm/llvm-project/issues/102113.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list