[PATCH] [PATCH][SROA]Also slice the STORE when slicing a LOAD in AllocaSliceRewriter

Chandler Carruth chandlerc at google.com
Mon Sep 15 01:23:12 PDT 2014


On Fri, Sep 12, 2014 at 5:32 AM, James Molloy <james at jamesmolloy.co.uk>
wrote:

> Hi Chandler,
>
> I had a discussion with Jiangning about this based upon our chat on IRC,
> and he asked a question I couldn't answer, so possibly you could?
>
> On IRC you asserted that we need the wide store so that instcombines can
> see that the store was made up of two constitutent values. Why is this the
> case? Why can't memdep get you the same information with two narrow stores?
>

Because analyzing through memory is hard?

Not really sure what you're asking. instcombine doesn't have memdep, and
doesn't do the kind of analyses that GVN does. (Nor could it for compile
time reasons...)


>
> Surely a query such as "what does this i64 load depend on?" would return
> "these two i32 stores"? If this is not the case, why not?
>

It is the case in things which do heavy-weight memory load/store analyses,
but those aren't instcombine.


> and if it is the case, why can't instcombine use this information to dive
> across load/store boundaries?
>

Because instcombine is fundamentally about optimizing based on the SSA
graph, not based on value numbers or other load/store information about the
contents of memory.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140915/2880ec5a/attachment.html>


More information about the llvm-commits mailing list