[PATCH] D107345: Introduce LowerGCLeafIntrinsics pass

Artur Pilipenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 4 19:15:09 PDT 2021


apilipenko added a comment.

I think the name of the pass is misleading. What you are doing here is you provide an inlined lowering for a memory builtin. Your current implementation has a limitation such that it only inlines gc-leaf element atomic memcpys. I don't think the fact that it is gc-leaf is critical here. This transform can be extended to handle non-GC leaf operations. It can also be extended to handle non-atomic operations.

Here are some high-level questions to this optimization:

- Should this lowering be a middle-end pass or something which resides in the backend?
- If we chose to do this as a middle-end pass, when should this pass be scheduled?
- How does this lowering interact with backend optimizations for memcpys? Like, replacing short constant length memcpys with loads/stores.
- Is it always profitable to inline a memcpy? Should we have some heuristic here to select hot and short memcpys?
- In this patch you do hand-rolled vectorization. Have you considered the alternative where you rely on the existing vectorizer instead?

I suggest writing a proposal to llvm-dev and discussing it there first.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107345/new/

https://reviews.llvm.org/D107345



More information about the llvm-commits mailing list