This is an archive of the discontinued LLVM Phabricator instance.

[LibCallsShrinkWrap] Teach the pass how to preserve the dominator
ClosedPublic

Authored by davide on Apr 26 2017, 12:33 PM.

Details

Summary

This has been proposed in the past, but I never got to implement it until today.

Diff Detail

Event Timeline

davide created this revision.Apr 26 2017, 12:33 PM
efriedma added inline comments.Apr 26 2017, 12:58 PM
lib/Transforms/Utils/LibCallsShrinkWrap.cpp
511

SplitBlockAndInsertIfThen has an optional DominatorTree argument.

davide updated this revision to Diff 96809.Apr 26 2017, 1:14 PM

Much easier, thanks for the pointer

efriedma accepted this revision.Apr 26 2017, 1:24 PM

Could you preserve the DT without requiring it? Not that it matters much for performance, but it would more clear why this pass is requesting the domtree.

This revision is now accepted and ready to land.Apr 26 2017, 1:24 PM

Could you preserve the DT without requiring it? Not that it matters much for performance, but it would more clear why this pass is requesting the domtree.

I'm not very familiar with the old pass manager infrastructure (I got involved only in new pass manager'y stuffs) and I don't want to cause troubles.
To double check, I just need to remove the addRequired() call/INITIALIZE_DEPENDENCY from the pass right? If so, I'll do another round of testing then commit.

And use getAnalysisIfAvailable(). Yes, I think that's it.

davide closed this revision.Apr 26 2017, 2:18 PM