what is dag in compiler design

11 months ago 25
Nature

In compiler design, DAG stands for Directed Acyclic Graph. It is a data structure used to implement transformations on basic blocks. DAG provides an efficient method for identifying common sub-expressions. To apply an optimization technique to a basic block, a DAG is generated as the result of an intermediate code generation. DAGs are used to depict the structure of basic blocks, see the flow of values flowing among the basic blocks, and offer a way to determine the common sub-expression. DAGs are also used to represent the intermediate code generated by the compiler.