[PATCH] D96938: [RFC] [Coroutine] [Debug] Insert dbg.declare to entry.resume to print alloca in the coroutine frame under O2

Chuanqi Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 17 23:47:40 PST 2021


ChuanqiXu added a comment.

The document (https://llvm.org/docs/SourceLevelDebugging.html#llvm-dbg-declare) says that `dbg.declare` is deprecated since it may obscure the optimization.
I think it is OK to use `dbg.declare` here. Since once we built the frame, it is hard to optimize the coroutine frame from my view.



================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:1223
       }
 
       // If we have a single edge PHINode, remove it and replace it with a
----------------
If we search for the `dbg.value` uses for parameters here and insert `dbg.declare` uses for the parameters, we could debug some parameter under O2 (for example `this`). But I am not sure if this is a good idea.


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

https://reviews.llvm.org/D96938



More information about the llvm-commits mailing list