[llvm] [MemCpyOpt] Fix the invalid code modification for GEP (PR #68479)

Kai Yan via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 7 19:38:45 PDT 2023


kaiyan96 wrote:

> Instead of rolling back, we should not do the change until we know the transform will succeed. The simplest way to do that would be to move this check to the end. (Setting a variable to perform the move later would also work.)

According to this modification(https://reviews.llvm.org/D89623), which claim that "When performing a call slot optimization to a GEP dest, it will currently usually not apply, because the GEP is directly before the memcpy and as such does not dominate the call. We should move it above the call if that satisfies the domination requirement." I thought it is better to apply this move before some further checks.

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


More information about the llvm-commits mailing list