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

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 27 08:45:42 PDT 2017


dberlin added a comment.

(repeating comments i forgot to add to review) 
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.


https://reviews.llvm.org/D37575





More information about the llvm-commits mailing list