Each library procedure can have a set of basic annotations that provides the information needed to support the Broadway compiler's dataflow analysis framework. This information allows the compiler to properly interpret library calls, and to integrate them into traditional optimization passes such as code motion, copy propagation and redundancy elimination.
A library procedure has access to many different data objects in the application program, including the arguments passed into it, and possibly global objects as well. In addition, many libraries create and manage complex pointer-based data-structures that are built up from many objects. We have found that in order to correctly analyze library calls, it is essential to accurately model these data-structures. Thus, the basic annotations provide two kinds of information: (1) a list of the objects that are accessible to the procedure and describe their structure, and (2) a list of those objects whose contents are accessed or modified by the procedure (the ``uses'' and ``defs'').
The information is specified using a technique similar to interval analysis [20]. Interval analysis concisely summarizes the effects of a procedure, so that the compiler can analyze any code that calls the procedure without reanalyzing the procedure itself. Our language allows the library annotator to explicitly summarize the dataflow and pointer effects for each library procedure [28]. In some cases, a modern compiler could derive this information automatically from the library source. However, there are conditions under which this is infeasible or impossible. Many libraries encapsulate functionality for which no source code is available, such as low-level I/O or communication routines. Even if source is available, it may be simpler to provide the information declaratively, especially if it is well known.