AMDGPU/SI: Fix SI scheduler refcount issue
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 19 Jul 2016 00:35:22 +0000 (00:35 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 19 Jul 2016 00:35:22 +0000 (00:35 +0000)
Without this fix, releaseSuccessors when InOrOutBlock is
false could release SUs outside the schedule BasicBlock.

Patch by Axel Davy

llvm-svn: 275935

llvm/lib/Target/AMDGPU/SIMachineScheduler.cpp

index 8de1c4a..7125b41 100644 (file)
@@ -464,6 +464,9 @@ void SIScheduleBlock::releaseSuccessors(SUnit *SU, bool InOrOutBlock) {
   for (SDep& Succ : SU->Succs) {
     SUnit *SuccSU = Succ.getSUnit();
 
+    if (SuccSU->NodeNum >= DAG->SUnits.size())
+        continue;
+
     if (BC->isSUInBlock(SuccSU, ID) != InOrOutBlock)
       continue;