diff options
author | Valery Pykhtin <Valery.Pykhtin@amd.com> | 2017-03-27 17:26:40 +0000 |
---|---|---|
committer | Valery Pykhtin <Valery.Pykhtin@amd.com> | 2017-03-27 17:26:40 +0000 |
commit | ba3a4def29779b5ebb1533e66116bd4223f5aa9f (patch) | |
tree | d67c36e2099e0f1926f399a51d73519b5d049c92 | |
parent | ded235a141ef730e61c46fe1977c86fc98f31a32 (diff) | |
download | bcm5719-llvm-ba3a4def29779b5ebb1533e66116bd4223f5aa9f.tar.gz bcm5719-llvm-ba3a4def29779b5ebb1533e66116bd4223f5aa9f.zip |
[AMDGPU] SISched: Update colorEndsAccordingToDependencies
Patch by Axel Davy (axel.davy@normalesup.org)
Differential revision: https://reviews.llvm.org/D30150
llvm-svn: 298861
-rw-r--r-- | llvm/lib/Target/AMDGPU/SIMachineScheduler.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIMachineScheduler.cpp b/llvm/lib/Target/AMDGPU/SIMachineScheduler.cpp index 2e8e8ebc629..f77905336b2 100644 --- a/llvm/lib/Target/AMDGPU/SIMachineScheduler.cpp +++ b/llvm/lib/Target/AMDGPU/SIMachineScheduler.cpp @@ -835,6 +835,17 @@ void SIScheduleBlockCreator::colorEndsAccordingToDependencies() { unsigned DAGSize = DAG->SUnits.size(); std::vector<int> PendingColoring = CurrentColoring; + assert(DAGSize >= 1 && + CurrentBottomUpReservedDependencyColoring.size() == DAGSize && + CurrentTopDownReservedDependencyColoring.size() == DAGSize); + // If there is no reserved block at all, do nothing. We don't want + // everything in one block. + if (*std::max_element(CurrentBottomUpReservedDependencyColoring.begin(), + CurrentBottomUpReservedDependencyColoring.end()) == 0 && + *std::max_element(CurrentTopDownReservedDependencyColoring.begin(), + CurrentTopDownReservedDependencyColoring.end()) == 0) + return; + for (unsigned SUNum : DAG->BottomUpIndex2SU) { SUnit *SU = &DAG->SUnits[SUNum]; std::set<unsigned> SUColors; @@ -856,6 +867,9 @@ void SIScheduleBlockCreator::colorEndsAccordingToDependencies() { SUColors.insert(CurrentColoring[Succ->NodeNum]); SUColorsPending.insert(PendingColoring[Succ->NodeNum]); } + // If there is only one child/parent block, and that block + // is not among the ones we are removing in this path, then + // merge the instruction to that block if (SUColors.size() == 1 && SUColorsPending.size() == 1) PendingColoring[SU->NodeNum] = *SUColors.begin(); else // TODO: Attribute new colors depending on color |