Lowered functions
Last updated
Last updated
A lowered function is a set of IR instructions packaged as a single unit of computation. A lowered function has a name that must be unique across all linked modules.
A lowered function has a signature describing the type and passing conventions of its inputs and outputs.
A lowered function may have a body defined as a set of one or more basic blocks, one of which is designated as the function entry. A lowered function that does not define a body is called a stub and denotes the API of a function defined in another module or the ABI of a function linked from a binary.
TBD
A basic block is a non-empty sequence of . The first and last instructions of a basic block are called its entry and exit points, respectively. Control flow shall always enter at entry points and exit at exit points. The last instruction of a basic block shall be a .
A basic block may accept arguments.
Given two basic blocks bb1
and bb2
, bb1
is successor of bb2
(or, equivalently, bb2
is predecessor of bb1
) if the exit point of bb2
may cause control flow to jump to bb1
.
A basic block is reachable if it is an entry point or a successor of a reachable block. All basic blocks of a function shall be reachable in legal or canonical IR.
Given two basic blocks bb1
and bb2
:
bb1
dominates bb2
if control flow must go through bb1
before it can reach bb2
or if bb1
is bb2
;
bb1
strictly dominates bb2
if it dominates bb2
and it is not bb2
;
bb1
immediately dominates bb2
if it strictly dominates bb2
and does not strictly dominate any other basic block that strictly dominates bb2
.