[PATCH] D64709: [AMDGPU] fixed scheduler crash in gfx908

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 14 11:47:09 PDT 2019


rampitec created this revision.
rampitec added reviewers: arsenm, kzhuravl, msearles, b-sumner.
Herald added subscribers: t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely.

For some reason scheduler can send down an SUnit without an
instruction. This is an easy fix, although I do not have a
proper testcase at the moment. I will submit one separately
as soon as I have it.


https://reviews.llvm.org/D64709

Files:
  lib/Target/AMDGPU/AMDGPUSubtarget.cpp


Index: lib/Target/AMDGPU/AMDGPUSubtarget.cpp
===================================================================
--- lib/Target/AMDGPU/AMDGPUSubtarget.cpp
+++ lib/Target/AMDGPU/AMDGPUSubtarget.cpp
@@ -765,8 +765,8 @@
   FillMFMAShadowMutation(const SIInstrInfo *tii) : TII(tii) {}
 
   bool isSALU(const SUnit *SU) const {
-    const MachineInstr &MI = *SU->getInstr();
-    return TII->isSALU(MI) && !MI.isTerminator();
+    const MachineInstr *MI = SU->getInstr();
+    return MI && TII->isSALU(*MI) && MI->isTerminator();
   }
 
   bool canAddEdge(const SUnit *Succ, const SUnit *Pred) const {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64709.209740.patch
Type: text/x-patch
Size: 597 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190714/294f13f0/attachment.bin>


More information about the llvm-commits mailing list