This is an archive of the discontinued LLVM Phabricator instance.

[PPC] override the base implementatiosn of areLoadsFromSameBasePtr and shouldScheduleLoadsNear for PowerPC
AbandonedPublic

Authored by sfertile on Jan 25 2017, 6:59 AM.

Details

Summary

Implements overrides for the 'areLoadsFromSameBasePtr' function and 'shouldScheduleLoadsNear' function. Implementing these allows the pre-ra-scheduler to identify loads that are relatively close together and glue them together for scheduling purposes. The patch adds 2 back-end options allowing tuning of the number of vector/scalar loads to try to cluster together.

Diff Detail

Repository
rL LLVM

Event Timeline

sfertile created this revision.Jan 25 2017, 6:59 AM
sfertile updated this revision to Diff 85935.Jan 26 2017, 10:26 AM

Noticed spelling mistake and ended up simplifying the loop in getChainOperand as part of the cleanup.

hfinkel edited edge metadata.Jan 26 2017, 5:05 PM

Interesting; I didn't realize that our SDAG-based scheduling actually did anything at this point (i.e. we're just using source-order scheduling) - The MI scheduler is where the real action happens, and that has a different clustering API. You should look at TII->shouldClusterMemOps and the other things used by BaseMemOpClusterMutation in MachineScheduler.cpp. I think we should only implement these older interfaces if there's some fundamental advantage to doing so. Otherwise, I'd focus on what the MI scheduler uses.

lib/Target/PowerPC/PPCInstrInfo.cpp
1941

Space after 'if' (and so on for other 'if', 'while', etc. below).

2026

We should synchronize this with PPCTTIImpl::getCacheLineSize().

Thanks for the feedback. I was looking at cleaning up the loads/stores from memcpy expansions and this worked pretty good for 64 bytes and under. Looking at a 128 byte expansion in BoringSSL was showing a number of limitations with this approach though. I'll look into the things you mention in MachineScheduler to see if I can get the behavior I'm looking for there.

nemanjai edited edge metadata.Feb 23 2017, 3:53 AM

Is this patch superseded by https://reviews.llvm.org/D29779? If so, please abandon this patch so it moves out of the reviewers' list.

sfertile abandoned this revision.Mar 27 2017, 11:16 AM

After some investigation, I don't think LoadCluster/StoreCluster DAG mutations will provide the clustering I was looking to implement. Even with that I don't think we want to proceed with this patch either so I will abandon it as Nemanja suggests.