Skip to content

[flang][fir] Add external name mangling pass #1061

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 16, 2021

Conversation

clementval
Copy link
Collaborator

@clementval clementval commented Sep 15, 2021

The patch add a new pass called ExternalNameConversion. It converts the FIR internal name with the gfortran external name convention.

The pass is not applied by default in tco.

@clementval clementval marked this pull request as ready for review September 15, 2021 09:31
Copy link
Collaborator

@jeanPerier jeanPerier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me. I wondering if this should be run by default by tco or not. Since tco is not a real Fortran driver, I guess it's OK to not run this pass by default.

Regarding the pass name, I am OK with it, the pedantic comment would be that --external-abi might be a bit too generic since this is only dealing with the naming part of the ABI and that the target-rewrite pass (declared here) pass is also somehow Fortran ABI related. So --external-name-abi might be more descriptive, but wait for @schweitzpgi takes on this before changing it.

Copy link

@schweitzpgi schweitzpgi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. As far as what to call this, maybe something with "interoperability" and "name/naming" vs. "external ABI"? to focus on the naming aspect rather than anything about the binary interface.

@clementval clementval changed the title [flang][fir] Add external ABI mangling pass [flang][fir] Add external name mangling pass Sep 15, 2021
@clementval
Copy link
Collaborator Author

Looks good. As far as what to call this, maybe something with "interoperability" and "name/naming" vs. "external ABI"? to focus on the naming aspect rather than anything about the binary interface.

Thanks for the review. I renamed most of the ABI into Name and the pass option is now --external-name-interop

Copy link

@schweitzpgi schweitzpgi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@clementval
Copy link
Collaborator Author

FIx for #831 and #1003 (exit is a special case)

@clementval clementval merged commit bb1ab87 into flang-compiler:fir-dev Sep 16, 2021
@clementval clementval deleted the externalabi branch September 16, 2021 17:09
jeanPerier added a commit that referenced this pull request Sep 17, 2021
The added pass works when mlir::LLVM::LLVMDialect, mlir::acc::OpenACCDialect,
and mlir::omp::OpenMPDialect are present, which adds a dependency on those
dialect libraries.

https://github.com/flang-compiler/f18-llvm-project/blob/bb1ab876a5fec1eb3f2ab0603756f9124515a68a/flang/include/flang/Optimizer/Transforms/Passes.td#L189
jeanPerier added a commit that referenced this pull request Sep 17, 2021
The added pass works when mlir::LLVM::LLVMDialect, mlir::acc::OpenACCDialect,
and mlir::omp::OpenMPDialect are present, which adds a dependency on those
dialect libraries.

https://github.com/flang-compiler/f18-llvm-project/blob/bb1ab876a5fec1eb3f2ab0603756f9124515a68a/flang/include/flang/Optimizer/Transforms/Passes.td#L189
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants