-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Description
~~ flattening/elision, a bit like MergeBBs at the outer/CFG level rather than block level.
As per spec....
- If the Entry node has no incoming edges (i.e. only receives control flow from the parent CFG node), then any ops in it (potentially even Tag) can be moved outside the CFG; if this leaves the Entry node as empty (pass-through), then we can point the CFG's entry ptr at the Exit node (...right? Will that break everything?)
- If the CFG has only an exit node, then the whole CFG can be removed
- If the Exit node has a single predecessor, and that predecessor has only one successor (i.e. the Exit node), then ops in the predecessor get moved outside the CFG. (This is like a special case of Merge basic blocks #561, as we can remove the predecessor, but we have to put things outside the CFG rather than in a new block.)
The second is trivial but the common factor is these require making changes outside the CFG node itself.
Combined, these mean that a CFG of a single BB leading to the exit, can be removed altogether.
Metadata
Metadata
Assignees
Labels
No labels