[llvm-dev] RFC: cleanup in Transforms/Utils

Davide Italiano via llvm-dev llvm-dev at lists.llvm.org
Wed Jun 13 14:09:49 PDT 2018


On Wed, Jun 13, 2018 at 2:04 PM, Alina Sbirlea <alina.sbirlea at gmail.com>
wrote:

> Hi,
>
> I'm looking to see what's the best way to solve the fact that these two
> utils mostly do the same thing:
> 1. lib/Transforms/Utils/Local.cpp : MergeBasicBlockIntoOnlyPred
> 2. lib/Transforms/Utils/BasicBlockUtils.cpp : MergeBlockIntoPredecessor
> (+cc some of the folks who touched at least one of these either originally
> or recently)
>
> Brief overview:
> 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?
>
>
I can't comment on whether there are two methods, but I wanted to merge
them myself at some point (although other priorities showed up).
I think we should keep the more general version and it should preserve the
analyses.

Thanks,

--
Davide
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180613/4b4cd79b/attachment.html>


More information about the llvm-dev mailing list