Skip to content

CFG Normalisations #945

@acl-cqc

Description

@acl-cqc

~~ flattening/elision, a bit like MergeBBs at the outer/CFG level rather than block level.

As per spec....

  1. 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?)
  2. If the CFG has only an exit node, then the whole CFG can be removed
  3. 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
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions