2 Commits

Author SHA1 Message Date
Yitzhak Mandelbaum
26db5e651b [clang][CFG] Support construction of a weak topological ordering of the CFG.
This patch adds support for building a weak topological ordering (WTO) of the
CFG blocks, based on a limit flow graph constructed via (repeated) interval
partitioning of the CFG.

This patch is part 2 of 2 for adding WTO support.

Differential Revision: https://reviews.llvm.org/D153058
2023-07-27 18:40:59 +00:00
Yitzhak Mandelbaum
f4cf51c99c [clang][CFG] Add support for partitioning CFG into intervals.
Adds support for the classic dataflow algorithm that partitions a flow graph
into distinct intervals. C.f. Dragon book, pp. 664-666.

A version of this algorithm exists in LLVM (see llvm/Analysis/Interval.h and
related files), but it is specific to LLVM, is a recursive (vs iterative)
algorithm, and uses many layers of abstraction that seem unnecessary for CFG
purposes.

This patch is part 1 of 2. The next patch will generalize the code to work on
intervals, to support computation of the limit flow graph.

Differential Revision: https://reviews.llvm.org/D152263
2023-06-27 17:07:54 +00:00