[flang-commits] [flang] [flang] Inline scalar-to-array hlfir.assign at -O0 (PR #197092)
via flang-commits
flang-commits at lists.llvm.org
Tue May 12 01:06:23 PDT 2026
https://github.com/jeanPerier commented:
The InlineHLFIRAssign improvement looks great to me. However, with the pipeline change you have you will inline all array assignments at O0 for numerical/logical types where no alias can be proven at compile time.
I see two downside to it: missing conformity checks (currently done by the runtime) and increased code size.
Arguably conformity checks could be done in a cheaper way under an option, but FortranAssign is all we have currently. It is also a lot easier to debug code with runtime calls as you can use them as break points and verify the arguments properties/content.
Also, you will still fallback to FortranAssign runtime calls for array to array assignment where overlapping is not proven or that involve characters/derived type, so it seems you would still hit the same kind limitation as you try to support more complex code on inside OpenMP GPU region.
What I am saying is that I think I am fine with inlining simple scalar to array at O0, but your patch is doing more and it seems to fix your GPU problem in general you will need to inline all assignments at O0.
Is it not possible to modify/compile the runtime for the device in a way it would work there?
https://github.com/llvm/llvm-project/pull/197092
More information about the flang-commits
mailing list