What is dead def?

I saw there is reference to dead def on registers in LLVM source code. I am not aware of this concept from the traditional course material. What are the properties of dead def?

Cheers
Thomson

I saw there is reference to dead def on registers in LLVM source code. I am not aware of this concept from the traditional course material. What are the properties of dead def?

Could it be a def that is never used (hence dead)?
If you mention where you saw it, it may be easier to help :slight_smile:

Best,

Mehdi

Thanks Mehdi. Below is an example of “dead def”, it looks like unused definition as you mentioned, could you confirm? I also saw dead defs in some generated code before register allocation, like “%reg1030 = ADD8rr %reg1028, %reg1029, %EFLAGS<imp-def,dead>”, does it mean similar for EFLAGS here?

Yes this is unused definition. The comments in AggressiveAntiDepBreaker explains it quite accurately. They can also comes from instructions that produce multiple results but only part of them are used (the EFLAGS is an example).

Mehdi