[FLANG][MLIR] Update all module symbol references after changing FuncOp symbol during...
authorAndrew Gozillon <Andrew.Gozillon@amd.com>
Wed, 1 Feb 2023 18:29:59 +0000 (12:29 -0600)
committerAndrew Gozillon <Andrew.Gozillon@amd.com>
Thu, 2 Feb 2023 10:59:32 +0000 (04:59 -0600)
commitf86209fc80d8a646ed5802d58f4ed6934d980d4e
tree3c416a3b62d5a41792d0264f6e5f8fe08c39effa
parent6188929dfbda9adebdd9a1393febd6dd08842ab3
[FLANG][MLIR] Update all module symbol references after changing FuncOp symbol during external name mangling

This fixes an issue where the symbols for operations that were not directly
handled by the rewriting in ExternalNameConversion.cpp were not updated
accurately when a FuncOp symbol was modified. Resulting in a name
mismatch between the FuncOp and the operation holding a symbol to
the FuncOp.

This fix works by updating all of the symbols relating to a FuncOp in a
module, this did not show up as an issue previously as fir::CallOps were
getting specific handling and only fir::CallOps were being tested. So
as the more larger case is now being handled the specific handling for
fir::CallOps has been removed (but is still handled by the fix).

Reviewers:
clementval

Differential Revision: https://reviews.llvm.org/D142918
flang/lib/Optimizer/Transforms/ExternalNameConversion.cpp
flang/test/Fir/external-mangling.fir