On 12/16/2016 11:43 AM, Jakub Jelinek wrote:
On Fri, Dec 16, 2016 at 06:35:58PM +0000, Joseph Myers wrote:
On Thu, 15 Dec 2016, Jeff Law wrote:

This version attacks the problem by improving DSE to track stores to memory at
a byte level.  That allows us to determine if a series of stores completely
covers an earlier store (thus making the earlier store dead).

Question: suppose you have an assignment for a struct with padding, then
stores for all the elements.  Does it detect that the original assignment
is dead (because there is no need to copy padding on struct assignment)?

We fold memcpy into struct assignment early, does the same apply also to
memcpy?  Or shall we fold memcpy into struct assignment only when there is
no padding (or find different IL representation of that)?
So a memcpy would presumably cover the entire object, padding included.

Subsequent component stores would not cover the padding. So we'd trim the head/tail of the memcpy.


A memcpy folded to a structure assignment almost certainly covers the whole assignment when represented in an ao_ref. So it'd be no different -- except that I haven't written code to trim structure assignments (unless they're represented by a CONSTRUCTOR assignment). Regardless I would not suggest changing if/how/when we fold memcpy into a structure assignment.

Jeff

Reply via email to