[flang-commits] [flang] [flang] introduce fir.copy to avoid load store of aggregates (PR #130289)

Slava Zakharin via flang-commits flang-commits at lists.llvm.org
Mon Mar 10 09:40:03 PDT 2025


vzakhari wrote:

> Codegen is generating a llvm.memcopy, not individual loads/stores, and I _think_ one can only set a single TBAA tag for llvm.memcopy. Maybe the tag can point to a metadata array? I am just not quite sure what are LLVM expectations regarding memcopy /memmove TBAA tags (in C/C++, you would probably be copying from/to entities of the same type, so a single TBAA node would probably be enough for "normal" TBAA). https://llvm.org/docs/LangRef.html#tbaa-metadata does not really talk about memcopy/memove (except for the tbaa.struct, that seems to be a quite different metadata node).

Right :(
Then the best we can do with the current TBAA scheme is what Tom described, i.e. tagging `fir.copy` with the common parent sub-root of the TBAA tree.

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


More information about the flang-commits mailing list