[ScheduleDAG] Fix removing edges with weak deps
authorAustin Kerbow <Austin.Kerbow@amd.com>
Mon, 23 Jan 2023 05:26:08 +0000 (21:26 -0800)
committerAustin Kerbow <Austin.Kerbow@amd.com>
Wed, 25 Jan 2023 18:05:50 +0000 (10:05 -0800)
commit913837eaa3d14a5fb68179f8210dc097383a048c
treeac56d57d785627f49a48b0593f67036beaebd3fd
parenta253a0bbe5ece7795633f8abeba7786e98a3e875
[ScheduleDAG] Fix removing edges with weak deps

In SUnit::removePred edges are removed from the Preds and Succs lists before
updating the bookkeeping. This could result in incorrect values for
NumPreds/SuccsLeft and cause WeakPreds/SuccsLeft to underflow, since the
incorrect SDep will be used to update these values.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D142325
llvm/lib/CodeGen/ScheduleDAG.cpp
llvm/test/CodeGen/AMDGPU/sched-barrier-hang-weak-dep.mir [new file with mode: 0644]