This is an archive of the discontinued LLVM Phabricator instance.

[ScheduleDAG] When a node is cloned, add an edge between the nodes.
ClosedPublic

Authored by efriedma on Sep 25 2019, 6:59 PM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

efriedma created this revision.Sep 25 2019, 6:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 25 2019, 6:59 PM
rogfer01 accepted this revision.Sep 27 2019, 2:24 PM

Thanks @efriedma LGTM

Now that you're at it, could you also update the doxygen comments in ScheduleDAGRRList::{AddPredQueued, AddPred, RemovePred} because they don't return a boolean now.

This revision is now accepted and ready to land.Sep 27 2019, 2:24 PM
fhahn accepted this revision.Sep 30 2019, 2:21 PM

LGTM, thanks.

test/CodeGen/Thumb/scheduler-clone-cpsr-def.ll
2 ↗(On Diff #221877)

I think we could instead check the MIR after SelDAG, which would potentially make the test case a bit more independent of other changes in the backend,

This revision was automatically updated to reflect the committed changes.