This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/SI: Update SI scheduler colorHighLatenciesGroups
ClosedPublic

Authored by axeldavy on Feb 18 2017, 1:32 PM.

Details

Summary

Instead of grouping high latencies only when they are
order independant, group them when they do not have
data dependencies.
Add the required instructions to go from one high
latency to the other to the common group.

Diff Detail

Repository
rL LLVM

Event Timeline

axeldavy created this revision.Feb 18 2017, 1:32 PM
axeldavy updated this revision to Diff 91788.Mar 14 2017, 3:45 PM

Rebased to handle the new GetSubGraph.

vpykhtin added inline comments.
lib/Target/AMDGPU/SIMachineScheduler.cpp
683 ↗(On Diff #91788)

typo

720 ↗(On Diff #91788)

break?

728 ↗(On Diff #91788)

this should also leave outer loop

733 ↗(On Diff #91788)

don't need to run this loop if CompatibleGroup == false

736 ↗(On Diff #91788)

break;

axeldavy updated this revision to Diff 92682.Mar 22 2017, 12:28 PM

Added breaks. Fixed a Typo.

t-tye added a subscriber: t-tye.Mar 22 2017, 6:39 PM
tony-tye removed a subscriber: tony-tye.Mar 22 2017, 6:46 PM
vpykhtin added inline comments.Mar 23 2017, 8:06 AM
lib/Target/AMDGPU/SIMachineScheduler.cpp
725 ↗(On Diff #92682)

This loop looks the same as on line 739: how about making a function like:

bool hasDataDependancy(const SUnit &SU, const SUnit &FromSU) {
  for (const auto &PredDep : SU.Preds) {
      if (PredDep.getSUnit() == &FromSU && PredDep.getKind() == llvm::SDep::Data)
          return true;
  }
}
738 ↗(On Diff #92682)

break?

axeldavy updated this revision to Diff 92875.Mar 23 2017, 3:29 PM

Add helper function hasDataDependencyPred.

Use Topological order to justify we checks Preds only (thus previous code was wrong).

vpykhtin accepted this revision.Mar 24 2017, 8:37 AM

LGTM, Thanks!

This revision is now accepted and ready to land.Mar 24 2017, 8:37 AM
This revision was automatically updated to reflect the committed changes.