I’m looking to see what’s the best way to solve the fact that these two utils mostly do the same thing:
- lib/Transforms/Utils/Local.cpp : MergeBasicBlockIntoOnlyPred
- lib/Transforms/Utils/BasicBlockUtils.cpp : MergeBlockIntoPredecessor
(+cc some of the folks who touched at least one of these either originally or recently)
1. MergeBasicBlockIntoOnlyPred 2. MergeBlockIntoPredecessor Update DT Update DT Update either DT or DDT Updates LI and MemoryDependenceResults Move all instructions from Pred to BB, delete Pred Move all instruction from BB to Pred, delete BB assert BB has single predecessor return if BB doesn’t have a single predecessor
Can I get some background on why there are two methods with such similar functionality?
Are folks ok with merging them into one?
If against merging, can we at least have both move instructions into the same direction (perhaps into Pred according to both function names)?
Please let me know your thoughts/preferences. I’d like to send up a cleanup patch soon for this.