This is an archive of the discontinued LLVM Phabricator instance.

[LVI] Don't require DominatorTree in LVI (NFC)
ClosedPublic

Authored by nikic on Mar 28 2020, 5:50 AM.

Details

Summary

After D76797 there will no longer be any uses of the dominator tree in LVI, so we can remove it as a pass dependency, and also get rid of the dominator tree enabling/disabling logic in JumpThreading.

Apart from cleaning up the code, this also clarifies LVI cache consistency, in that the LVI cache can no longer depend on whether the DT was or wasn't enabled due to pending DT updates at any given time.

Diff Detail

Event Timeline

nikic created this revision.Mar 28 2020, 5:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 28 2020, 5:50 AM
lebedev.ri resigned from this revision.Apr 8 2020, 11:46 PM

No idea who is comfortable/qualified doing LVI reviews, but that isn't me.

nikic edited reviewers, added: fhahn; removed: lebedev.ri.May 17 2020, 1:37 PM
nikic added a comment.May 17 2020, 1:55 PM

I noticed that after this change, JumpThreading itself doesn't really make use of DT any more (only used for isReachableFromEntry, which can easily be replaced). But I guess this doesn't really matter, as JumpThreading needs to preserve the DT in any case.

fhahn added inline comments.May 18 2020, 1:09 AM
lib/Transforms/Scalar/JumpThreading.cpp
458

I think we flushed the DT updates here for LVI only? It would be good to drop this here (less frequent applying of updates should be quicker). If it is required somewhere else, we should move it there.

nikic updated this revision to Diff 264660.May 18 2020, 9:40 AM

Move getDomTree() call to LVI printer invocation.

nikic marked an inline comment as done.May 18 2020, 9:42 AM
nikic added inline comments.
lib/Transforms/Scalar/JumpThreading.cpp
458

I've moved the getDomTree() call to the printLVI() invocation. It doesn't really make a difference in practice because the DTU gets destroyed right after the runImpl() call, but at least this is clearer.

fhahn accepted this revision.May 19 2020, 4:35 AM

LGTM, thanks

This revision is now accepted and ready to land.May 19 2020, 4:35 AM
This revision was automatically updated to reflect the committed changes.