[ScheduleDAG] When a node is cloned, add an edge between the nodes.
authorEli Friedman <efriedma@quicinc.com>
Fri, 4 Oct 2019 19:51:40 +0000 (19:51 +0000)
committerEli Friedman <efriedma@quicinc.com>
Fri, 4 Oct 2019 19:51:40 +0000 (19:51 +0000)
commit23ae13d51f23018eb88a2b78223604d4ccc64cce
tree77ae3d1ea28efa0cd01f52c92b0aacbe85750135
parent9809ed61353c401ec390170a278d27fff78b7d19
[ScheduleDAG] When a node is cloned, add an edge between the nodes.

InstrEmitter's virtual register handling assumes that clones are emitted
after the cloned node.  Make sure this assumption actually holds.

Fixes a "Node emitted out of order - early" assertion on the testcase.

This is probably a very rare case to actually hit in practice; even
without the explicit edge, the scheduler will usually end up scheduling
the nodes in the expected order due to other constraints.

Differential Revision: https://reviews.llvm.org/D68068

llvm-svn: 373782
llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
llvm/test/CodeGen/Thumb/scheduler-clone-cpsr-def.ll [new file with mode: 0644]