[PATCH] D34967: AMDGPU/SI: Fix Depth and Height computation for SI scheduler

Marek Olšák via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 25 13:37:51 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL309028: AMDGPU/SI: Fix Depth and Height computation for SI scheduler (authored by mareko).

Changed prior to commit:
  https://reviews.llvm.org/D34967?vs=105123&id=108150#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D34967

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
@@ -1422,8 +1422,8 @@
     else {
       unsigned Depth = 0;
       for (SIScheduleBlock *Pred : Block->getPreds()) {
-        if (Depth < Pred->Depth + 1)
-          Depth = Pred->Depth + 1;
+        if (Depth < Pred->Depth + Pred->getCost())
+          Depth = Pred->Depth + Pred->getCost();
       }
       Block->Depth = Depth;
     }
@@ -1437,7 +1437,7 @@
     else {
       unsigned Height = 0;
       for (const auto &Succ : Block->getSuccs())
-        Height = std::min(Height, Succ.first->Height + 1);
+        Height = std::max(Height, Succ.first->Height + Succ.first->getCost());
       Block->Height = Height;
     }
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34967.108150.patch
Type: text/x-patch
Size: 873 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170725/e39d65df/attachment.bin>


More information about the llvm-commits mailing list