[PATCH] D55120: [MemCpyOpt] memset->memcpy forwarding with undef tail
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 13 09:00:25 PST 2018
nikic updated this revision to Diff 178076.
nikic edited the summary of this revision.
nikic added a comment.
This revision is now accepted and ready to land.
Fix memory dependence query. We need to query at the location of the memset, but with the size of the memcpy. Otherwise we miss possible writes in the region between the end of the memset and the end of the memcpy. Ideally we'd only query for locations in that region, but as there is no easy way to do so we just use the whole memcpy source region.
Add additional tests which have writes prior to the memset, either in the memset region (legal to optimize, but we currently don't), as well as after the memset region, or overlapping both (not legal to optimize).
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55120/new/
https://reviews.llvm.org/D55120
Files:
lib/Transforms/Scalar/MemCpyOptimizer.cpp
test/Transforms/MemCpyOpt/memset-memcpy-oversized.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55120.178076.patch
Type: text/x-patch
Size: 8632 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181213/9e99d94f/attachment.bin>
More information about the llvm-commits
mailing list