[all-commits] [llvm/llvm-project] 3beec2: [flang] do not rely on existing fir.convert in Tar...

jeanPerier via All-commits all-commits at lists.llvm.org
Mon Sep 8 08:22:46 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3beec2f6875a9a41c4010db7d3ace5acdad48e5d
      https://github.com/llvm/llvm-project/commit/3beec2f6875a9a41c4010db7d3ace5acdad48e5d
  Author: jeanPerier <jperier at nvidia.com>
  Date:   2025-09-08 (Mon, 08 Sep 2025)

  Changed paths:
    M flang/lib/Optimizer/CodeGen/TargetRewrite.cpp
    M flang/test/Fir/struct-return-x86-64.fir

  Log Message:
  -----------
  [flang] do not rely on existing fir.convert in TargetRewrite (#157413)

TargetRewrite is doing a shallow rewrite of function signatures. It is
only rewriting function definitions (FuncOp), calls (CallOp) and
AddressOfOp. It is not trying to visit each operations that may have an
operand with a function type.
It therefore needs function signature casts around the operations it is
rewriting.

Currently, these casts were not inserted after AddressOfOp rewrites
because lowering tends to always insert function cast after generating
AddressOfOp to the void type so the pass relied on implicitly updating
this cast operand type to get the required cast. This is brittle because
there is no guarantee such convert must be here and canonicalization and
passes may remove them.

Insert a cast after on the result of rewritten operations. If it is
redundant, it will be canonicalized away later.



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