[PATCH] Eliminate memcpy of undefined values
Chandler Carruth
chandlerc at google.com
Wed Feb 5 21:35:20 PST 2014
On Tue, Feb 4, 2014 at 11:45 PM, Nick Lewycky <nicholas at mxc.ca> wrote:
> Should SROA delete the ones it creates? Does it delete alloca+load?
SROA isn't flow-sensitive, and I'd prefer it not grow such smarts. As a
consequence, it doesn't know whether or not the memcpy source is undef or
not.
There are easy cases that it could handle (no stores to the newly created
alloca slice) but I think that's too much cleverness in SROA.
However, the easy case (no stores, so no flow analysis necessary) should be
handled by InstCombine if it isn't already. The flow-sensitive case of
course is harder.
However, MemCpyOptimization is also very poorly ordered in the pass
pipeline currently. That will limit the utility of this patch. I'm not sure
the exact best place to put it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140205/9216ffb7/attachment.html>
More information about the llvm-commits
mailing list