[PATCH] D74030: [DebugInfo] Avoid generating duplicate llvm.dbg.value

Alok Kumar Sharma via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 25 07:24:50 PST 2020


alok added a comment.

In D74030#1889750 <https://reviews.llvm.org/D74030#1889750>, @vsk wrote:

> In D74030#1888655 <https://reviews.llvm.org/D74030#1888655>, @alok wrote:
>
> > Now,
> >
> > 1. Avoid insertion of duplicate dbg.value if immediate next instruction is identical dbg.value. (avoids generating duplicates for same load/store, forward scan is not done)
>
>
> Why is it necessary to do (1)? If the goal is to have cleaner IR after LowerDbgDeclare, it seems like (2) achieves that.


Yes for me also it seems a bit difficult decision. There were few reasons which made me think to keep 1)
 a) It looks clearer to avoid generating than first let it generate and later delete when there is no performance penalty. In case of avoiding generation of dbg.value for same load/store again and again there is a pattern (immediate previous/next instruction in question).
 b) There is existing functionality for avoiding generation in function named "LdStHasDebugValue", though the name suggests covering both load and store both but it had handling only for store, adding the case for load justifies its name and completes the functionality. Either we should remove this function completely or complete it.

> 
> 
>> 2. Delete duplicate dbg.value in case duplicate dbg.value are present (may be inserted for different load/store) by calling RemoveRedundantDbgInstrs.




CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74030/new/

https://reviews.llvm.org/D74030





More information about the llvm-commits mailing list