0
$\begingroup$

I am learning about compilers at the moment and in my textbook it is briefly mentioned that UD/DU (Use-Def, Def-Use Chains) a way of saving information from the reaching definition is. It is just said that, when a variable is used, it has a list of the reaching definitions.

The problem that I am having is, that I am not clearly understanding the way this information is being used. How can this help the compiler optimize the code? Are there any other ways of saving (using) this information?

$\endgroup$

1 Answer 1

1
$\begingroup$

Here are just a few examples:

  • dead-code elimination,
  • instruction reordering, and
  • (implementation of) scoping/shadowing.
$\endgroup$
2
  • $\begingroup$ This does clarify the usage of this information, but are there any other ways to store the information from the reaching definition, except according to the usage of the variable (UD/DU Chains)? $\endgroup$
    – dsax7
    Commented Mar 11, 2018 at 20:48
  • $\begingroup$ @filtfilt I think you are asking a question that requires a book as an answer, but I may be wrong. Anyway, it's a very different question which you should possiblye post separately. $\endgroup$
    – Raphael
    Commented Mar 11, 2018 at 22:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.