[PATCH] D37575: [BasicBlock] add new function removeEdge()

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 26 15:33:55 PDT 2017


This definitely needs an RFC.

I'll note your approach is badly O(N) in some cases.
You could try using the uses instead (they know what operand number and
their uses).
I suspect that's hard to pass down everywhere in each pass.

In general If we are going to go this route, either we should: have a real
CFG structure that isn't going to be O(N) to remove an edge.
or incrementally, cache data in basic blocks (successor, predecessor lists
and uses) that gets invalidated, so you can find the removal points in
constant time.

The latter is likely to require a lot of verification to not generate hard
to track down bugs in the compiler.



On Mon, Sep 25, 2017 at 2:30 PM, Brian Rzycki via Phabricator <
reviews at reviews.llvm.org> wrote:

> brzycki added a comment.
>
> In https://reviews.llvm.org/D37575#880401, @kuhar wrote:
>
> > I'm fine with the patch, I think it goes into right direction with
> CFG-level IR manipulation.
> >  Please wait for someone else to give you a green light on this. Maybe
> it would be worth to mention this as an RFC on llvm-dev?
>
>
> Thanks for the review and you bring up a good point about RFC on llvm-dev.
> I'll make a post tomorrow morning and see where the conversation goes.
>
>
> https://reviews.llvm.org/D37575
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170926/ce8ac6a7/attachment.html>


More information about the llvm-commits mailing list