[PATCH] D30150: AMDGPU/SI: Update colorEndsAccordingToDependencies
Valery Pykhtin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 27 10:39:10 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL298861: [AMDGPU] SISched: Update colorEndsAccordingToDependencies (authored by vpykhtin).
Changed prior to commit:
https://reviews.llvm.org/D30150?vs=92874&id=93155#toc
Repository:
rL LLVM
https://reviews.llvm.org/D30150
Files:
llvm/trunk/lib/Target/AMDGPU/SIMachineScheduler.cpp
Index: llvm/trunk/lib/Target/AMDGPU/SIMachineScheduler.cpp
===================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIMachineScheduler.cpp
+++ llvm/trunk/lib/Target/AMDGPU/SIMachineScheduler.cpp
@@ -835,6 +835,17 @@
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 @@
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30150.93155.patch
Type: text/x-patch
Size: 1578 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170327/82b7d487/attachment.bin>
More information about the llvm-commits
mailing list