Page MenuHomePhabricator

[MachineSink] Don't preserve MachineLoopInfo
AcceptedPublic

Authored by uabelho on Oct 4 2019, 5:40 AM.

Details

Reviewers
kuhar
chandlerc
Summary

In commit r373341 it was noted that MachineSink didn't preserve CFG and
MachineDominatorTree (MDT) even if it claimed it did. That was fixed in
the same commit by not claiming to preserve them anymore.

However, MachineSink still claims it preserves MachineLoopInfo (MLI),
but since MLI uses MDT I strongly suspect that when MDT goes invalid,
MLI should too.

There is also a minor discussion about this in
https://reviews.llvm.org/D68235

This patch now fixes that by changing MachineSink so it doesn't claim to
preserve MLI anymore.

I ran into this when debugging odd MLI crashes in my out-of-tree
target after r373341 so unfortunately I've no idea if it's possible to
reproduce it for in-tree targets.

Diff Detail

Event Timeline

uabelho created this revision.Oct 4 2019, 5:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 4 2019, 5:40 AM
Herald added a subscriber: hiraditya. · View Herald Transcript

Does this make sense?

Also, I'm not sure at all who could review this, if you know who, please add.

kuhar added a comment.Oct 4 2019, 2:04 PM

Would it be possible to add a verifyAnalysis function to MLI and check if a freshly calculated one matches the 'preserved' one?

Would it be possible to add a verifyAnalysis function to MLI and check if a freshly calculated one matches the 'preserved' one?

I don't know but it sounds like a good idea to me.
Not sure I can find the time to dig into that myself though (especially since I don't really know MLI).

kuhar accepted this revision.Oct 8 2019, 7:33 AM
This revision is now accepted and ready to land.Oct 8 2019, 7:33 AM
bjope added a subscriber: bjope.Oct 11 2019, 3:23 AM