COMPUTER SCIENCE AND ENGINEERING
COMPILER DESIGN
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Automatic detection of local common sub expressions
|
|
Detection of induction variables
|
|
Automatic detection of loop variant
|
|
None of these
|
Detailed explanation-1: -DAGs are a type of data structure. It is used to implement transformations on basic blocks. DAG provides a good way to determine the common sub-expression. It gives a picture representation of how the value computed by the statement is used in subsequent statements.
Detailed explanation-2: -While constructing a DAG, A check is made to find if there exists any node with the same value. A new node is created only when there does not exist any node with the same value. This action helps in detecting the common sub-expressions and avoiding the re-computation of the same.
Detailed explanation-3: -Directed Acyclic Graph (DAG) is a tool that depicts the structure of basic blocks, helps to see the flow of values flowing among the basic blocks, and offers optimization too. DAG provides easy transformation on basic blocks. DAG can be understood here: Leaf nodes represent identifiers, names or constants.
Detailed explanation-4: -A directed acyclic graph (DAG) is a conceptual representation of a series of activities. The order of the activities is depicted by a graph, which is visually presented as a set of circles, each one representing an activity, some of which are connected by lines, which represent the flow from one activity to another.