This is an archive of the discontinued LLVM Phabricator instance.

Add an utility to lift aggregate loads in SROA.
AbandonedPublic

Authored by deadalnix on Oct 2 2015, 1:39 AM.

Details

Summary

This pretty much does the same thing as D12269 , but makes it in SROA so that we don't generate horribly inneffiscient code to optimize it just after.

Diff Detail

Event Timeline

deadalnix updated this revision to Diff 36336.Oct 2 2015, 1:39 AM
deadalnix retitled this revision from to Add an utility to lift aggregate loads in SROA..
deadalnix updated this object.
deadalnix added a subscriber: llvm-commits.
deadalnix updated this revision to Diff 36426.Oct 2 2015, 7:13 PM

Do not only lift from the first BB.

deadalnix updated this revision to Diff 36585.Oct 6 2015, 12:01 AM

Rebase and ping.

We we could avoid this going stale once again, that'd be great.

chandlerc edited edge metadata.Oct 7 2015, 6:40 PM

As I mentioned on the original thread, SROA already has logic to remove FCA loads and stores. We shouldn't *just* add more code to SROA, we should re-use (and possibly extend) the existing code.

Does this make sense?

I'm still not sure that we should *only* do this inside of SROA, but maybe that's enough...

I think doing this as part of SROA makes the more sense. Doing the transformation without SROA make things worse is many cases, on the other hand, running this as part of SROA give nice results even when no other pass runs. Clearly this can be seen as preparing the field so SROA can do more.

As for the memcpy temporary, it is necessary to not loose the information about the whole aggregate when there is padding. If you loose this information at one step, subsequents passes suddenly try to work hard to keep the padding intact, which result in suboptimal results, so simply "exploding" the memory access like SRAO does not cut it.

deadalnix updated this revision to Diff 37196.Oct 12 2015, 4:17 PM
deadalnix edited edge metadata.

Rebase and ping ?

deadalnix updated this revision to Diff 38469.Oct 26 2015, 3:21 PM

rebase, ping ?

deadalnix updated this revision to Diff 39266.Nov 4 2015, 3:08 PM

rebase, ping !?!!

Moving on with D14483 ( http://reviews.llvm.org/D14483 )

It doesn't handle cases where there is some padding, for which the right way forward is unclear, but at least get things moving forward when there is no padding, which is already something.

deadalnix abandoned this revision.Dec 14 2015, 6:03 PM