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.
Differential D41299
[PDT] Fix splitBlock for Post Dom Trees dmgreen on Dec 15 2017, 9:30 AM. Authored by
Details
The previous function presumed that the PDT split This uses the applyUpdates interface to add/remove
Diff Detail Event TimelineComment Actions 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. Comment Actions 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 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. Comment Actions This has ended up been removed as a part of D41302. I've added everyone here to subscribers there. |