This is an archive of the discontinued LLVM Phabricator instance.

[PDT] Fix splitBlock for Post Dom Trees
AbandonedPublic

Authored by dmgreen on Dec 15 2017, 9:30 AM.

Details

Reviewers
davide
Summary

The previous function presumed that the PDT split
would be the split of the DT split, which isn't the
case due to the way split takes some preds from the
old block.

This uses the applyUpdates interface to add/remove
the correct edges.

Diff Detail

Event Timeline

dmgreen created this revision.Dec 15 2017, 9:30 AM
fhahn added a subscriber: fhahn.Dec 15 2017, 11:09 AM
davide requested changes to this revision.Dec 15 2017, 11:12 AM
davide added a subscriber: davide.

This needs a test case.

This revision now requires changes to proceed.Dec 15 2017, 11:12 AM

Hello, Thanks for taking a look.

I went looking for tests for splitBlock on DomTrees and was surprised not to find anything. I guess it gets tested as part of preserving trees in normal IR tests. I will see if I can add something sensible.

I'm not 100% sure yet, but making this work with the updater from d40146 might need some changes. I will try it to see what the best way to handle these split blocks might be with that interface.

Hello, Thanks for taking a look.

I went looking for tests for splitBlock on DomTrees and was surprised not to find anything. I guess it gets tested as part of preserving trees in normal IR tests. I will see if I can add something sensible.

PostDominators are not really used extensively, so relying on the IR tests here is not the best idea. unittests/IR/DominatorTreeTest.cpp and/or unittests/IR/DominatorTreeBatchUpdatesTest.cpp should be good places to add a unit test that fails without this patch. I assume you have a case where you discovered the failure?

I'm not 100% sure yet, but making this work with the updater from d40146 might need some changes. I will try it to see what the best way to handle these split blocks might be with that interface.

I think the reason splitBlock is there is because it's cheap to update the DomTree in this case. If we have to use the applyUpdates, it might be better to batch those changes with all other DomTree changes.

dmgreen abandoned this revision.Jan 24 2018, 9:30 AM

This has ended up been removed as a part of D41302. I've added everyone here to subscribers there.