Files
TheRock/rocm-systems/projects/rocprofiler-systems/external/dyninst/parseAPI/doc/API/Loop.tex
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

87 lines
2.6 KiB
TeX

\subsection{Class Loop}
\definedin{CFG.h}
The Loop class represents code that may execute repeatedly.
We detect both natural loops (loops that have a single entry block)
and irreducible loops (loops that have multiple entry blocks).
A back edge is defined as an edge that has its source in
the loop and has its target being an entry block of the loop.
It represents the end of an iteration of the loop.
For all the loops detected in a function, we also build a loop nesting
tree to represent the nesting relations between the loops.
See class \code{LoopTreeNode} for more details.
\begin{apient}
Loop* parent
\end{apient}
\apidesc{Returns the loop which directly encloses this loop. NULL if no such loop.}
\begin{apient}
bool containsAddress(Address addr)
\end{apient}
\apidesc{Returns true if the given address is within the range of this loop's basic blocks.}
\begin{apient}
bool containsAddressInclusive(Address addr)
\end{apient}
\apidesc{Returns true if the given address is within the range of this loop's basic blocks or its children.}
\begin{apient}
int getLoopEntries(vector<Block*>& entries);
\end{apient}
\apidesc{Fills \code{entries} with the set of entry basic blocks of the loop. Return the number of the entries that this loop has}
\begin{apient}
int getBackEdges(vector<Edge*> &edges)
\end{apient}
\apidesc{Sets \code{edges} to the set of back edges in this loop.
It returns the number of back edges that are in this loop.
}
\begin{apient}
bool getContainedLoops(vector<Loop*> &loops)
\end{apient}
\apidesc{Returns a vector of loops that are nested under this loop.}
\begin{apient}
bool getOuterLoops(vector<Loop*> &loops)
\end{apient}
\apidesc{Returns a vector of loops that are directly nested under this loop.}
\begin{apient}
bool getLoopBasicBlocks(vector<Block*> &blocks)
\end{apient}
\apidesc{Fills \code{blocks} with all basic blocks in the loop}
\begin{apient}
bool getLoopBasicBlocksExclusive(vector<Block*> &blocks)
\end{apient}
\apidesc{Fills \code{blocks} with all basic blocks in this loop, excluding the blocks of its sub loops.}
\begin{apient}
bool hasBlock(Block *b);
\end{apient}
\apidesc{Returns \code{true} if this loop contains basic block \code{b}.}
\begin{apient}
bool hasBlockExclusive(Block *b);
\end{apient}
\apidesc{Returns \code{true} if this loop contains basic block \code{b} and \code{b} is not in its sub loops.}
\begin{apient}
bool hasAncestor(Loop *loop)
\end{apient}
\apidesc{Returns true if this loop is a descendant of the given loop.}
\begin{apient}
Function * getFunction();
\end{apient}
\apidesc{Returns the function that this loop is in.}