ISRO-2018 | Compilers

DU-chains(Definition-Use) in compiler design

  1. Consist of a definition of a variable and all its uses, reachable from that definition
  2. Are created using a form of static code analysis
  3. Are prerequisite for many compiler optimization including constant propagation and common sub-expression elimination
  4. All of the above




Answer: D

Explanation:

Use-Definition Chain (UD Chain) is a data structure that consists of a use, U, of a variable, and all the definitions, D, of that variable that can reach that use without any other intervening definitions. A UD Chain generally means the assignment of some value to a variable.

A counterpart of a UD Chain is a Definition-Use Chain (DU Chain), which consists of a definition, D, of a variable and all the uses, U, reachable from that definition without any other intervening definitions.

Both UD and DU chains are created by using a form of static code analysis known as data flow analysis. Knowing the use-def and def-use chains for a program or subprogram is a prerequisite for many compiler optimizations, including constant propagation and common subexpression elimination.

Refer : https://en.wikipedia.org/wiki/Use-define_chain

Practice unlimited  Gate CSE Questions

Do U have Better Solution?
Contribute your Solution in the Comment Section below.

GATE, ISRO, BARC, UGC-NET, NIELIT
Online Test Series available.

Leave a Reply