[flang-commits] [flang] [flang][hlfir] Extend InlineHLFIRCopy to inline copy_out with copy-back (PR #179096)

via flang-commits flang-commits at lists.llvm.org
Mon Feb 2 02:00:57 PST 2026


https://github.com/jeanPerier commented:

What is the use case / app where this change is bringing perf?

The reason this was not done for copy-out is because moving copy-in/out to the runtime was an deliberate choice because having inline code was initially very heavy for the compile time and code size with little/no impact on the performance (the initial implementation of copy-in/copy-out was everything inlined). 

@mrkajetanp brought some use case where the inline code brought more performance, in https://discourse.llvm.org/t/rfc-inline-hlfir-copy-in-for-trivial-types/86205/ where The decision was to limit the pass to the use case to avoid compilation time issues.

There is a good chance the compilation time issues we originally had will not show up again because:
- As @vzakhari mentioned in the discourse, there were other issues in the original lowering of copy-in/copy-out causing extra compilation time.
- @mrkajetanp added the possibility to add flags on the created loops to disable vectorization (which is where the most of  the time was lost).

However, can you please verify this by checking that your patch is not degrading the compilation time of  CPU2017/521.wrf (with  `-O3` so that this pass kicks-in)?

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


More information about the flang-commits mailing list