[flang-commits] [flang] [Flang][CodeGen] Rematerialize pure ops with impure implementation (PR #196352)

via flang-commits flang-commits at lists.llvm.org
Mon May 11 06:34:43 PDT 2026


https://github.com/jeanPerier approved this pull request.

This looks OK to me.
A stronger solution would be make a fir.box copy in memory and pass that to the outlined region (assuming you have a way to give ownership of the memory to the outlined region somehow), that way it would still be OK to run CSE after this.
However, it is definitely tricky to make such copies in general because fir.convert are currently allowed to convert between fir.box of different size.
So your pass is a good solution for now I think.

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


More information about the flang-commits mailing list