[llvm] [MemCpyOpt] Calculate the offset value to forward `memcpy` (PR #87190)

Quentin Dian via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 31 15:27:29 PDT 2024


DianQK wrote:

> I am confused, the issue linked says you can remove memcpy, but the test that shows this only shows it being replaced with memmove?

`instcombine` or `dse` will remove `memcpy`: https://llvm.godbolt.org/z/EbxvWvrYb.
Of course, I could just delete it directly in `memcpyopt`, but that would make the code less charming. This is for `memcpy` forwarding.

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


More information about the llvm-commits mailing list