The purpose of patch is to learn Loop idiom recognition pass how to recognize simple memmove patterns
in similar way like GCC does: https://godbolt.org/z/dKjGvTGff
It's follow-up of following change: https://reviews.llvm.org/D104464
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Sorry for the delay. I've been occupied with other projects.
llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp | ||
---|---|---|
1275–1279 | Not sure I fully understand the FIXME. Why not drop the equals case? | |
1429 | Nit: please fix lint. | |
1431 | I feel the logic here is a bit hard to read. Whether it's memcpy or not, it both requires IsSameObject to be true. Maybe change this to bool UseMemMove = IsMemCpy || LoopAccessStore; And then move the IsSameObject check into MemmoveVerifier? |
Thank you for looking into this change. Since I'm busy with other projects too I will address comments and update patch tomorrow morning.
Rebased and addressed comments.
llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp | ||
---|---|---|
1275–1279 | Right, apparently I didn't think enough about that case so left fixme without good reason. | |
1431 | I agree logic is not very straightforward here. Your idea would work except isMemcpy and !IsSameObject case (like in memcpy-intrinsic.ll). |
llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp | ||
---|---|---|
1262 | Added some cosmetic improvements - more consts, refs instead pointers etc. |
Added some cosmetic improvements - more consts, refs instead pointers etc.